OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML Encoding of XPath: DTD



<!--

XML-Encoded XPath: an alternate syntax for XPath expressions

A relative location path is a series of AXIS elements.
An absolute location path is a series of AXIS elements, preceeded by the 
<root/> element.

A sequence of location steps is represented by a series
of elements of the AXIS type (see the parameter entity AXES ).

A location step has three parts:
	1. Axis
	The element used for the location step indicates the axis.

	2. Node test
	The attribute 'type', if not present or the empty string, means this 
location step returns node of the default type for this axis. Otherwise, 
it's one of:
	{comment|text|processing-instruction|node}

	The 'name' attribute is the base name of the nodes to match. It's ignored 
if the attribute 'type' is comment, text, or node. If 'type' is 
processing-instruction, the value might have colons in it as well. If the 
attribute is not present, or the empty string, it's the same as "*" in 
XPath.

	The 'nsURI' attribute is the URI part of the QName of the nodes to match.

	3. Zero or more predicates
	Each subelement of the AXIS element is the root operator of a predicate.

-->

<!ENTITY % AXES "
	ancestor		|
	ancestor-or-self	|
	attribute		|
	child			|
	descendant		|
	descendant-or-self	|
	following		|
	following-sibling	|
	namespace		|
	parent			|
	preceding		|
	preceding-sibling	|
	self
" >


<!ENTITY % OPERATORS "
	and	|
	or 	|
	eq	|
	ne	|
	lt	|
	le	|
	gt	|
	ge	|
	add	|
	sub	|
	mul	|
	div	|
	mod	|
	neg
" >

<!ENTITY % EXPR "
	%OPERATORS;	|
	%AXES;		|
	literal		|
	number		|
	variable	|
	function	|
	root
" >

<!ELEMENT literal (#PCDATA*) >
<!ELEMENT number  (#PCDATA*) >
<!ELEMENT variable (#PCDATA*) >
   <!-- $x becomes <variable>x</variable> -->
<!ELEMENT root EMPTY >

<!ELEMENT function (%EXPR;)* >
<!-- each subelement of a function is an argument -->
<!ATTLIST function
	name CDATA #REQUIRED >

<!ENTITY % AXIS-ATTLIST "
	type	CDATA #IMPLIED
	nsURI	CDATA #IMPLIED
	name	CDATA #IMPLIED
">

<!ELEMENT	ancestor		(%EXPR;)* >
<!ATTLIST	ancestor		%AXIS-ATTLIST; >
<!ELEMENT	ancestor-or-self	(%EXPR;)* >
<!ATTLIST	ancestor-or-self	%AXIS-ATTLIST; >
<!ELEMENT	attribute		(%EXPR;)* >
<!ATTLIST	attribute		%AXIS-ATTLIST; >
<!ELEMENT	child			(%EXPR;)* >
<!ATTLIST	child			%AXIS-ATTLIST; >
<!ELEMENT	descendant		(%EXPR;)* >
<!ATTLIST	descendant		%AXIS-ATTLIST; >
<!ELEMENT	descendant-or-self	(%EXPR;)* >
<!ATTLIST	descendant-or-self	%AXIS-ATTLIST; >
<!ELEMENT	following		(%EXPR;)* >
<!ATTLIST	following		%AXIS-ATTLIST; >
<!ELEMENT	following-sibling	(%EXPR;)* >
<!ATTLIST	following-sibling	%AXIS-ATTLIST; >
<!ELEMENT	namespace		(%EXPR;)* >
<!ATTLIST	namespace		%AXIS-ATTLIST; >
<!ELEMENT	parent			(%EXPR;)* >
<!ATTLIST	parent			%AXIS-ATTLIST; >
<!ELEMENT	preceding		(%EXPR;)* >
<!ATTLIST	preceding		%AXIS-ATTLIST; >
<!ELEMENT	preceding-sibling	(%EXPR;)* >
<!ATTLIST	preceding-sibling	%AXIS-ATTLIST; >
<!ELEMENT	self			(%EXPR;)* >
<!ATTLIST	self			%AXIS-ATTLIST; >

<!ELEMENT	and	( (%EXPR;),(%EXPR;) ) >
<!ELEMENT	or 	( (%EXPR;),(%EXPR;) ) >
<!ELEMENT	eq	( (%EXPR;),(%EXPR;) ) >	<!-- equals (=) -->
<!ELEMENT	ne	( (%EXPR;),(%EXPR;) ) > <!-- not equals (!=) -->
<!ELEMENT	lt	( (%EXPR;),(%EXPR;) ) > <!-- less than (<) -->
<!ELEMENT	le	( (%EXPR;),(%EXPR;) ) > <!-- less than or equals (<=) -->
<!ELEMENT	gt	( (%EXPR;),(%EXPR;) ) > <!-- greater than (>) -->
<!ELEMENT	ge	( (%EXPR;),(%EXPR;) ) > <!-- greater than or equals (>=) -->
<!ELEMENT	add	( (%EXPR;),(%EXPR;) ) > <!-- addition (+) -->
<!ELEMENT	sub	( (%EXPR;),(%EXPR;) ) > <!-- subtraction (-) -->
<!ELEMENT	mul	( (%EXPR;),(%EXPR;) ) > <!-- multiplication (*) -->
<!ELEMENT	div	( (%EXPR;),(%EXPR;) ) >
<!ELEMENT	mod	( (%EXPR;),(%EXPR;) ) >
<!ELEMENT	neg	(%EXPR;) >		<!-- unary minus (-) -->

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com