[prev in list] [next in list] [prev in thread] [next in thread] 

List:       quanta-devel
Subject:    Re: [quanta-devel] Re: Using KDOM in Quanta
From:       Frans Englich <frans.englich () telia ! com>
Date:       2005-06-07 22:56:28
Message-ID: 200506072305.42780.frans.englich () telia ! com
[Download RAW message or body]

On Tuesday 07 June 2005 22:40, Paulo Moura Guedes wrote:
> On Tuesday 07 June 2005 23:21, Paulo Moura Guedes wrote:
> > Hi guys,
> >
> > I'm debugging the parser and maybe build some prototype to see what we
> > can do with this. I'm currently testing with libxml.
> >
> > I'll report later.
>
> I'm having good results. It seems the parser is tolerant to errors and
> continues parsing. This is the html content:
>
> <html>
> <body>
>     eu
>     <?
>         i = 5;
>     ?>
> <!--</body>-->
> </html>
>
> This is the result:
>
> KSVG - Parser: LibXMLParser::startParsing!
> KSVG - Parser: LibXMLParser::slotLoadingFinished(): 0x8102bb0
> KSVG - Parser: LibXMLParser::sax_start_doc
> KSVG - Parser: DocumentBuilder::startDocument, uri =
> file:///home/mojo/docs/test_htdocs/kdom1.html existing doc: (nil)
> KSVG - Parser: DocumentBuilder::startElementNS, namespaceURI =  prefix =
> localName = html
> KSVG - Parser: DocumentBuilder::startElementNS, namespaceURI =  qName =
> html KSVG - Parser: DocumentBuilder::characters, ch =
> KSVG - Parser:
> KSVG - Parser: DocumentBuilder::startElementNS, namespaceURI =  prefix =
> localName = body
> KSVG - Parser: DocumentBuilder::startElementNS, namespaceURI =  qName =
> body KSVG - Parser: DocumentBuilder::characters, ch =
>     eu
>
> KSVG - Parser: [4:15]: ERROR: xmlParsePI : no target name
>
> KSVG - Parser:
> KSVG - Parser: DocumentBuilder::characters, ch =
>         i = 5;
>     ?>
> KSVG - Parser:
> KSVG - Parser: DocumentBuilder::comment, ch = </body>
> KSVG - Parser: DocumentBuilder::characters, ch =
> KSVG - Parser:
> KSVG - Parser: [8:36]: ERROR: Opening and ending tag mismatch: body line 0
> and html
>
> KSVG - Parser:
> KSVG - Parser: DocumentBuilder::endElementNS, namespaceURI =  localName =
> qName = body
> KSVG - Parser: [8:36]: ERROR: Extra content at the end of the document
>
> KSVG - Parser:
> KSVG - Parser: DocumentBuilder::endDocument
> ParserFactory: DOM Tree:
> <?xml version="1.0"?>
> <html>
>   <body>
>     eu
>
>         i = 5;
>     ?&gt;
>     <!--</body>-->
>
>   </body>
> </html>
> ParserFactory: The KLibLoader contains the library libkdomparserlibxml
> (0x8073b30)
>
> Looks good...
>
> One thing I noticed is that a PI must have a target name, i.e., <? ... ?>
> is wrong, should be <?php ... >. I think this is specific to libxml.

No, it's according to spec, see the EBNF for the "PI" construct in "Extensible 
Markup Language (XML) 1.0 (Third Edition)":

http://www.w3.org/TR/REC-xml/#sec-pi

> Is 
> this a problem?

AFAIK, the Good Practice is to use names for PIs, <?php instead of <?, but how 
relevant that is.. is another matter.


Cheers,

		Frans



_______________________________________________
quanta-devel mailing list
quanta-devel@kde.org
https://mail.kde.org/mailman/listinfo/quanta-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic