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

document identity in xpath : was RE: XPath and acontinuous, un

  • From: David Lee <dlee@calldei.com>
  • To: Uche Ogbuji <uche@ogbuji.net>
  • Date: Sun, 18 Aug 2013 15:35:15 +0000

document identity in xpath : was RE:  XPath and acontinuous

--- David

( I am not quite sure of the later ... is doc("x" ) == doc("x") ? ) 

----- Uche

Yes.  From the XSLT 1.0 spec, 12.1:

 

Two documents are treated as the same document if they are identified by the same URI. The URI used for the comparison is the absolute URI into which any relative URI was resolved and does not include any fragment identifier. One root node is treated as the same node as another root node if the two nodes are from the same document. Thus, the following expression will always be true:

 

generate-id(document("foo.xml"))=generate-id(document("foo.xml"))

 

-----------------------

 

This was confusing me why this would be in XSLT not in XPath (i.e fn:doc() is declared in XPath so both  XSLT and XQuery can use them.

<poke>

Found it !

http://www.w3.org/TR/xpath-functions/#func-doc

 

-----------------------------

By default, this function is http://www.w3.org/TR/xpath-functions/#stable. Two calls on this function return the same document node if the same URI Reference (after resolution to an absolute URI Reference) is supplied to both calls. Thus, the following expression (if it does not raise an error) will always be true:

doc("foo.xml") is doc("foo.xml")

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.