Inxs Documentation Release 1a0 Frank Sachsenheim Jun 19, 2017
Download 171.78 Kb. Pdf ko'rish
|
- Bu sahifa navigatsiya:
- Contents 1 inxs Documentation, Release 0.1a0 2 Contents
-
inxs Documentation Release 0.1a0 Frank Sachsenheim Jun 19, 2017 Contents 1 At a glimpse 3 2 Roadmap 5 2.1
0.1b0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2
0.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3
7 3.1
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3
API documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.4
Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.5
Contributing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.6
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4
19 Python Module Index 21
ii inxs Documentation, Release 0.1a0 inxs is inexcessive. inxs is not XSLT. inxs is ISC-licensed. inxs is fully documented here: https://inxs.readthedocs.io .
inxs Documentation, Release 0.1a0 2 Contents CHAPTER 1 At a glimpse Wikipedia XSLT example #1 :
def extract_person (element):
element
. attrib[
'username' ], element . find(
'name' ) . text def append_person (previous_result, target): element
= etree
. SubElement(target, 'name' , {
'username' : previous_result[ 0 ]})
element . text = previous_result[ 1 ]
element transformation = Transformation( Rule( 'person'
, (extract_person, append_person)), result_object = 'context.target' , context = { 'target' : etree
. Element(
'root' )})
XSLT xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > method="xml" indent="yes" /> match="/persons" > select="person" /> match="person" > username="{@username}" > select="name" /> 3 inxs Documentation, Release 0.1a0 Wikipedia XSLT example #2 :
generate_skeleton (context, e): context
. html
= e . html( e . head(e . title( 'Testing XML Example' )),
e . body(e . h1(
'Persons' ), e
. ul()))
context . persons_list = context
. html
. xpath(
'./body/ul' , smart_prefix = True
)[ 0 ] def extract_person (element, persons): persons
. append((element . find(
'name' ) . text, element . find( 'family-name' ) . text)) def list_persons (previous_result, persons_list, e): persons_list . extend(e
. li(f
'{x[1]}, {x[0]}' )
x
previous_result) transformation = Transformation( lib . add_elementmaker(namespace = 'http://www.w3.org/1999/xhtml' ), generate_skeleton, Rule( 'person'
, extract_person), lib
. sorter(
'persons' , itemgetter( 1 )),
list_persons, result_object = 'context.html' , context = { 'persons' : []})
XSLT version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" > method="xml" indent="yes" encoding="UTF-8" /> match="/persons" > Testing XML Example Persons
select="person" > select="family-name" /> Download 171.78 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling