on 03-10-2008 4:24 PM
Could someone let me know what they think could be wrong with this xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/MT_SEND">
<MT_RECV xmlns="http://www.in005.com/xi">
<Completion>
<JobID><xsl:value-of select="Completion/JobID"/></JobID>
<Date><xsl:value-of select="Completion/DateOfVisit"/></Date>
<Item>
<ItemActioned><xsl:value-of select="Completion/ItemActioned"/></ItemActioned>
<ItemAction><xsl:value-of select="Completion/ItemAction"/></ItemAction>
<Quantity><xsl:value-of select="Completion/Quantity"/></Quantity>
</Item>
</Completion>
</MT_RECV>
</xsl:template>
</xsl:stylesheet>
I keep getting the error:
javax.xml.transform.TransformerException: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'xsl' is not mapped to a namespace(:main:, row:5, col:36)
Based on Raj's suggestion:
Try moving "xmlns:ns1="http://www.in005.com/xi" to the header part.
Liang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="http://www.in005.com/xi">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/MT_RECV">
<ns1:MT_RECV>
<Completion>
<JobID><xsl:value-of select="Completion/JobID"/></JobID>
<Date><xsl:value-of select="Completion/DateOfVisit"/></Date>
<Item>
<ItemActioned><xsl:value-of select="Completion/ItemActioned"/></ItemActioned>
<ItemAction><xsl:value-of select="Completion/ItemAction"/></ItemAction>
<Quantity><xsl:value-of select="Completion/Quantity"/></Quantity>
</Item>
</Completion>
</ns1:MT_RECV>
</xsl:template>
</xsl:stylesheet>
Mendez,
I'm not that good with XSLT, but can u try the below
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/MT_SEND">
<ns1: MT_RECV xmlns :ns1 ="http://www.in005.com/xi">
<Completion>
<JobID><xsl:value-of select="Completion/JobID"/></JobID>
<Date><xsl:value-of select="Completion/DateOfVisit"/></Date>
<Item>
<ItemActioned><xsl:value-of select="Completion/ItemActioned"/></ItemActioned>
<ItemAction><xsl:value-of select="Completion/ItemAction"/></ItemAction>
<Quantity><xsl:value-of select="Completion/Quantity"/></Quantity>
</Item>
</Completion>
</ ns1: MT_RECV>
</xsl:template>
</xsl:stylesheet>
Just give a try!
raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.