Altova Mailing List Archives


RE: [xsl] Extract input filename

From: "J. S. Rawat" <jrawat@-------------->
To:
Date: 5/17/2007 8:45:00 AM
Thanks for the prompt reply. Would you please let me know about the 
namesspace value of prefix {xs} as an error is throughing while converting.



Error
undeclared namespace prefix {xs}

At 08:46 AM 5/17/2007 +0100, you wrote:



1. Change this:



<xsl:variable name="filename" select="document('input_meta.xml')" />



to this:



<xsl:param name="meta" as="xs:string" required="yes"/>
<xsl:variable name="filename" select="document($meta)" />

(you might also like to change the name of the variable filename, as it's a
misleading name)

2. Change your command line to



java -jar saxon8.jar input.xml x.xsl meta=input_meta.xml >c.xml



Michael Kay
http://www.saxonica.com/


> I have no idea about to extract input filename by passing
> argument in command line. In the below examples, I don't want
> to hardcode "input_meta.xml".
>
> Input files
> 1. input.xml
> 2. input_meta.xml
>
> command line
> java -jar saxon8.jar input.xml x.xsl >c.xml
>
> Stylesheet
> <xsl:variable name="filename" select="document('input_meta.xml')" />
>  <xsl:template match="/">
>       <doi>
>        <xsl:copy-of select="$filename/doi/text()" />
>       </doi>
> </xsl:template>
>
> Thanks in advance.
> JSR

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.