Re: saxon-help Digest, Vol 112, Issue 12

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: saxon-help Digest, Vol 112, Issue 12

Rudolf de Grijs
Thank you, Michael. That's really easy ;-)

ing. Rudolf de Grijs
Consultant

Contactgegevens
Jan Leentvaarlaan 21 - 3065 DC Rotterdam

T. +31(0)10 235 10 57 E. [hidden email]
M. +31(0)6 476 51 370 W. www.inovita.nl



BTW Nummer: NL 8091.30.198.B.01 - KvK: 24305459

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen.

-----Oorspronkelijk bericht-----
Van: [hidden email] [[hidden email]]
Verzonden: Friday, October 16, 2015 06:23
Aan: [hidden email]
Onderwerp: saxon-help Digest, Vol 112, Issue 12

Send saxon-help mailing list submissions to
[hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/saxon-help
or, via email, send a message with subject or body 'help' to
[hidden email]

You can reach the person managing the list at
[hidden email]

When replying, please edit your Subject line so it is more specific than "Re: Contents of saxon-help digest..."


Today's Topics:

   1. Re: Unable to pass parameter when chaining stylesheets
      (Michael Kay)
   2. Installing EXPath HTTP Client module for use with Saxon PE?
      (David Sewell)
   3. Re: saxon-help Digest, Vol 112, Issue 11 (Rudolf de Grijs)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 Oct 2015 14:13:05 +0100
From: Michael Kay <[hidden email]>
Subject: Re: [saxon] Unable to pass parameter when chaining
stylesheets
To: Mailing list for the SAXON XSLT and XQuery processor
<[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Have you tried th1.getTransformer().setParameter()?

Alternatively, use the s9api interface instead of JAXP?

Michael Kay
Saxonica

> On 15 Oct 2015, at 13:23, Rudolf de Grijs <[hidden email]> wrote:
>
> Is it possible to pass a parameter to a chained stylesheet?
>
> I?ve created the following simple test case
>
> xslt1 / not interested in the input to make it as simple as possible!
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
>     <xsl:param name="contextPath"></xsl:param>
>     <xsl:output method="xml"/>
>
>     <xsl:template match="/">
>         <first contextPath="{$contextPath}">
>             First xslt template ..
>         </first>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> xslt2
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
>    <xsl:param name="contextPath"></xsl:param>
>    <xsl:output method="xml"/>
>
>     <xsl:template match="/">
>         <second contextPath="{$contextPath}">
>             <xsl:copy>
>                 <xsl:apply-templates/>
>             </xsl:copy>
>         </second>
>     </xsl:template>
>
>     <xsl:template match="@* | node()">
>         <xsl:copy>
>                    <xsl:apply-templates select="@* | node()" />
>                 </xsl:copy>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> Scenario 1 ? run against 1 stylesheet
> /** stf is SaxonTransformerFactory */
> public void transformOne() throws TransformerConfigurationException,
> TransformerException {
>
>         Transformer t = stf.newTransformer(loadSource("xslt1.xsl"));
>
>
>         t.setParameter("contextPath", "/x/y/z");
>         t.transform(loadSource("users.xml"), new
> StreamResult(System.out)); }
>
> Result (which is ok!):
> <?xml version="1.0" encoding="UTF-8"?><first contextPath="/x/y/z">
>             First xslt template ..
> </first>
>
> And now chaining the two stylesheets
>   public void transform() throws TransformerConfigurationException, TransformerException {
>         TransformerHandler th1 = stf.newTransformerHandler(loadSource("xslt1.xsl"));
>         TransformerHandler th2 =
> stf.newTransformerHandler(loadSource("xslt2.xsl"));
>
>
>         /* setup XSLT pipeline */
>         th1.setResult(new SAXResult(th2));
>         th2.setResult(new StreamResult(System.out));
>         Transformer t = stf.newTransformer();
>
>         t.setParameter("contextPath", "/x/y/z");
>         t.transform(loadSource("users.xml"), new SAXResult(th1));
>     }
>
> Result (can?t get access to the parameter!):
> <?xml version="1.0" encoding="UTF-8"?> <second contextPath=""> <first
> contextPath="">
>                 First xslt template ..
>         </first>
> </second>
>
> Any help would be appreciated.
>
> Kind regards,
> Ruud de Grijs
> ing. Rudolf de Grijs
> Consultant
>
> Contactgegevens
> Jan Leentvaarlaan 21 - 3065 DC Rotterdam
>
> T. +31(0)10 235 10 57E. [hidden email] <[hidden email]>
> M. +31(0)6 476 51 370W. www.inovita.nl <http://www.inovita.nl/>
>
> BTW Nummer: NL 8091.30.198.B.01 - KvK: 24305459
>
> De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen.
> ----------------------------------------------------------------------
> -------- _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Thu, 15 Oct 2015 13:25:39 -0400 (EDT)
From: David Sewell <[hidden email]>
Subject: [saxon] Installing EXPath HTTP Client module for use with
Saxon PE?
To: [hidden email]
Message-ID:
<[hidden email]>
Content-Type: text/plain; format=flowed; charset=US-ASCII

I'm not having much luck installing the EXPath module that enables
http:send-request():

http://expath.org/modules/http-client/

The stumbling block is getting the prerequisite EXPath Packaging System to work.
I'm following the instructions at https://code.google.com/p/expath-pkg/ , but the "--repo" command-line flag doesn't appear to exist in Saxon 9.6 and I'm not having any luck setting the EXPATH_REPO environment variable as a substitute.

If anyone has a working setup and can share the details I'd be grateful,

David

--
David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400318, Charlottesville, VA 22904-4314 USA
Email: [hidden email]   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/



------------------------------

Message: 3
Date: Fri, 16 Oct 2015 04:23:02 +0000
From: Rudolf de Grijs <[hidden email]>
Subject: Re: [saxon] saxon-help Digest, Vol 112, Issue 11
To: "'[hidden email]'"
<[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------


------------------------------

_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
The saxon-help list is archived at http://saxon.markmail.org/

End of saxon-help Digest, Vol 112, Issue 12
*******************************************

------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: saxon-help Digest, Vol 112, Issue 12

Rudolf de Grijs
Thank you, Michael. th1.getTransformer().setParameter() works ;-).

Kind regards,
Ruud

ing. Rudolf de Grijs
Consultant

Contactgegevens
Jan Leentvaarlaan 21 - 3065 DC Rotterdam

T. +31(0)10 235 10 57 E. [hidden email]
M. +31(0)6 476 51 370 W. www.inovita.nl



BTW Nummer: NL 8091.30.198.B.01 - KvK: 24305459

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen.

-----Oorspronkelijk bericht-----
Van: [hidden email] [[hidden email]]
Verzonden: Friday, October 16, 2015 06:23
Aan: [hidden email]
Onderwerp: saxon-help Digest, Vol 112, Issue 12

Send saxon-help mailing list submissions to
[hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/saxon-help
or, via email, send a message with subject or body 'help' to
[hidden email]

You can reach the person managing the list at
[hidden email]

When replying, please edit your Subject line so it is more specific than "Re: Contents of saxon-help digest..."


Today's Topics:

   1. Re: Unable to pass parameter when chaining stylesheets
      (Michael Kay)
   2. Installing EXPath HTTP Client module for use with Saxon PE?
      (David Sewell)
   3. Re: saxon-help Digest, Vol 112, Issue 11 (Rudolf de Grijs)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 Oct 2015 14:13:05 +0100
From: Michael Kay <[hidden email]>
Subject: Re: [saxon] Unable to pass parameter when chaining
stylesheets
To: Mailing list for the SAXON XSLT and XQuery processor
<[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Have you tried th1.getTransformer().setParameter()?

Alternatively, use the s9api interface instead of JAXP?

Michael Kay
Saxonica

> On 15 Oct 2015, at 13:23, Rudolf de Grijs <[hidden email]> wrote:
>
> Is it possible to pass a parameter to a chained stylesheet?
>
> I?ve created the following simple test case
>
> xslt1 / not interested in the input to make it as simple as possible!
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
>     <xsl:param name="contextPath"></xsl:param>
>     <xsl:output method="xml"/>
>
>     <xsl:template match="/">
>         <first contextPath="{$contextPath}">
>             First xslt template ..
>         </first>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> xslt2
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
>    <xsl:param name="contextPath"></xsl:param>
>    <xsl:output method="xml"/>
>
>     <xsl:template match="/">
>         <second contextPath="{$contextPath}">
>             <xsl:copy>
>                 <xsl:apply-templates/>
>             </xsl:copy>
>         </second>
>     </xsl:template>
>
>     <xsl:template match="@* | node()">
>         <xsl:copy>
>                    <xsl:apply-templates select="@* | node()" />
>                 </xsl:copy>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> Scenario 1 ? run against 1 stylesheet
> /** stf is SaxonTransformerFactory */
> public void transformOne() throws TransformerConfigurationException,
> TransformerException {
>
>         Transformer t = stf.newTransformer(loadSource("xslt1.xsl"));
>
>
>         t.setParameter("contextPath", "/x/y/z");
>         t.transform(loadSource("users.xml"), new
> StreamResult(System.out)); }
>
> Result (which is ok!):
> <?xml version="1.0" encoding="UTF-8"?><first contextPath="/x/y/z">
>             First xslt template ..
> </first>
>
> And now chaining the two stylesheets
>   public void transform() throws TransformerConfigurationException, TransformerException {
>         TransformerHandler th1 = stf.newTransformerHandler(loadSource("xslt1.xsl"));
>         TransformerHandler th2 =
> stf.newTransformerHandler(loadSource("xslt2.xsl"));
>
>
>         /* setup XSLT pipeline */
>         th1.setResult(new SAXResult(th2));
>         th2.setResult(new StreamResult(System.out));
>         Transformer t = stf.newTransformer();
>
>         t.setParameter("contextPath", "/x/y/z");
>         t.transform(loadSource("users.xml"), new SAXResult(th1));
>     }
>
> Result (can?t get access to the parameter!):
> <?xml version="1.0" encoding="UTF-8"?> <second contextPath=""> <first
> contextPath="">
>                 First xslt template ..
>         </first>
> </second>
>
> Any help would be appreciated.
>
> Kind regards,
> Ruud de Grijs
> ing. Rudolf de Grijs
> Consultant
>
> Contactgegevens
> Jan Leentvaarlaan 21 - 3065 DC Rotterdam
>
> T. +31(0)10 235 10 57E. [hidden email] <[hidden email]>
> M. +31(0)6 476 51 370W. www.inovita.nl <http://www.inovita.nl/>
>
> BTW Nummer: NL 8091.30.198.B.01 - KvK: 24305459
>
> De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen.
> ----------------------------------------------------------------------
> -------- _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Thu, 15 Oct 2015 13:25:39 -0400 (EDT)
From: David Sewell <[hidden email]>
Subject: [saxon] Installing EXPath HTTP Client module for use with
Saxon PE?
To: [hidden email]
Message-ID:
<[hidden email]>
Content-Type: text/plain; format=flowed; charset=US-ASCII

I'm not having much luck installing the EXPath module that enables
http:send-request():

http://expath.org/modules/http-client/

The stumbling block is getting the prerequisite EXPath Packaging System to work.
I'm following the instructions at https://code.google.com/p/expath-pkg/ , but the "--repo" command-line flag doesn't appear to exist in Saxon 9.6 and I'm not having any luck setting the EXPATH_REPO environment variable as a substitute.

If anyone has a working setup and can share the details I'd be grateful,

David

--
David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400318, Charlottesville, VA 22904-4314 USA
Email: [hidden email]   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/



------------------------------

Message: 3
Date: Fri, 16 Oct 2015 04:23:02 +0000
From: Rudolf de Grijs <[hidden email]>
Subject: Re: [saxon] saxon-help Digest, Vol 112, Issue 11
To: "'[hidden email]'"
<[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------


------------------------------

_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
The saxon-help list is archived at http://saxon.markmail.org/

End of saxon-help Digest, Vol 112, Issue 12
*******************************************

------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help