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

Re: XInclude, Xpointer and a text node.

  • From: Philippe Poulard <philippe.poulard@sophia.inria.fr>
  • To: Olivier Rossel <olivier.rossel@gmail.com>
  • Date: Fri, 16 Oct 2009 09:45:16 +0200

Re:  XInclude
Olivier Rossel a écrit :
> philippe,
> could you please provide a small example (command line, or java code
> snippet) about how to
> print a self contained document from a document that contains some xincludes?

Hi Olivier,

-download RefleX and unzip
java -jar reflex-0.4.0.jar run inclusion.xcl

-inclusion.xcl:
<?xml version="1.0" encoding="iso-8859-1"?>
<xcl:active-sheet xmlns:xcl="http://ns.inria.org/active-tags/xcl">
     <!--get an XInclude filter-->
     <xcl:parse-filter name="xinclude" 
source="http://www.w3.org/2001/XInclude"/>
     <!--connect a pipeline-->
     <xcl:parse name="input" source="in.xml" style="stream"/>
     <xcl:filter name="included" source="{ $input }" filter="{ $xinclude 
}"/>
     <!--transform SAX to XML-->
     <xcl:transform source="{ $included }" output="out.xml"/>
</xcl:active-sheet>
-An XInclude filter is just a special filter; you can also use other 
filters with <xcl:parse-filter> as explained here:
http://reflex.gforge.inria.fr/tutorial-pipelinesAndFilters.html

-in.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
     <xi:include href="alternate.xml" parse="xml" 
xpointer="xpointer(/inside/insideItr/text())"/>
</root>

-alternalte.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<inside>
  <insideItr>waza</insideItr>
</inside>

-out.xml:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude" 
xml:base="file:///path/to/in.xml">
     waza
</root>

you'll find another example here:
http://reflex.gforge.inria.fr/tutorial-basics.html#dtdValidation

> 
> On Thu, Oct 15, 2009 at 10:53 AM, Philippe Poulard
> <philippe.poulard@sophia.inria.fr> wrote:
>> Olivier Rossel a écrit :
>>> short answer (from the support team of Altova) : it might exist in a
>>> future version.
>> xerces supports xinclude, but i don't know if xpointer() is supported
>>
>> RefleX supports the xpointer() scheme as long as you use only XPath
>> expressions (don't use xpointer points and ranges); of course it works in
>> DOM-parsing style, but also in SAX-parsing style if your XPath expressions
>> don't have to look backwards
>>
>> have a look at what is supported here:
>> http://reflex.gforge.inria.fr/tests-xinclude.html
>>
>> --
>> Cordialement,
>>
>>              ///
>>             (. .)
>>  --------ooO--(_)--Ooo--------
>> |      Philippe Poulard       |
>>  -----------------------------
>>  http://reflex.gforge.inria.fr/
>>       Have the RefleX !
>>


-- 
Cordialement,

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


[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-2011 All Rights Reserved.