I'm trying to do SOAP to XML transformation in XSLT 2.0, this is the source xml:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xi="http://www.xcdm.com">
<soapenv:Header/>
<soapenv:Body>
<xi:root>
<xmlHeader>
<timestamp>1232135468</timestamp>
<source>xds unit</source>
</xmlHeader>
<xmlBody>
<method>create</method>
<customer>
<custA>VOC-Prov</custA>
<custB>vocprov</custB>
</customer>
<Item>
<subElmt1>12345</subElmt1>
<subElmt2>534321</subElmt2>
</Item>
</xmlBody>
</xi:root>
</soapenv:Body>
`
I have been looking for days for a way to transform the structure using XSLT 2.0 so that the output will structured by this one :
<customer version="1.0">
<custA>VOC-Prov</custA>
<custB>vocprov</custB>
<Item name="constName" method="value from the method element (create)">
<Attribute name="subElmt1">value of subElmt1 element</Attribute>
<Attribute name="subElmt2">534321</Attribute>
</Item>
</customer>
- How can i Concat the method value as attribute in the requested xml result ?
- What is the best way to implement xslt that convert element to attribute that match this xml hirarchiel ?
Any help on this would be greatly appreciated!