Hi,

> xalan.exe -p "C:\Directory\SubDirectory" myxml.xml myxsl.xslt
Did you forget to copy the name of the parameter to the mail?

I think this should be:
xalan.exe -p myParameter "C:\Directory\SubDirectory" myxml.xml myxsl.xslt

Ok. And now for the real question ;^) The value for your stylesheet parameter calling xalan.exe is an *expression* and *not a string*.

"""
Usage: Xalan [options] source stylesheet
...
  -p name expression    Sets a stylesheet parameter.
...
"""

This expression will be evaluated by Xalan at runtime. To pass a string you have to surround it by quotes or apostrophs. The double-quotes are used to surround one argument for passing values with spaces. Therefore you have to write

xalan.exe -p myParameter "\"C:\Directory\SubDirectory\"" myxml.xml myxsl.xslt

or

xalan.exe -p myParameter "'C:\Directory\SubDirectory'" myxml.xml myxsl.xslt

Maybe other processors accept only string values for stylesheet parameters. They don't need the second pair of quotes, but you can't pass XPaths evaluated at runtime or simple expressions like passing "1+2".

HolgeR

babszem schrieb:

Hi All,

I'm just trying to switch to Xalan from MSXSL (brr...) and I seem to have run
into a bug - which actually might be a feature, so I'm asking for confirmation.

Situation:

I'm trying to input a string parameter to my stylesheet, which is actually a
Windows absolute path: "C:\Directory\SubDirectory". Now, if I input it thus:

xalan.exe -p "C:\Directory\SubDirectory" myxml.xml myxsl.xslt

Xalan complains about: "Prefix must resolve to a namespace: C." I've done some
debugging and it looks like the path string is fed into
StylesheetExecutionContextDefault::pushVariable (...), which in turn tries to
process it as some XSL expression. I'm wondering whether this is intentional? I
cannot imagine a situation where someone might need to process his input
stylesheet parameter strings (although I admit this might be my fault... :-)).

I can work around this problem by surrounding my pramater strings with
additional quotes like thus:

xalan.exe -p "\"C:\Directory\SubDirectory\"" myxml.xml myxsl.xslt

but I'd be more happy with the original (as this seems to be a bug to me).

Could someone shed some light on the situation?

Thanks in advance:

    Andras Babos.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- holger floerke d o c t r o n i c email [EMAIL PROTECTED] information publishing + retrieval phone +49 2222 9292 90 http://www.doctronic.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to