[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: passing xml strings to xslt using saxon in java

Subject: RE: passing xml strings to xslt using saxon in java
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 16 Sep 2007 17:23:34 +0100
RE:  passing xml strings to xslt using saxon in java
You could write a URIResolver that intercepts the request for
myXmlString.xml and returns a StreamSource that wraps a StringReader that
wraps the relevant string.

Or you could parse the document in your calling application (use
Configuration.buildDocument()) and pass the resulting document node to the
transformation as a parameter.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: John Smith [mailto:debrief@xxxxxxxxx] 
> Sent: 16 September 2007 16:10
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  passing xml strings to xslt using saxon in java
> 
> Hello,
> 
> 
> I have a xslt which needs to use 2 xml files, the first one 
> is not actually a file but an xml formatted string and the 
> second one is an xml file.
> 
> So I want:
> 
> xmlString + rules.xml + XSL.xslt = Result.xml
> 
> I have tested the scenario with the xsl file referencing the 
> xml files as:
> 
> <xsl:variable name="myrules" select="document('myrules.xml')"/>
> <xsl:variable name="xmlstring" select="document('myXmlString.xml')"/>
> 
> and then created a resulting xml file. However instead of 
> referencing a file I want to dynamically pass an xmlString to 
> it. I am using
> Java+Saxon, is there a way around this? or any alternative methods to
> address this problem?
> 
> 
> Many thanks,
> J

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.