Re: [xml] newbie question.



How could I access those elements (FL, BG,
> SH,etc)? I thought those elements should
be the children nodes of the TOP elements,
> aren't they?

They are. And they have siblings you know nothing about, such as the one you encountered.

This is off-topic here. It targets the very basics of XML and has nothing to do with any XML processor software. You have seen XML and, like all of us in the very beginning, wrongly assumed it were simple :-)

The thing that confuses you confuses about 90% of XML newbies and is fully understood only when they try to write a XML processor. XML stores data, not its representation. When you store data, all of it matters. Every byte. The offending node you received contains the line-delimiting characters, spaces and tabs you used to make the XML hierarchy in your file easily perceivable by human senses. Unfortunately, computers don't tick like humans do and years shall pass before they begin doing so. Today, computers don't give a yesterday's coffee for your formatting.

Get yourself a good book about XML. Do not try to use libxml for reading files you made with a text editor. Use libxml to generate your XML files, then take a look at what libxml generated and compare it with what you would have typed in your text editor. That is the most effective way to comprehend what you have seen.

Ciao
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]