XPointers

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email
If we want to embed only the line of the street address then we can use the following syntax.,

<des> The areas named below have software firms</des>

<areaname> Area name

<mylink xml: link="simple" show="embed" href="addr.xml I id(s2)">

</mylink>

</areaneme>

<area>
The browser, that is the user agent, has to be informed of the type of the pointer we are employing. In the above example id has been used as the identifier.

Locator syntax

The value of the href attribute is identified by the locator element. The syntax of the locator is as follows:

The URL followed by I or# followed by XPointer or a name. The pipe-stem symbol is used instead of the # symbol since XPointers retrieve only a part of a document.

The syntax of the XPointer consists of a series of location terms separated by a period. The locations are defined in terms of the previous location. There are two types of locations namely:

1 . Absolute location.
2. Relative location.

Absolute location

Absolute location is of four different types namely:

Root
Origin
Element with an ID
An HTML type location

The following example mydoc.xml illustrates the use of all the four kinds of absolute locations.

<mydoc>

<first>This is line one</first>

<second>This Is the second<mylink xml: link="simple" href="#" , link</mylink> </second>

<third id="3">This is line three</third>

<A name="last"/>

</mydoc>

Root

The root identifies the root element of an XML document. Consider our document. Any linkfrom other documents referring to this document would use the following syntax.

"href = mydoc.xml # root()"

The above syntax is absolutely useless because if no pointer is added the root of the document is implied.

Origin

The origin absolute location is used to point to a location in the same document. The syntax for the origin attribute is as follows:

href = #origino.following(l,#element)

Element with an ID

The type pointer has been used in our example.

Iine The above link points to the element named third in the XML document. In case the locator is present outside the document then the link would look like: <mylink xml: link=" simple" href="mydoc.xml#3">Iine</mylink>
An HTML type Location

Any document that wants to point to the <A name = "last"/> element in the above example the following syntax has to be used.

<mylink xml:link = "simple' herf ="mydoc.xml #html(last)">Iinl </mylink>

Relative Location

XPointers always start with an absolute locator. If no absolute locator is mentioned the root is implied. Some of the keywords associated with relative locations are the following:

child

Locates direct child nodes of the context node, including element, pi, comment, and text. Attributes are not considered children of the elements that bear them (for locating them, use the attribute axis).

descendent

Locates nodes of the same types as child, but appearing anywhere within the content of the context node.

Identical to the descendant axis except that the context node itself is included as a candidate, preceding all descendants.

parent

Locates the element node directly containing the context node, or directly bearing it if it is an attribute.

ancestor

Locates element nodes containing the context node (since only elements properly have children as ' defined here). The first node in the list is the immediate parent of the context node.

ancestor-or-self

Identical to the ancestor axis except that the context node itself is included as a candidate, preceding all ancestors. This axis is particularly useful when a precise location is specified by an ID, but there are constraints on the minimal unit to be treated as the final location, such as always locating the containing SECTION whether the ID is on the SECTION or on some particular descendant.

preceding-sibling

Locates sibling nodes (nodes that share the same parent as the context node) that appear before (preceding) the context node. The nodes are considered in reverse document order, so that the first node in the list is the immediately preceding sibling, and the last node in the list is the first child of the parent.

following-sibling

Locates sibling nodes (nodes that share the same parent as the context node) that appear after (following) the context node. The nodes are considered in document order.

preceding

Locates nodes that begin before (preceding) the entire context node. The list is in reverse document order: the node closest to the context node first, root() last. Ancestors are included.

following

Locates nodes that begin after (following) the entire context node. The list is in document order: the first node in the list is for the first node whose start-tag occurs after the context node's end-tag; no ancestors are included.

self

Locates (for each context node), a singleton node list containing that same context node. Note: This is useful for applying multiple predicates to a single axis, particularly when predicates other than the first one must test a context node's position among all those context nodes that were selected by the prior predicates.

attribute

The attributes of the context node. If the context node is not of the type element, the list is empty: The order and position of nodes on this axis are undefined. Typically, a single attribute will be selected by name.



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.