Jump to content

Transform generically without known namespace


javajoemorgan

Recommended Posts

I need to know how to write a generic transform that may include elements having different namespaces. For example, consider this SOAP Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cat="http://www.kingkongco.com/category">   <soapenv:Header/>   <soapenv:Body>      <cat:getCategory>         <cat:categoryId>-1</cat:categoryId>         <cat:maxDepth>2</cat:maxDepth>         <cat:type>A</cat:type>         <cat:type>L</cat:type>         <cat:type>REC</cat:type>      </cat:getCategory>   </soapenv:Body></soapenv:Envelope>

Now, consider this one:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:part="http://www.kingkongco.com/part">   <soapenv:Header/>   <soapenv:Body>      <part:findItemsByCategory>         <part:orderType>4</part:orderType>         <part:category>-1</part:category>         <part:type>A</part:type>         <part:type>S</part:type>         <part:type>T</part:type>      </part:findItemsByCategory>   </soapenv:Body></soapenv:Envelope>

Note the "type" elements in both. In one case, the "type" element is "cat:type", in the other, it is "part:type". There are others as well. What I need to do is to write a generic XSLT that processes this "type" element with the same rules for all documents, regardless of its namespace.How????

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...