Subject: RE: XML fragment as a param ?
Fraser>When I do this :-
Fraser>where param.name and param.value are both Strings and contain - "inboundXML" Fraser>and "<Numbers><Odds><One>1</One>... "
Fraser>I get this (almost correct but no cigar :-) :-
thanks for your helpful response.
As you point out, if the XML I wanted to set as the param was already in a DOM I could indeed pass the DOM itself or a node selected from it. Unfortunately it isn't and the amount of XML is large so I didn't really want to have to load up a DOM simply to pass it through to an XSLT processor (I do use this technique in other places but only if the the data is already conveniently packaged or the amount of data is small).
Yes, I had thought of setting the output escaping, but am pretty reluctant to take that route for the reasons you mention (it is quite likely that the XML I'm passing in contains content that needs to be escaped).
Fraser> transformer.setParameter(param.name, new StreamSource(new
Fraser> but unfortunately all that gave me was :-
Nick> Which is also correct (in your environment) as that is the string
Nick> representation of the StreamSource: clearly the processor you are using
Nick> doesn't support using a StreamSource as a parameter, and so took the
Nick> result of that object's toString() method.
Oh, ok, thanks for clearing that up.
The 'HowTo' on exslt:node-set suggest that it can create a node set from a text() node, but I'm not sure a 'string' parameter (especially one that has been 'escaped') qualifies. In any event I couldn't get it to co-operate.
I have written a URI Resolver so I can pass my data in through the document() function, but I wanted cake (and eat it) by being able to have 2 options to provide this XML to the stylesheet (just greedy I guess :-)
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