Hi ,
I am new to XSLT. I have written a XLST service to get the CDATA from XML. My XML looks like
<?xml version="1.0" encoding="UTF-8"?>
HellosJPTC
Hello
Hello
The XSLT i have written in the XSLT service is
<?xml version="1.0"?>
<xsl:stylesheet version=“1.0”
xmlns:xsl=“XSLT Namespace”>
<! – XSLT code goes here →
<xsl:template match=“/”>
<xsl:value-of select=“//text()[contains(.,‘CDATA’)]” />
</xsl:template>
</xsl:stylesheet>
But when I run this service giving the XML above as input, I get the following error
com.wm.driver.comm.b2b.WmCommException: [[[XSL.0002.9001] JAXP: Error instantiating transformer - com.wm.pkg.xslt.util.LocalizedTransformerException: [XSL.0002.9002] JAXP: Error during transformation - org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup] [XSL.0002.9001] JAXP: Error instantiating transformer -
This is webMethods 7.1.2 and on the WMXSLT homepage I see
SAXParserFactory org.apache.xerces.jaxp.SAXParserFactoryImpl
DocumentBuilderFactory org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
TransformerFactory org.apache.xalan.processor.TransformerFactoryImpl
this is just for information.
Could you help me correct the XML/XSLT so that i can get the CDATA as desired.
Thanks in advance
Inky
I have kind of same error when I try parse the EDI xml use XSLT. The XSLT itself works fine for the XML because I test it use the tool online. The more weird thing is error message said I miss class which is used for convert EDI to XML.
We use webMethods 7.3
Here is the error message:
Could not run ‘convertEDI850XMLUsingXSLT’.
com.wm.driver.comm.b2b.WmCommException: [[[XSL.0002.9001] JAXP: Error instantiating transformer - com.wm.pkg.xslt.util.LocalizedTransformerException: [XSL.0002.9002] JAXP: Error during transformation - org.xml.sax.SAXException: javax.xml.parsers.FactoryConfigurationError: Provider com.berryworks.edireader.EDIParserFactory not found] [XSL.0002.9001] JAXP: Error instantiating transformer - com.wm.pkg.xslt.util.LocalizedTransformerException: [XSL.0002.9002] JAXP: Error during transformation - org.xml.sax.SAXException: javax.xml.parsers.FactoryConfigurationError: Provider com.berryworks.edireader.EDIParserFactory not found] [[XSL.0002.9001] JAXP: Error instantiating transformer - com.wm.pkg.xslt.util.LocalizedTransformerException: [XSL.0002.9002] JAXP: Error during transformation - org.xml.sax.SAXException: javax.xml.parsers.FactoryConfigurationError: Provider com.berryworks.edireader.EDIParserFactory not found] [XSL.0002.9001] JAXP: Error instantiating transformer - com.wm.pkg.xslt.util.LocalizedTransformerException: [XSL.0002.9002] JAXP: Error during transformation - org.xml.sax.SAXException: javax.xml.parsers.FactoryConfigurationError: Provider com.berryworks.edireader.EDIParserFactory not found
Please help!
@Inky,
the issue is the comment line in the XSLT.
Remove the following in your XSLT code, that will resolve the issue.
<! – XSLT code goes here →
correct XSLT:
<?xml version="1.0"?>
<xsl:stylesheet
version=“1.0”
xmlns:xsl=“XSLT Namespace”>
<xsl:template match=“/”>
<xsl:value-of select=“//text()[contains(.,‘CDATA’)]” />
</xsl:template>
</xsl:stylesheet>