ZVON > >
Prev | Next |

19. range vs. range-inside: root

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

Description

Here the results are identical. The range function returns ranges covering the locations in the argument location-set. For each location x in the argument location-set, a range location representing the covering range of x is added to the result location set. The range-inside function returns ranges covering the contents of the locations in the argument location-set.




Range function
For the root location, the container node of the start point and end point of the covering range is the root node; the index of the start point of the covering range is 0; and the index of the end point of the covering range is the number of children of the root location.
XPointer: xpointer(range(/))

<?xml version="1.0"?>
<xml:comment> My comments here. </xml:comment>
<AAA>
  <BBB bbb="111">
    Text in the first element BBB.</BBB>
  <BBB bbb="222">
    Text in another element BBB.
    <DDD ddd="999">
      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)


Range-inside function
If the argument is not a range, than it is used as a container location of the start- and end-points of the resulting range. In this example the container is / (root element).
XPointer: xpointer(range-inside(/))

<?xml version="1.0"?>
<xml:comment> My comments here. </xml:comment>
<AAA>
  <BBB bbb="111">
    Text in the first element BBB.</BBB>
  <BBB bbb="222">
    Text in another element BBB.
    <DDD ddd="999">
      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
Web Design Chicago VoIP Internettelefonie DSL, SDSL, ADSL