[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Building a bidirectional map of namespaces prefix to namespace from wsdl:definition


Subject: Re: [xsl] Building a bidirectional map of namespaces prefix to namespace from wsdl:definition
From: Farrukh Najmi <farrukh@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Mar 2008 11:17:10 -0400

Mukul Gandhi wrote:
On Fri, Mar 21, 2008 at 7:08 AM, Farrukh Najmi
<farrukh@xxxxxxxxxxxxxxxxxxxxx> wrote:
 I need to process a WSDL document via XSLT and build two maps from the
 namespace declaration in the wsdl:definition element.

* Key is the namespace prefix and value is the namespace
* Key is the namespace and value is the prefix

This should be easy to do in XSLT (in 2.0 surely).

Does xalan in JDK 5 support XSLT 2.0? I do not believe so. For this reason I would like an XSLT 1.0 based solution.


When you say,
"build two maps", then what kind of data structure in the stylesheet
are you looking to store the maps?

Probably based on xslt:key ( <http://www.w3schools.com/xsl/el_key.asp>).


Or probably, you can output two XML
documents (or perhaps, text files), which contain the maps.

No I am looking for an in-memory solution that will be used within the same stylesheet.


Does anyone have an example of doing that or something similar that they
can share along with a snippet that shows how to do a
lookup of a value based on key.

When you say, "do a lookup of a value based on key", you need to
clarify what data structure stores the map. If the maps are stored in
external XML or text files, you can do a lookup based on normal XPath
expressions.

No the maps have to be internal to style sheet. An examples is shown here under lookup table 1.6:


<http://www.ibm.com/developerworks/library/ws-trans/listing1.html>

If you could clarify on these aspects, we could try to solve the
problem, or can give suitable pointers ...

Hopefully my needs are clearer now?


--
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com


Current Thread
Keywords