on 03-07-2017 12:51 PM
Hi All,
I have created scenario to push cXML to Ariba.
Ariba expects a tag in the format xml:lang (mentioned below)but HCI generates only as lang which cause message failure while pushing message to ariba.
Expected: <Description xml:lang="en"/>
Generated: <Description lang="en"/>
WSDL reference used in HCI mapping:
<xsd:element name="Description" form="qualified">
<xsd:complexType><xsd:simpleContent>
<xsd:extension base="xsd:string"><xsd:attribute ref="xml:lang"/></xsd:extension>Please let me know how to achive it.
Hello Mani,
Below XSLT will do the requirement.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@lang">
<xsl:attribute name="xml:lang">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prasad,
Please find input and output xml. As this is required for HCI, I am fine to go with XSLT, groovy or javascript to achieve this.
For example:
Input:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<Description lang="en">TEST</Description>
<Forecast>
<Period endDate="2016-09-01T23:59:59+02:00" startDate="2016-09-01T00:00:00+02:00"/>
<ForecastQuantity quantity="34.0">
<name lang="en">TEST1</name>
<UnitOfMeasure>EA</UnitOfMeasure>
</ForecastQuantity>
</Forecast>
</root>
Output:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.029/cXML.dtd">
<root>
<Description xml:lang="en">TEST</Description>
<Forecast>
<Period endDate="2016-09-01T23:59:59+02:00" startDate="2016-09-01T00:00:00+02:00"/>
<ForecastQuantity quantity="34.0">
<name xml:lang="en">TEST1</name>
<UnitOfMeasure>EA</UnitOfMeasure>
</ForecastQuantity>
</Forecast>
</root>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mani,
It would be great if you can paste or attach the XML ( Expected and Generated ) so that it will be easier to give some solution on that.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Can you please let me know if you have any XSL code to achieve it?
Regards,
Mani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.