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
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