[xslt] xsltproc: --stringparam under Cygwin?



xsltproc's option stringparam doesn't seem to work in the current
release (as of 2002-11-10) of precompiled libs and binaries for
Cygwin. The version of xsltproc included claims to be:

$ xsltproc --version
Using libxml 20417, libxslt 10010 and libexslt 703
xsltproc was compiled against libxml 20413, libxslt 10010 and libexslt
703
libxslt 10010 was compiled against libxml 20413
libexslt 703 was compiled against libxml 20413

(I tried it under Windows with another version, "xsltproc compiled
against libxml 20426, libxslt 10022 and libexslt 713": the problem
does not appear there.)

Here is the error I get:

$ xsltproc --stringparam myparam mystring stylesheet.xsl input.xml
warning: failed to load external entity "myparam"
cannot parse myparam

In contrast, it works fine if I use the param option instead and quote
the string appropriately:

$ xsltproc --param myparam "'myvalue'" stylesheet.xsl input.xml

However, I think I depend on the stringparam option because I want to
pass a variable as a parameter, running xsltproc from a bash shell
script, like this:

xsltproc --stringparam myparam "$mystring" stylesheet.xsl in.xml >
out.xml

I tried to enclose the content of the variable with "' and '" and use
--param instead, which worked in some cases. But when I want to pass a
path to a file to my stylesheet, I get in trouble:

- either I don't quote the path, then it is considered a node
  identifier evaluating to NULL

- or I quote it, so it is a string; but later, when xsltproc applies
  the stylesheet (which is trying to read from that file), it
  concatenates the current directory (as base URI, I suppose) and the
  apostrophe-quoted contents of $mystring, complaining:

warning: failed to load external entity
"/current/dir/'/path/given/in/mystring'"

Do I need to use another technique (like XInclude) to pass path names
or is there a chance for me to get the stringparam option working? If
so, is there a newer version of xsltproc for Cygwin around or would I
have to compile it myself? From which versions of the libxml2 and
libxslt libraries?

  Yves



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]