Re: I need some ideas on XML parsing.....
- From: "nalexander@xxxxxxxxx" <nalexander@xxxxxxxxx>
- Date: 30 Dec 2006 17:42:57 -0800
1. Do not understand your structure, but:
<items>
<item attribute="value">
</item>
<item attribute="anothervalue">
</item>
</items>
could match multiple rows.
2. I wonder if the item tag attribute that matches the structure of the
contained data is perhaps leading you to create dynamic structures?
Interesting. Is that parsed by XSL switch statements that use the
variant structure? Something tells me you may need a uniformly named
container for the object being defined therein?
I am fairly new to XSL so forgive me if I am barking up wrong trees
Cheers
Nicholas
CptDondo wrote:
I've been struggling with this concept for a while, and I'm getting a
bit burned out...
I've got a piece of equipment that has data that I need to get.
The data is stored in "bytes" for lack of a better word, and I need to
parse it out according to an XML file format.
Here goes:
data is stored in rows like this:
uint From uint To uint bitmap
...
The row is defined by this bit of XML:
<items orientation="row" start="40079" inc="3"
order="From,To,auxA,auxB,auxC,auxD" format="nFrom/nTo/nbitmap">
<From format="n" />
<To format="n"/>
<bitmap format="n">
<auxA bit="0x01"/>
<auxB bit="0x02"/>
<auxC bit="0x04"/>
<auxD bit="0x08"/>
</bitmap>
</items>
Assume that I get a binary string, consisting of 6 bytes with the above
information. I have to create an array with the following elements:
From To auxA auxB auxC auxD
with the values parsed out of the 6 bytes according to the XML
definition. The XML can change if the data structure changes, so the
code has to parse the XML first, then create a format string, and
finally unpack the binary string.
I'm having a heck of a time getting a concept worked out for this. It
should be easy but I've been working on related bits of code for so long
that it all barely makes sense right now.... :-)
Anyway I would appreciate any suggestions on this.
And Happy New Year to all!
--Yan
.
- References:
- I need some ideas on XML parsing.....
- From: CptDondo
- I need some ideas on XML parsing.....
- Prev by Date: Re: HELP ! ! ! something simple . . . :D
- Next by Date: Re: phpinfo() - strange results...
- Previous by thread: I need some ideas on XML parsing.....
- Next by thread: ordering mysql request by part of a key
- Index(es):