xsl-list
[Top] [All Lists]

[xsl] Mapping Values.

2006-03-14 05:33:24
I have an xml of the form

 <root>
<bldg loc=3D3D3D"abcd" subloc=3D3D3D"abcd" />
<bldg loc=3D3D3D"xxxx" subloc=3D3D3D"yyyy" />
<bldg loc=3D3D3D"aaaa" subloc=3D3D3D"aaaa" />

<addr bldgloc=3D3D3D"aaaa" bldgsubloc=3D3D3D"aaaa" />
<addr bldgloc=3D3D3D"xxxx" bldgsubloc=3D3D3D"yyyy" />

 </root>

I have to convert it to
<root>
<bldg loc=3D3D3D"1" subloc=3D3D3D"1" />
<bldg loc=3D3D3D"2" subloc=3D3D3D"2" />
<bldg loc=3D3D3D"3" subloc=3D3D3D"3" />

<addr bldgloc=3D3D3D"3" bldgsubloc=3D3D3D"3" />
<addr bldgloc=3D3D3D"2" bldgsubloc=3D3D3D"2" />

</root>

So for this purpose I want to map some strings to some values that can be
used later. Like when I map bldg block in input to bldg block in output I
want to map the attributes to a number and then use the same when mapping
addr tags.
How shud I go about doing it ?

Amal.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>