[Home] [By Thread] [By Date] [Recent Entries]

  • From: Uche Ogbuji <uche@o...>
  • To: David Lee <dlee@c...>
  • Date: Sun, 18 Aug 2013 09:50:59 -0600

On Sun, Aug 18, 2013 at 9:35 AM, David Lee <dlee@c...> wrote:

--- 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.


Err, the answer is bog simple.  There was no XQuery in the days of XPath and XSLT 1.0.  That was back when XML technologies were actually designed with sensible separation of concerns in mind.


--
Uche Ogbuji                       http://uche.ogbuji.net
Founding Partner, Zepheira        http://zepheira.com
http://wearekin.org
http://www.thenervousbreakdown.com/author/uogbuji/
http://copia.ogbuji.net
http://www.linkedin.com/in/ucheogbuji
http://twitter.com/uogbuji


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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member