Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you override global variable values when calling oraxsl or xsl.exe?

595841Jan 2 2009 — edited Jan 5 2009
I am a newbie to oracle xslt.
I have down loaded the latest version of xdk (10.1.0.2...). (Jan 2, 2009).

In the past I haveI used micorsoft's "msxsl.exe" to perform my transformations.
I am looking for a more up-to-date transformation tool.
I found Oracle's version, and thought I would try it out.

I have run the "bin/xsl.exe -hh" command.

I read its help data. It states that variables are
passed by coding a pramater "-V <var> <value>".

I have also examined the oraxls.bat file.
I found the documentation on "oracle.xml.parser.v2.oraxsl" class.
It states that parameters are passed after the "-p" switch.
It says the value of the -p parameter is "a list of paramemters".

I don't find this sufficient information to be useful.
I can spend days guessing, and I might get lucky.
I thought it my be better to ask for help.

I need to pass in (override) values for 3 global variables.
I saw the method
"setParam(namespace, variable, value)",
near the documentation for the "oraxsl" class.

How do you format the options string to communicate more than one param statement?
(in either xsl.exe and/or oraxsl class).

Suppose I have an xslt stylesheet as follows:
==================================================
<?xml version="1.0" ?>
<xsl:stylesheet version="1.1" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >

<xsl:param name='a' select='"default_a"' />
<xsl:param name='b' select='"default_b"' />
<xsl:param name='c' select="'default_c"' />

<xsl:template match='/'>
this is value for a: <xsl:value-of select='$a' />
this is value for b: <xsl:value-of select='$b' />
this is value for c: <xsl:value-of select=$c' />

<xsl:apply-templates />
</xsl:template>

</xsl:stylesheet>
========================================================

Now as part of the calling of the XSL processor I want to change the value of these
three global parameters.

I want:
a="current_a",
b="current_b",
and c="current_c"

How do I express this using xsl.exe and its paramter string (-V ????).

and/or how do I express it to the oraxsl class ( -p (xsl, a,"current_a"), (....) )???

The syntax for specifying this information is not very clear in either situation.

Of course I am making the "assumption" that by "param" they are
refering to "global parameters" (as in my stylesheet), rather than some other global parameters of XLST.

----------------------------------------------------------------
As an aside inquiry:

I had hopped that the Oracle's xsl Verion 2 routine could handle xslt 2.0 commands
such as "xsl:for-each-group", since it handled multiple xsl:outputs.

From reading some of the documentation it seems it only handles xslt 1.0 syntax/commands.
Is this true? (or is the documentation not up-to-date?).

Any help on passing param values to xsl.exe and/or "oraxsl" class is appreciated.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2009
Added on Jan 2 2009
2 comments
3,189 views