S
Stu
I am using libxml2 xsltproc and I am trying to pass a parameter and
have not been successful yet.
I tried a million and one variations of the following command but was
unable to get the value passed in from the command line to be
substituted correctly. Can somebody please point me in the right
directiuon.
Thanks in advance to all who answer this post
command
========
xsltproc.exe --param data_path2, "'e:/tmp/stu/123'" dbmap.xsl
dbmap.xml
My .xsl file looks like this:
===================
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslaram name="data_path2" select = "'UNDEFINED'"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="actual_volume[. = '{VAR}' and ../
logical_library/text(
= 'DATA']">
<xsl:copy>
<xsl:value-of select="$data_path2"/>
</xsl:copy>
</xsl:template>
Data file
======
<dbmap_entries>
<dbmap_entry>
<logical_library>&TMP</logical_library>
<actual_library>.</actual_library>
<actual_volume>CTRONTMPDIR</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>LOG</logical_library>
<actual_library>logs</actual_library>
<actual_volume>{VAR}</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>CONFIG</logical_library>
<actual_library>config</actual_library>
<actual_volume>${CTRONHOME}</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>DATA</logical_library>
<actual_library>data</actual_library>
<actual_volume>{VAR}</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>DB</logical_library>
<actual_library>db</actual_library>
<actual_volume>{VAR}</actual_volume>
</dbmap_entry>
</dbmap_entries>
have not been successful yet.
I tried a million and one variations of the following command but was
unable to get the value passed in from the command line to be
substituted correctly. Can somebody please point me in the right
directiuon.
Thanks in advance to all who answer this post
command
========
xsltproc.exe --param data_path2, "'e:/tmp/stu/123'" dbmap.xsl
dbmap.xml
My .xsl file looks like this:
===================
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslaram name="data_path2" select = "'UNDEFINED'"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="actual_volume[. = '{VAR}' and ../
logical_library/text(
= 'DATA']">
<xsl:copy>
<xsl:value-of select="$data_path2"/>
</xsl:copy>
</xsl:template>
Data file
======
<dbmap_entries>
<dbmap_entry>
<logical_library>&TMP</logical_library>
<actual_library>.</actual_library>
<actual_volume>CTRONTMPDIR</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>LOG</logical_library>
<actual_library>logs</actual_library>
<actual_volume>{VAR}</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>CONFIG</logical_library>
<actual_library>config</actual_library>
<actual_volume>${CTRONHOME}</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>DATA</logical_library>
<actual_library>data</actual_library>
<actual_volume>{VAR}</actual_volume>
</dbmap_entry>
<dbmap_entry>
<logical_library>DB</logical_library>
<actual_library>db</actual_library>
<actual_volume>{VAR}</actual_volume>
</dbmap_entry>
</dbmap_entries>