Project

Profile

Help

error when passing parameter on command line

Added by Anonymous about 17 years ago

Legacy ID: #4255667 Legacy Poster: David Fox (dvdfox)

I'm having trouble passing in a parameter on the command line. My syntax is as follows: java net.sf.saxon.Transform -o output.xml input.xml transform.xsl {param=10} and this is the error message I get back: java.lang.IllegalArgumentException: No closing '}' in Clark name at net.sf.saxon.om.NamePool.allocateClarkName(NamePool.java:694) at net.sf.saxon.Controller.setParameter(Controller.java:1712) at net.sf.saxon.Transform.setParams(Transform.java:899) at net.sf.saxon.Transform.processFile(Transform.java:798) at net.sf.saxon.Transform.doTransform(Transform.java:478) at net.sf.saxon.Transform.main(Transform.java:60) Fatal error during transformation: No closing '}' in Clark name I've tried to express the parameter without the curly brackets, and while this avoids the error above, the parameter does not get passed to my stylesheet. Does anyone know I'm doing wrong here? Thanks!


Replies (5)

Please register to reply

RE: error when passing parameter on command l - Added by Anonymous about 17 years ago

Legacy ID: #4255674 Legacy Poster: Michael Kay (mhkay)

I don't know where you got the idea of using curly braces like this. Your syntax is correct if you leave them out. If that doesn't work, show us what you're doing and show your evidence that the value isn't being seen in the stylesheet (perhaps your stylesheet syntax was equally inventive, who knows?)

RE: error when passing parameter on command l - Added by Anonymous about 17 years ago

Legacy ID: #4255688 Legacy Poster: David Fox (dvdfox)

I got the syntax from the help file: Saxon 8.7.1J from Saxonica Usage: java net.sf.saxon.Transform [options] source-doc style-doc {param=value} Which I see now was a misinterpretation. I was pretty much trying anything I could to make this work. When I leave out the braces, I get this error: Error at xsl:param on line 5 of file:transform.xsl: XTDE0700: No value supplied for required parameter Transformation failed: Run-time errors were reported And here's line 5 from my xsl: <xsl:param name="identifier" as="xs:string" required="yes"/> I'm aware that I'm passing in an integer and casting it as a string...

RE: error when passing parameter on command l - Added by Anonymous about 17 years ago

Legacy ID: #4255754 Legacy Poster: Michael Kay (mhkay)

The name of your parameter is "identifier", so the command line should say java net.sf.saxon.Transform [source-doc style-doc identifier=23

RE: error when passing parameter on command l - Added by Anonymous about 17 years ago

Legacy ID: #4256238 Legacy Poster: David Fox (dvdfox)

That's actually just my mistake entering the command in my first post. I did in fact type 'integer=16' to match the parameter name in my XSL.

RE: error when passing parameter on command l - Added by Anonymous about 17 years ago

Legacy ID: #4256660 Legacy Poster: Michael Kay (mhkay)

I'm sorry, but if you make mistakes like that when posting your question, then how can I guess what mistakes you made when you wrote your actual code? I need to know what you actually did and what the error was.

    (1-5/5)

    Please register to reply