Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - transforming bitfield to readable data

 
Thread Tools Search this Thread
Old 05-25-2006, 08:59 PM   #1
Default transforming bitfield to readable data


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"
xmlnssl="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



hortitude.eyeball@gmail.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump