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

List:       quanta-devel
Subject:    Re: [quanta-devel] Re: KDOM
From:       Andras Mantia <amantia () kde ! org>
Date:       2005-05-19 13:28:40
Message-ID: 200505191628.48543.amantia () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 19 May 2005 15:38, Nikolas Zimmermann wrote:
> > From my current understanding the best way to go would be to create
> > a Quanta specific parser (QXmlReader) that gets used to create the
> > KDOM tree which will then be used to render the document.
> > This way Quanta deals directly with the tree that is used for
> > rendering.
>
> This is not 100% correct. What you want is to have a kdom tree in
> memory which holds _html_ nodes (created by khtml2). In future, you'd
> probably use KTrader for querying for KHTMLPart(2). You'd feed that
> part with an url or in-memory xml data and it'll construct a DOM tree
> using khtml2 (which uses kdoms libxml parser, as it's much more
> efficient & correct then QXml.) and a rendering tree which lives in
> khtml2/rendering (just like in khtml now).

So you suggest that we should rely on KDOM/KHTML2 to parse the document. 
This raises some questions from my side:
- does it build a DOM tree from any XML document?
- how quickly is the DOM tree updated when the source changes (remember, 
in an editor user are typing and some do it quite fast)?
- what happens with non-XML areas from the document? For example how the 
tree looks for
<a href="<? echo $mylink?>"><? echo "A link from PHP" ?> </a> ? I think 
it will be fine if it let us know where those PHP (<? ?>) areas are in 
the document. Of course, this is no PHP-only specific.
- how does it deal with errors? For example if you have a simple file 
with: "<strong>sometext | </strong>"(| is the cursor) and the user 
types a "<" at the cursor position (as he wants to enter a new tag), 
the text becomes "<strong> sometext < <strong>". There are many similar 
situations when the XML becomes invalid, but we still have to deal with 
it. 

These are some basic things we need to take care in Quanta, so I'd like 
to know if the above would be (even theoretically) possible or not.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

[Attachment #5 (application/pgp-signature)]

_______________________________________________
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