Re: glib and XML



On Thu, Mar 03, 2005 at 03:51:23PM -0400, André Pedralho wrote:
I'm building an app that uses the GLib simple XML subset parser
(http://developer.gnome.org/doc/API/2.0/glib/glib-Simple-XML-Subset-Parser.html),
but I'm getting a problem at this!
My XML has some recursions e.g.

1 <DL>
2    <DT>some text
3    <A HREF=some url>some name</A>
4    <DT>some text
5    <DL>
6       <A HREF=another url>another name</A>
7       <DT>some text
8     </DL>
9     <DT>some text
10   <A HREF=some url>some name</A>
11 </DL>

How can you see, there is a <DL> (line 5) tag inside a <DL> (line 1) tag!
But I get a parse error when the </DL> (line 8) is found!

This is not a well-formed XML (read: this is not XML).  In
XML, all tags have to be closed (or empty, which is
a special case of closed).  So the structure actually is

<DL>
   <DT>some text
     <A HREF=some url>some name</A>
     <DT>some text
       <DL>
         <A HREF=another url>another name</A>
         <DT>some text
         </DL>
         ^^^^^ Wrong, trying to close <DL>, but
               <DT> is the currently open tag.

Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



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