ZVON > >
Prev | Next |

7. Form of XPointer: short (child sequence)

This tutorial is obsolete. Please, use the new one.

Description

The specification defines one full form and two shorthand forms (which are abbreviations of the full one).




Shorthand XPointer expression - child sequences
"Child sequence" locates an element by stepwise navigation using a sequence of integers separated by slashes (/). This sequence may start with '/1' (because you may have only one document element) or a bare name. Each integer n locates the nth child of the previously located element. The example below selects the 3rd child of the 2nd child of the document element.
XPointer: /1/2/3
XPointer (alternative): xpointer(/*[1]/*[2]/*[3])

 <AAA>
   <BBB myid="b1" bbb="111">
     Text in the first element BBB.</BBB>
   <BBB myid="b2" bbb="222">
      Text in another element BBB.
     <DDD ddd="999">
       Text in more nested element.</DDD>
     <DDD ddd="888">
       Text in more nested element.</DDD>
     <DDD ddd="777">
       Text in more nested element.</DDD>
   </BBB>
   <CCC ccc="123" xxx="321">
     Again some text in some element.</CCC>
 </AAA>
  • X marks point (zero width)
  • This style marks the container node.
  • This style marks resulting locations.
  • X marks collapsed range (zero width)



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
answering service VoIP Internettelefonie DSL, SDSL, ADSL