Register  Login       Search  
Forum  
 
  
 
Forum  Forum     
 
SearchForum Home
  XML Lab Products  nxslt  Can't specify X...
 Can't specify XSL parameter.... (and no docs on @file option)
 
mscheuner
3 posts
Joined
10/8/2007

Can't specify XSL parameter.... (and no docs on @file option)
Posted: 08 Oct 07 2:03 AM (Switzerland)
Folks,
I'm trying to convert my XSD files to XHTML using the xs3p stylesheet. It works ok, but when I try to specify one of defined XSL parameters on the NXSLT2 command line, it is not recognized...

The parameter is called "printLegend" and accepts "true" or "false".

My nxslt2 command line is this:

    nxslt2 OCICleanOrder.xsd c:\bin\xs3p\xs3p.xsl -o ociinterface.html printLegend=false

and the error NXSLT2 spews out is this:
.NET 2.0 XSLT command line utility, version 2.3.0                                                    
An error occurred while parsing command line.                                                        
XmlLab.nxslt.NXsltCommandLineParsingException: Unrecognized option : 'printLegend'.                  
   at XmlLab.nxslt.NXsltArgumentsParser.ParseArguments(String[] args, NXsltOptions options)          
   at XmlLab.nxslt.NXsltMain.Main(String[] args)                                                     
So I figured I might try the "@file" syntax of NXSLT2 to specify additional parameters - that doesn't work either, and I have no docs about it, really....

    nxslt2 OCICleanOrder.xsd c:\bin\xs3p\xs3p.xsl -o ociinterface.html @oci-nx.opt

with a file "oci-nx.opt" that contains nothing but a line "printLegend=false" produces this error:
An error occured: System.ArgumentOutOfRangeException: Non-negative number required.                  
Parameter name: capacity                                                                             
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResourc
e resource)                                                                                          
   at System.Collections.Generic.Queue`1..ctor(Int32 capacity)                                       
   at XmlLab.nxslt.NXsltArgumentsParser.ParseArguments(String[] args, NXsltOptions options)          
   at XmlLab.nxslt.NXsltArgumentsParser.ParseArguments(String[] args, NXsltOptions options)          
   at XmlLab.nxslt.NXsltMain.Main(String[] args) 


Any ideas?? Is there a way to actually render the XSD to XHTML using NXSLT2 and xs3p *AND* to suppress printing the legend ?? If so: HOW??

Thanks!
Marc
olegt
85 posts
www.xmllab.net
Joined
2/25/2005

Re: Can't specify XSL parameter.... (and no docs on @file option)
Posted: 08 Oct 07 3:54 AM (Israel)

I cannot reproduce the first problem, it works for me. Make sure there is no space after  printLegend parameter name, I mean you put exactly param=value or param="long value" with no spaces before or affer equal sign.

Second issue is a nasty bug. I'll fix it asap. Thanks for reporting it.


Oleg Tkachenko, Microsoft MVP for XML, MCPD
http://www.XmlLab.Net | http://blog.tkachenko.com
mscheuner
3 posts
Joined
10/8/2007

Re: Can't specify XSL parameter.... (and no docs on @file option)
Posted: 08 Oct 07 4:02 AM (N/A)
 olegt wrote

I cannot reproduce the first problem, it works for me. Make sure there is no space after  printLegend parameter name


No spaces ANYWHERE - I'll try it on another machine, just to make sure it's not some screwed up setup that causes this. I'll keep you updated.

 olegt wrote

Second issue is a nasty bug. I'll fix it asap. Thanks for reporting it.


OK - and the format for the "options" file is: one option per line, correct? Can I define things like the output file (-o outputfile) in that options file, too?

Marc
olegt
85 posts
www.xmllab.net
Joined
2/25/2005

Re: Can't specify XSL parameter.... (and no docs on @file option)
Posted: 08 Oct 07 4:31 AM (Israel)

Hmmm, that's weird.  Unrecognized option : 'printLegend' means nxslt received command line argument 'printLegend', while it should be 'printLegend=false'.

It might be Windows command line somehow screwing up with command line arguments. Try to put quotes around your parameter:

nxslt2 ... "printLegend=false"

Options file format follows the same rules as normal command line and you can put one or more options per line.

from documentation:

Options file (@file)

The @ option lets you specify a file that contains more options. The options in the specified file will be processed just as if they had been specified on the command line.

In an options file, multiple options can appear on one line. A single option specification must appear on one line (cannot span multiple lines). Options files can have comments that begin with the # symbol.

Because of thtebug options file only works when either it's used along with normal param, e.g. "param=value @foo.opt" or first line in first options file contains at least 2 options.

You can debug your problem (and fix second bug youself if you want), just download sources. The bug is in NXsltArgumentsParser.cs, line 350:

                paramQueue = new Queue<string>(args.Length - 2);

it should be just

                paramQueue = new Queue<string>();


Oleg Tkachenko, Microsoft MVP for XML, MCPD
http://www.XmlLab.Net | http://blog.tkachenko.com
mscheuner
3 posts
Joined
10/8/2007

Re: Can't specify XSL parameter.... (and no docs on @file option)
Posted: 08 Oct 07 11:29 PM (Switzerland)
Hi Oleg,

OK, I found the problem with the "printLegend=false" - it was in my batch file calling up nxslt2 - when using nxslt2 directly, it works as expected. My bad - sorry!

Looking forward to a fixed version 2.3.1 that'll properly deal with the foo.opt file syntax! :-)

Thanks
Marc
  XML Lab Products  nxslt  Can't specify X...
Forum Home  Search