Re: Obtaining xml node value and using it as variable
On 10/4/05, geoff hopkins <geoffhopkins123@xxxxxxxxx> wrote: > reading back I can understand the criticism. > > I have one xml document (constants.xml) that contains > a list of constants. > > I want to get node values from this xml > (constants.xml) document when processing the source > xml document with a xsl script to get these parameters > to be used to parse the source xml doc. > > i.e. not pass as a command line parameter but for the > xslt script to be able to obtain paramters from a > external xml document. Ummm, somewhat better. Still not really completely clear. Some snippets of the actual constrants file might help some. So now there is either two cases: 1) constants.xml is an xsl stylesheet as well, or 2) it contains some xml that need to be in parameters. case 1) Have you looked at xsl:import? Is that causing you problems? case 2) Have you checked out document()? That will allow you do to something like: <xsl:variable name="constants" select="document(constants.xml)" /> <xsl:parameter name="foo" select="$contants/constant" /> Another option of course is to do something similar to process the stylesheets and produce a new stylesheet with information from constants inserted into the newly generated stylesheet, but a lot of times this is overkill. Jon Gorman
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format