OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Fwd: Re: Genx - expat co-operation

[ Lists Home | Date Index | Thread Index ]


>From: Tim Bray <tbray@textuality.com>
>Subject: Re: Genx - expat co-operation
>Date: Sun, 25 Jan 2004 08:52:56 -0800
>To: Toni Uusitalo <toni.uusitalo@pan.nu>
>X-Mailer: Apple Mail (2.609)
>X-Mail-Handler: MailHop Outbound by DynDNS.org
>X-Report-Abuse-To: abuse@dyndns.org
>X-MHO-User: LaurenAndTim
>
>On Jan 25, 2004, at 3:17 AM, Toni Uusitalo wrote:
>
>>I wrote little program demonstrating this, it's called naxWriter
>
>Damn clever!  :) You should send that to xml-dev if you haven't already -Tim

Original post:
source file isn't attached but can be found here:
http://www.saunalahti.fi/~samiuus/toni/xmlproc/naxWriter.c

Hi mr Bray,

You may have already considered this but this came into my mind yesterday:

Expat's isFinal feature (the parameter to XML_Parse etc.) allows us to parse
in chunks, you can send it "<node>" and on the next call "text" and then 
"</node>" etc.
This feature makes writing very pedantic (as pedantic as expat) 
well-formedness writer
quite easy. I believe there could even be validity checker attached if one 
has such
a thing on top of expat!

I wrote little program demonstrating this, it's called naxWriter which 
means "natural
xml writer" i.e. you can feed "natural" xml to it; it checks 
well-formedness using
expat's XML_Parse and if expat thinks it's ok, it output xml as you wrote 
it! (You only got yourself
to blame for pretty printing flaws ;-) )

Of course one could write StartElement type of constructs with &lt; 
escaping etc. on top of this.

The source is attached, you only have to link it with -lexpat or 
libexpat.lib in win
if you want to test it.

I guess there's still need for standalone genx implementation, I don't know
if this kind of writer is any good in real world  ;-)



with respect,
Toni Uusitalo






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS