[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Obtaining xml node value and using it as variable


Subject: Re: [xsl] Obtaining xml node value and using it as variable
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Tue, 4 Oct 2005 10:25:29 -0500

On 10/4/05, geoff hopkins <geoffhopkins123@xxxxxxxxx> wrote:

> hope I have explained this well enough...?!?

To be blunt, not really.

This could be interpreted in two ways:

1) "I need to get a value from a node and store it in a variable/parameter"

with the easy answer of "well, use xsl:varaible or xsl:parameter".

2) (the more likely case)  "I want to be able to execute a
command-line parameter into the stylesheet

Which has a couple of flavors of it's own.

i)  You actually want to pass a node set in (not a node's value)

ie (picking a roughly Xalan sytanx just for a quick example):

  xsltprocess -IN foo.xml -XSL trans.xsl -OUT bar.xml -PARAM
"<foo><node>1</node></foo>"

-- there should be something in the archives about this


ii) You want to specifiy a node within the document via a XPATH string

xsltprocess -IN foo.xml -XSL trans.xsl -OUT bar.xml -PARAM "//ul/li/foo[1]"

-- might be something in the archives about this

I'm sure there's more ways to interpret your one-sentence description
of the problem that I haven't thought of.  Perhaps an example of what
you want to do would help.


Jon Gorman


Current Thread
Keywords