Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xinclude all children

From: Philippe Poulard <philippe.poulardNO@---------.-->
To: NULL
Date: 7/7/2008 11:23:00 AM

hi,

McSwell a écrit :
> I have an XML file that looks something like this:
> ------------------------
> <?xml ...?>
> <!DOCTYPE ...>
> <src:fragment id="foo" ...>
> <Ph:Item> some stuff  </Ph:Item>
> <Ph:Item> some more stuff </Ph:Item>
> ...
> <Ph:Item> still more stuff </Ph:Item>
> </src:fragment>
> ----------------------
> 
> I want to xinclude all the children of the root element into another
> XML file.  I've been trying things like
>    <xi:include href="firstFileName" xpointer="foo/1"/>

Provided that your XInclude engine support them, you can use the 
xpointer() scheme from the XPointer framework ; usually, tools that 
support them only support XPath, or a subset of XPath

If I don't make mistakes, try this :
<xi:include href="firstFileName" xpointer="xpointer(/foo/node())"/>
...but I don't remember if the spec doesn't impose limitations such as 
"there must be a single node" :(

You can try RefleX for performing your XInclusions where XPath is rather 
well supported :
http://reflex.gforge.inria.fr/
Here is a basic example with XInclude :
http://reflex.gforge.inria.fr/tutorial-basics.html#dtdValidation

And the result of the test suite, for DOM and SAX (both are supporting 
XPath)
http://reflex.gforge.inria.fr/tests-xinclude.html

> However, if(!) I'm understanding correctly, this would only xinclude
> the *first* child of the element named 'foo'.  Instead, I want to
> xinclude *all* the children.  I would have thought that this
>    <xi:include href="firstFileName" xpointer="foo/*"/>
> would work, but it generates an error:
>    XPointer evaluation failed: #foo/*
> All the variants of this that I've tried also fail.
> 
> How do I xinclude all children of the specified element?
> 
>    Mike Maxwell
>    CASL/ U MD


-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent