XSLT 1.0 Value map

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,
In my XSLT I have to replace a node value corresponding to a predifined value like this :
if node value is CF, then output node value is CE<br/>
if node value is FT, then output node value is TX<br/>
if node value is MO, then output node value is NM
etc ...
I have followed some blog post or forum posts, but its still not working :
I have added the maping table at the top of my stylesheet
<pre class="prettyprint" style=" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:purk="http://obx2mapping.data" ... >

<purk:obx2_map>
<entry key="CE CE</entry>
<entry key="CF CE</entry>
<entry key="DT DT</entry>
<entry key="FT TX</entry>
<entry key="MO NM</entry>
<entry key="ST ST</entry>
<entry key="NM NM</entry>
<entry key="SN ST</entry>
<entry key="TX TX</entry>
<entry key="TM DT</entry>
<entry key="TS DT</entry>
</purk:obx2_map>[/code]
And inside the node, I put this :
<pre class="prettyprint" style=" <xsl:variable name="obx2_sider" select="OBX_2_ValueType/text()" />
<OBX_2_ValueType><xsl:value-of select="document()/*/purk:obx2_map/entry[@key=$obx2_sider]"/></OBX_2_ValueType>[/code]
The output is nothing ...
I am able to display in the output the variable content with this <xsl:value-of select="$obx2_sider"/>.
Is there something wrong in my syntax ?
Thanks

<br/>

<br/>

View the full article
 
Back
Top