Subject: Re: [xsl] Using the document function with external documents stored in a database From: Robert Koberg <rob@xxxxxxxxxx> Date: Mon, 22 Mar 2004 05:49:19 -0800 |
Hello all,
I need to perform an XSL-T transformation from Java with Xalan. The challenge is that there are two XML documents involved and that both XML documents are stored in a mysql database. One of the XML documents is the main documents (in the original language). The other document contains a translated version of the source document.
I would like to output a combination of both documents in HTML by using an XSL-T transformation. However I don't want to store the secondary document on the file system of the server before execution of the transformation.
I have two questions: 1. Is it possible to let the document function use a DOM object stored in memory, or an XML document stored in a database?
<xsl:apply-templates select="document($dbIdentifier)"/>
public Source resolve(String href, String base) { String xmlFromDb = someObj.getXml(href); if (xmlFromDb == null) { xmlFromDb = "<not-found/>"; } Source source = new StreamSource(new StringReader(xmlFromDb)); /* or Source source = new StreamSource(someObj.getXmlAsInputStream(href)); or however... */ return source; }
best, -Rob
2. If not... Is it possible to pass a DOM object as a parameter to an XSL-T transformation?
Thanks in advance for your reaction!
Bjvrn
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Using the document function w, Björn Boxstart | Thread | RE: [xsl] Using the document functi, Andrew Welch |
RE: [xsl] centralised alphabetical , james walker | Date | [xsl] comparing 2 childs of 2 child, André Moniz |
Month |