Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


MSXSL 4.0 command line parameter question

From: "David Laub" <dlaub@------.--->
To: NULL
Date: 3/2/2005 12:55:00 PM
I have a question regarding the parsing of command line specificed
parameters for an XSLT stylesheet - what appears to happen is my parameter
is being interpreted as a literal string instead of as an XPath expression.

My XML data is: person.xml
<?xml version="1.0" encoding="UTF-8"?>

<NewDataSet>

<Person>

<pID>1234</pID>

<LastName>Laub</LastName>

<FirstName>David</FirstName>

<Addr1>123 Jerome</Addr1>

<Addr2>Appt 10</Addr2>

<City>Skokie</City>

<State>IL</State>

<ZipCode>60076</ZipCode>

</Person>

</NewDataSet>

My XSLT stylesheet is: entity.xsl

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="yes"/>

<xsl:param name="Entity" select="./NewDataSet/Person" />

<xsl:template match="NewDataSet">

<xsl:copy-of select="$Entity"/>

</xsl:template>

</xsl:stylesheet>

My MSXSL command line is ANY of the following

msxsl person.xml entity.xsl -o Entity.xml Entity=./NewDataSet/Person

msxsl person.xml entity.xsl -o Entity.xml Entity="./NewDataSet/Person"
(note double quotes)

msxsl person.xml entity.xsl -o Entity.xml Entity='./NewDataSet/Person'
(note single quotes)

The ouput of this transform is:

<?xml version="1.0" encoding="UTF-8"?>./NewDataSet/Person  (in other words
my parameter is being interpreted as a literal string instead of an XPath
expression)

I CAN get the correct output (the Person sub-tree) in XMLSPY when I specify
the parameter Entity as ./NewDataSet/Person (NO quotes)

<?xml version="1.0" encoding="UTF-8"?>

<Person>

<pID>1234</pID>

<LastName>Laub</LastName>

<FirstName>David</FirstName>

<Addr1>123 Jerome</Addr1>

<Addr2>Appt 10</Addr2>

<City>AltamoSkokie</City>

<State>IL</State>

<ZipCode>^0076</ZipCode>

</Person>

So CAN I specify my parameter as an XPath expression (versus a string
literal) with the command line MSXSL utility?

Thanks












transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent