Re: [xsl] xslt create a variable from external xml file

Subject: Re: [xsl] xslt create a variable from external xml file
From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Aug 2023 12:07:05 -0000
Can you use doc('inc/env.xml') instead of document('inc/env.xml')?

The XSLT spec says in https://www.w3.org/TR/xslt-30/#func-document that the processor may ignore errors silently. It will give an error though when you use doc() and when the URI cannot be resolved.

On 24.08.2023 13:39, LEGAULT, PHILLIP plegault@xxxxxxxxxx wrote:
Ibve tried everything I could find and its does not appear to be B reading the xml file

*From:* Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
*Sent:* Tuesday, August 22, 2023 11:22 AM
*To:* xsl-list@xxxxxxxxxxxxxxxxxxxxxx
*Subject:* [EXTERNAL] Re: [xsl] xslt create a variable from external xml file

On 22.08.2023 17:10, LEGAULT, PHILLIP plegault@xxxxxxxxxx <mailto:plegault@xxxxxxxxxx> wrote:

This one gives me an error,

Error at xsl:param on line 266 column 107 of process.xsl:

B XPST0003 XPath syntax error at char 39 on line 266 near {...environment => normalize-sp...}:

B B B Unexpected token ">" in path expression

Error at xsl:param on line 266 column 107 of process.xsl:

B XPST0081 SequenceType syntax error at char 0 in {xs:string}:

B B B Undeclared namespace prefix {xs}

Failed to compile stylesheet. 2 errors detected.

Syd used XPath 3.1 syntax with XSLT 3, if you use a version of Saxon that only supports XSLT 2.0 with XPath 2.0 then change

B <xsl:param name="env" select="document('./inv/env.xml')/environment => normalize-space()" as="xs:string"/>

to

B <xsl:param name="env" select="normalize-space(document('inc/env.xml')/environment)"/>

XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>

EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3514465> (by email)

XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/225679> (by email <>)

-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

GeschC$ftsfC<hrer / Managing Directors:
Gerrit Imsieke, Svea Jelonek, Thomas Schmidt
----------------------------------------------
Besuchen Sie uns auf der Frankfurter Buchmesse
in Halle 4.0, G94.

Current Thread