on 12-07-2015 1:11 PM
Hi,
For an interface I need to build, the source is going to be an string containing XML. I need to parse this into the message type format so it can be used for message mapping.
The XSL I am using for this is
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.sdn.com/xslt">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:for-each select="//*:string">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The source XML (for now) is
<ns0:MTBatchCharacteristics xmlns:ns0="http://johnsonmatthey.com">
<fielda>111</fielda>
<fieldb>
<fieldb_1>222</fieldb_1>
<fieldb_2>333</fieldb_2>
</fieldb>
</ns0:MTBatchCharacteristics>
I get an error as below
Transformer Configuration Exception occurred when loading XSLT XSL StringToXML.xsl; details: sapximapping:XSL StringToXML.xsl: line 9: Required attribute 'select' is missing. See error logs for details
I would be most grateful if someone could provide assistance in getting this resolved.
Thanks
Martin
Hello Martin,
you can't use XSL version 2 in PI as far as I know.
I modified your XSLT to this
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.sdn.com/xslt">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:for-each select="*">
<string>
<xsl:value-of select="normalize-space(.)" disable-output-escaping="yes"/>
</string>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
and I get this output:
<string xmlns:a="http://www.sdn.com/xslt">111 222 333</string>
I dont know which output you want.
But maybe you can work with my XSL.
Best regards,
Peter
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.