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

Re: How to process a sequence of any type as input of

Subject: Re: How to process a sequence of any type as input of a transformation?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Jun 2018 15:53:25 -0000
Re:  How to process a sequence of any type as input of
On 12.06.2018 17:39, Olivier Jeulin olivier.jeulin.work@xxxxxxxxx wrote:

according to http://www.exselt.net/features/new-in-xslt-30/
bAny sequence of any type can be the input for the transformation, not just a document.b


I haven't found a clear statement of that in the norm, but I'd like to use this feature (using Saxon, so if the solution is specific, we can switch to the Saxon mailing list).

My use case is to read text lines from the output of another program using a pipe (GNU/linux):
someProg | xsltProcessor x.xsl


where the output of someProg is
line1
line2
b&
(I know how to do that using a parameter, or a file)

How can I access such a sequence from a stylesheet?

If you use the Saxon 9.8 Xslt30Transformer you can both set http://saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Xslt30Transformer.html#applyTemplates-net.sf.saxon.s9api.XdmValue- and http://saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Xslt30Transformer.html#setGlobalContextItem-net.sf.saxon.s9api.XdmItem-


as needed to a sequence of strings for example. I am not sure the command line interface of net.sf.saxon.Transform however allows that, so to interact with your GNU/Linux pipe you might need to write some Java command line program first processing the input and creating/generating an XdmValue as needed to then call Xslt30Transformer with that input.

In the XSLT code you can use
  <xsl:template match=".[. instance of xs:string]">
for instance to process a string value.

Current Thread

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