Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2008, 04:24 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Windows command : How to pass param ??

Could any tell the windows command for converting xml to .txt file by passing the parameter to xsl file.

[u]XSLT processor: </u>
Xalan-C_1_8_0-windows_2000-msvc_60
xerces-c_2_5_0-windows_nt-msvc_60

$xalan file.xml file.xsl output.txt ( working )
$xalan file.xml file.xsl -p 'EN' output.txt ( Not working ) getting the output as follows

Xalan version 1.8.0.
    Xerces version 2.5.0.
    Usage: Xalan [options] source stylesheet
    Options:
      -a Use xml-stylesheet PI, not the 'stylesheet' argument
      -e encoding Force the specified encoding for the output.
      -i integer Indent the specified amount.
      -m Omit the META tag in HTML output.
      -o filename Write output to the specified file.
      -p name expression Sets a stylesheet parameter.
      -t Display timing information.
      -u Disable escaping of URLs in HTML output.
      -? Display this message.
      -v Validates source documents.
      - A dash as the 'source' argument reads from stdin.
                ('-' cannot be used for both arguments.)
 
Old July 28th, 2008, 04:31 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

When it says

Usage: Xalan [options] source stylesheet

I would assume that it means the options must come first.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 28th, 2008, 04:36 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As you said, even i tried with

1) xalan ENV24.2302.xml -p 'EN' ConvertToASCII.xsl ( Same result )
2) xalan -p 'EN' ENV24.2302.xml ConvertToASCII.xsl ( Same result )

No Luck...
 
Old July 28th, 2008, 05:16 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its working fine.

xalan -p lang 'EN' -p drn 'drn' -p lgn 'LGN.xml' file.xml file.xsl
 
Old July 28th, 2008, 05:17 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The documentation says

-p name expression

for example

-p max 2+2

sets the value of parameter $max to the value 4.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass xsl:param to xsl:if bonekrusher XSLT 5 September 6th, 2007 04:37 PM
How to pass parameter value to CR SQL Command vijaykumartaduri BOOK: Professional Crystal Reports for VS.NET 3 July 31st, 2007 12:13 AM
Pass value in PARAM tag to ActiveX control - Help! gregquinn Beginning VB 6 13 June 17th, 2007 08:03 AM
pass multi value param from ASP toCrystal Runtime ushasku BOOK: Beginning ASP 3.0 1 January 5th, 2007 03:41 PM
pass multi value param from ASP toCrystal Runtime ushasku Classic ASP Basics 0 August 5th, 2005 06:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.