473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

May 25 '06 #1
0 1069

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: phark52 | last post by:
How would I go about writing a bitfield that can be read by my C app? I want to pack a few bools into one int. I know an extended module exists (npstruct) which helps you do this but I want to...
2
by: Mirjana Rakuljic | last post by:
Hi, I need help with transforming XML document. I generate xml document from query using Oracle XSU (DBMS_XMLQUERY) and the document I get is like this: <?xml version = '1.0' encoding =...
4
by: mikeyjudkins | last post by:
I have an XML file containing localized strings in 9 languages, encoded in Unicode (UTF-8). Im trying to parse this XML document via XSLT (Apache Xalan) to selectively render localized strings...
9
by: Davide Bruzzone | last post by:
Greetings all... I need to create a number of bitfield structs whose contents are smaller than the size of an int. For example: typedef struct foo FOO; struct foo { unsigned char fieldOne:...
4
by: Ray | last post by:
When a single-bit bitfield that was formed from an enum is promoted/cast into an integer, does ANSI C say anything about whether that integer should be signed or unsigned? SGI IRIX cc thinks it is...
3
by: Andy Venikov | last post by:
Sometimes you want to use a bitfield to hold an enum value. In such cases you would only use as many bits as are needed to encode the full set of enum values. And it is a pain to recompute and...
4
by: | last post by:
Hi, How do we marshall a type like this from a C++/CLI class wrapper to an unmanaged method? typedef struct { UINT32 blah : 1; UINT32 blah2 : 1; UINT32 blah3: 1;
7
by: arne | last post by:
Hi all, cleaning up some elderly code, I stumbled across the following: /**************************************************/ struct { uint bf:8; char a1; char a2;
6
by: shaun roe | last post by:
For a bit of seasonal festive fun, I thought I'd try making a bitfield function, i.e. a function returning, for example, the value of bits 1 to 5 of a word as an integer, when the exact bits are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.