xslt and the TransformerFactory class

Avatar

Avatar

Brendan1000

Avatar

Brendan1000

Brendan1000

05-05-2009

Hello.  What I'm trying to do is - through the web server - accept an xml file, run it through the transform.TransformerFactory class against an xslt file.  I've tried many different ways to write the xslt, but it never works.   

Here is an example....

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/">

<xsl:value-of select="/page1/claimantLastName"/>
<xsl:value-of select="/page1/claimantFirstName"/>
<xsl:value-of select="/page1/claimantMiddleInitial"/>


</xsl:template>

</xsl:stylesheet>

Any help with this at all would be helpful.  Thanks.

View Entire Topic

Avatar

Avatar

HowardTreisman

Avatar

HowardTreisman

HowardTreisman

05-05-2009

Hi Brendan

A couple of tips...

1. Use Variable Logger to output your XML file to the file system, to be sure that the XML file you're operating on is what you think it is.

2. Use one of the many XSLT-aware GUI applications (XMLSpy, LiquidXML, XMLPad, etc) to verify your XSLT and XML.

3. Once that's all done, plug the XSLT and XML files into the component, and make sure they work there.

Hope that helps...

Howard

http://www.avoka.com