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

Re: xquery can't find xinclude elements?

  • From: Michael Sokolov <sokolov@ifactory.com>
  • To: Michael Kay <mike@saxonica.com>
  • Date: Wed, 19 Jan 2011 08:20:24 -0500

Re:  xquery can't find xinclude elements?
Yes, and even if your parser supports xinclude, it's unlikely to support 
xpointer in any case.

You could probably achieve something similar (ie implement 
xinclude/xpointer yourself) in xquery, or xslt.

-Mike Sokolov

On 1/19/2011 6:00 AM, Michael Kay wrote:
> On 19/01/2011 08:41, trubliphone wrote:
>> Hello.
>>
>> I am having some trouble with a bit of XQuery - I think that my use 
>> of XInclude is the culprit.
>>
>> I have an XML file stored in eXist which uses XInclude to include 
>> other bits of XML:
>
> Your XQuery processor may or may not have an option to expand XInclude 
> directives while building the source tree. It's unlikely to happen by 
> default. If it doesn't have such an option, you will need to 
> preprocess the input with an XInclude processor.
>
> Michael Kay
> Saxonica
>
>>
>> myFile.xml:
>>
>> <myFile xmlns:xi="http://www.w3.org/2001/XInclude">
>> <a>
>> <xi:include href="myOtherFile.xml" xpointer="xpointer(//d)"/>
>> </a>
>> <b>
>> <foo/>
>> </b>
>> </myFile>
>>
>> myOtherFile.xml:
>>
>> <myOtherFile>
>> <c>
>> <foo/>
>> </c>
>> <d>
>> <foo/>
>> </d>
>> </myOtherFile>
>>
>> I try to access this using some XQuery code:
>>
>> let $foo := doc('myFile.xml')//foo[parent::b]
>>
>> But this doesn't return anything.
>>
>> However, if I write an expression which only accesses the explicit 
>> content of myFile.xml and not the included content from myOtherFile.xml:
>>
>> let $foo := doc('myFile.xml')//foo[parent::a]
>>
>> This returns <foo/> as expected.
>>
>> Does anybody know what I'm doing wrong?
>>
>> Many thanks for your help.
>>
>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>



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