transforming bitfield to readable data

H

hortitude.eyeball

I have an xml doc that has an element that is a bitfield. I am trying
to write an xsl document that will be able to translate this to a
readable form.

Bit 1 = water
Bit 2 = coffee
Bit 3 = soda

Here's the xml...


<?xml version="1.0" encoding="ISO8859-1" ?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>

<RootElement>
<ChildElement>0x01</ChildElement>
<ChildElement>0x02</ChildElement>
<ChildElement>0x03</ChildElement>
<ChildElement>0x05</ChildElement>
</RootElement>



Here's the xsl...

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<xsl:for-each select="RootElement/ChildElement">
<xsl:value-of select="."/> = XXXXXXXX
<p></p>
</xsl:for-each>
</body>
</html>

</xsl:template>

</xsl:stylesheet>




My hope is that when I open the xml in my webrowser I could be able to
see output that looked something like

0x01 = Water
0x02 = Coffee
0x03 = Water Coffee
0x05 = Water Soda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top