You are here: Re: I need some ideas on XML parsing..... « PHP Programming Language « IT news, forums, messages
Re: I need some ideas on XML parsing.....

Posted by nalexander@gmail.com on 12/31/06 01:42

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация