Subject:Can't make template match element (namespace problem?) Author:Nadège Griesser Date:23 Nov 2006 06:50 AM
Hello,
I would like to turn this xml file :
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header>
<header xmlns="xmlapi_1.0">
<requestID>XmlApiClient:26</requestID>
</header>
</SOAP:Header>
<SOAP:Body>
<findResponse xmlns="xmlapi_1.0">
<result>
<netw.NetworkElement>
<ipAddress>138.120.202.223</ipAddress>
<name>10.1.1.223</name>
</netw.NetworkElement>
</result>
</findResponse>
</SOAP:Body>
</SOAP:Envelope>
into this one :
<IP_MPLS>
<NE ID="10.1.1.223">
<IP>138.120.202.223</IP>
</NE>
</IP_MPLS>
That is to say : remove SOAP namespace, remove findResponse tag, replace result tag with IP_MPLS, replace netw.NetworkElement tag with NE add an "ID" attribute with the value of the name tag, ...
The problem is that I am unable to match the findResponse tag.
I guess this is linked with namespaces...
Subject:Can't make template match element (namespace problem?) Author:(Deleted User) Date:23 Nov 2006 07:27 AM
Hi Nadege,
just add a xmlns:q="xmlapi_1.0" to the xsl:stylesheet node and replace findResponse with q:findResponse (as well as 'result', 'name', etc..)