Исходный XML
<source>
<doc>
<ancprec>
<p>Preceeding Ancestor. <br/> </p>
</ancprec>
<gf>
<p>Ancestor. <br/> </p>
<pprec choice="a">
<p>Preceeding Parent. <br/>
</p>
</pprec>
<par>
<p>Parent. <br/> </p>
<sibprec>
<p>Preceeding
sibling. <br/>
</p>
</sibprec>
<me id="id001">
<p>Me. <br/>
</p>
<chprec>
<p>Preceeding
child. <br/>
</p>
</chprec>
<child
idref="id001"> <p>Child.
<br/> </p>
<dprec>
<p>preceeding
Descendant. <br/>
</p>
</dprec>
<desc>
<p>Descendant. <br/>
</p>
</desc>
<dfoll>
<p>Following
Descendant. <br/>
</p>
</dfoll>
</child>
<chfoll>
<p>following
child. <br/>
</p>
</chfoll>
</me>
<sibfoll>
<p>Following
Sibling. <br/>
</p>
</sibfoll>
</par>
<pfoll>
<p>Following Parent. <br/>
</p>
</pfoll>
</gf>
<ancfoll>
<p>following Ancestor. <br/> </p>
</ancfoll>
</doc>
</source>
Результат
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Document</title> </head> <body>
<H2>Following
Axis</H2><b>Following Sibling.<br> Following
Parent.<br> following
Ancestor.<br></b><H2>Descendant or Self
Axis</H2><b>Me.<br> Preceeding child.<br>
Child. <br>preceeding Descendant.<br> Descendant.<br>
Following Descendant.<br> following child.<br>
</b><H2>Descendant Axis</H2><b>Preceeding
child.<br> Child. <br>preceeding Descendant.<br>
Descendant.<br> Following Descendant.<br> following
child.<br> </b><H2>Self
Axis</H2><b>Me.<br> </b><H2>Child
Axis</H2><b>Preceeding child.<br> Child.
<br>following child.<br> </b><H2>Following
Axis</H2>
<p><b>Following
Sibling.<br> Following Parent.<br> following
Ancestor.<br></b><br><i>Note the lack of
ancestors here? <br>Learned anything about document order yet?</i></p> <H2>Following Sibling Axis</H2><b> Following Sibling.<br>
</b><H2>Attribute
Axis</H2><b>id001</b><H2>Parent
Axis</H2><b>Parent. <br></b><H2>Ancestor
or Self Axis</H2><b>Ancestor. <br>Parent.
<br>Me.<br> </b><H2>Ancestor
Axis</H2><b>Ancestor. <br>Parent.
<br></b><H2>Preceding Sibling
Axis</H2><b>Preceeding sibling.<br>
</b><H2>Preceeding Axis</H2><b><i>Not
Implemented in XT 22 09 99</i></b><H2>Namespace
Axis</H2><b><i>Not Implemented in XT 22 09
99</i></b></body> </html>
Представление HTML
Following AxisFollowing Sibling. Following Parent. following Ancestor.
Descendant or Self AxisMe. Preceeding child. Child. preceeding Descendant. Descendant. Following Descendant. following child. Descendant AxisPreceeding child. Child. preceeding Descendant. Descendant. Following Descendant. following child. Self AxisMe. Child AxisPreceeding child. Child. following child. Following Axis
Following Sibling. Following Parent. following Ancestor.
Note the lack of ancestors here? Learned anything
about document order yet?
Following Sibling Axis
Following Sibling.
Attribute Axisid001Parent AxisParent.
Ancestor or Self AxisAncestor. Parent. Me. Ancestor AxisAncestor. Parent.
Preceding Sibling AxisPreceeding sibling. Preceeding AxisNot Implemented in XT 22 09 99Namespace AxisNot Implemented in XT 22 09 99
|