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

List:       kde-devel
Subject:    Re: XML & special characters
From:       Ellis Whitehead <kde () ellisw ! net>
Date:       2002-03-30 13:26:27
[Download RAW message or body]

Thanks for the info!

Cheers,
Ellis

On Friday 29 March 2002 15:01, Nicolas Goutte wrote:
> On Friday 29 March 2002 17:51, Ellis Whitehead wrote:
> > Does anyone know what you need to override in Qt's XML class hierarchy in
> > order to interpret "&special;" characters?  I need this for the MathML
> > implementation which has names like "&PlusMinus;" and "&InvisibleTimes;".
> >
> > Thanks!
> > Ellis
>
> It is not easily possible with SAX2 (QT's QXML classes.)
>
> I suppose that you have found out that QXmlContentHandler::skippedEntity
> happens out of turn (at least it did in QT2.)
>
> The documented way is to overrule QXmlEntityResolver::resolveEntity. So
> when !DOCTYPE is to be proceded, you feed the parser with the DTD (or your
> own version with just the entity declarations.) Problem: you must be sure
> that the !DOCTYPE exists in the document.
>
> Another possibility is to write a parser yourself. (If you want, look at
> KWord's HTML import filter before the 15th September 2001 (MAIN branch,
> path: koffice/filters/kword/html). The parser there is SAX2-like, but not
> integrated into SAX2, as it was not possible for QT2. The code itself is
> for QT3.)
>
> To change the entities afterwards like described in Frerich Raabe's email
> is very problematic and can lead to errors.
>
> For example with &nbsp; (non-breaking space):
>
> &amp;nbsp;
>
> Normally this gives: &nbsp;
> If you make replace afterwards, you will have a non-breakspace instead.
>
> Have a nice day/evening/night!
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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