[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XML Encoding of XPath: DTD

  • From: Wayne Steele <xmlmaster@h...>
  • To: xml-dev@l...
  • Date: Wed, 14 Mar 2001 23:24:02 -0800

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.