Hi Mike,
On Tue, Feb 10, 2026 at 4:55b/PM Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
I'm further happy to write, Saxon-HE 12.9 XSL transform results, for
following stylesheet examples.
Saxon-HE has been run with following command line options,
net.sf.saxon.Transform -s:%1 -xsl:%2 -lib:test2.xsl -im:mode1
test1.xml
<?xml version="1.0" encoding="UTF-8"?>
<info1/>
test1.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:package name="http://package1"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn0="http://fn0"
exclude-result-prefixes="fn0">
<xsl:output method="xml" indent="yes"/>
<xsl:mode name="mode1" visibility="public"/>
<xsl:use-package name="http://package2" package-version="1.0.0">
<xsl:accept component="template" names="Template1"
visibility="public"/>
<xsl:accept component="function" names="fn0:abc#0
fn0:abc2#1" visibility="public"/>
</xsl:use-package>
<xsl:template match="/" mode="mode1">
<result transformNode="{name(*[1])}">
<one>
<xsl:value-of select="fn0:abc()"/>
</one>
<two>
<xsl:call-template name="Template1"/>
<var2><xsl:value-of select="$var2"/></var2>
</two>
<three>
<xsl:value-of select="fn0:abc2('hello')"/>
</three>
</result>
</xsl:template>
</xsl:package>
test2.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:package name="http://package2"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn0="http://fn0"
exclude-result-prefixes="xs fn0">
<xsl:expose component="template" names="Template1"
visibility="public"/>
<xsl:expose component="function" names="fn0:abc#0 fn0:abc2#1"
visibility="public"/>
<xsl:expose component="variable" names="var2" visibility="public"/>
<xsl:variable name="var1" select="'HELLO'" visibility="private"/>
<xsl:variable name="var2" select="'HELLO 123'" visibility="public"/>
<xsl:template name="Template1" visibility="public">
<templateResult var1="{$var1}"/>
</xsl:template>
<xsl:function name="fn0:abc" visibility="public" as="xs:string">
<xsl:sequence select="'Hello, ' || fn0:abc1()"/>
</xsl:function>
<xsl:function name="fn0:abc1" visibility="private" as="xs:string">
<xsl:sequence select="'..., ref local only function. This
cannot be accessed, from outside this package.'"/>
</xsl:function>
<xsl:function name="fn0:abc2" visibility="public" as="xs:string">
<xsl:param name="arg1" as="xs:string"/>
<xsl:sequence select="upper-case($arg1)"/>
</xsl:function>
</xsl:package>
When, an XSL transform (defined within test1.xsl) is applied to an XML
input document test1.xml, the following XSL transform results are produced,
<?xml version="1.0" encoding="UTF-8"?>
<result transformNode="info1">
<one>Hello, ..., ref local only function. This cannot be accessed, from
outside this package.</one>
<two>
<templateResult var1="HELLO"/>
<var2>HELLO 123</var2>
</two>
<three>HELLO</three>
</result>
--
Regards,
Mukul Gandhi
|