LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   XML question (https://www.linuxquestions.org/questions/programming-9/xml-question-564176/)

kpachopoulos 06-24-2007 01:21 PM

XML question
 
Hi,
say i have the following:
<tag1><tag2>txt</tag2></tag1>

I used the kXML pull parser, but the question will probably apply to other parsers too. The parser "notifies" me right of a TEXT event after <tag2>, as well as a TEXT event after <tag1>, with text being "". Is this right or is it my idea? Is it considered, that the string "" exists between the <tag1> and </tag1> tags?

Thanks

IBall 07-01-2007 04:27 AM

AFAIK, there will only be an event for the text between <tag2> and </tag2>.
There is no string between <tag1> and <tag2>, and most XML parsers only generate a "found characters" event when there are actually characters. You should get an event after <tag1> to say that <tag2> is found.

--Ian


All times are GMT -5. The time now is 05:14 AM.