[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] 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 10:24:56 +0200
Olivier Rossel a écrit :
> that sounds very cool.
> The only missing part is how not to hardcode the values for in.xml and
> out.xml in the file, but provide them from the command line.
Use the SYSTEM module for that purpose:
<xcl:active-sheet
xmlns:xcl="http://ns.inria.org/active-tags/xcl"
xmlns:sys="http://ns.inria.org/active-tags/sys">
change
<xcl:parse name="input" source="in.xml" style="stream"/>
with:
<xcl:parse name="input" source="{ string( $sys:env/in ) }" style="stream"/>
and change:
<xcl:transform source="{ $included }" output="out.xml"/>
with:
<xcl:transform source="{ $included }" output="{ string( $sys:env/out ) }"/>
and supply the "in" and "out" system parameters when running:
java -Din=in.xml -Dout=out.xml -jar reflex-0.4.0.jar run inclusion.xcl
>
> On Friday, October 16, 2009, Philippe Poulard
> <philippe.poulard@sophia.inria.fr> wrote:
>> 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 !
>>
>
> _______________________________________________________________________
>
> 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
>
--
Cordialement,
///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
- References:
- XInclude, Xpointer and a text node.
- From: Olivier Rossel <olivier.rossel@gmail.com>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Philippe Poulard <philippe.poulard@sophia.inria.fr>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Olivier Rossel <olivier.rossel@gmail.com>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Olivier Rossel <olivier.rossel@gmail.com>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Philippe Poulard <philippe.poulard@sophia.inria.fr>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Olivier Rossel <olivier.rossel@gmail.com>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Philippe Poulard <philippe.poulard@sophia.inria.fr>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Olivier Rossel <olivier.rossel@gmail.com>
- Re: [xml-dev] XInclude, Xpointer and a text node.
- From: Philippe Poulard <philippe.poulard@sophia.inria.fr>
- Re: XInclude, Xpointer and a text node.
- From: Olivier Rossel <olivier.rossel@gmail.com>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]