[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: My review of genx.h


genx review
Addressing issues not addressed elsewhere

On Jan 22, 2004, at 10:14 AM, Rich Salz wrote:

> Follow the standard open-modify-close model.  Support only one 
> document per genxWriter object.  That gets rid of genxNew; it would 
> also get rid of genxClose if it existed.  (See, I told you the current 
> model is too complicated. :)  Look at unix open syscall; flags specify 
> calling sequence.

Here's my thinking.  Genx is going to need a table for ascertaining 
which codepoints are legal Unicode characters, name characters, and so 
on.  I had the notion that rather than precompiling this I would cook 
it all up in code in a little one-time initializer routine.  Thus genx 
would have no static data, which would make it easier to compile into, 
for example Gnumacs and some embedded systems.  Thus you'd rather have 
a writer object that you generate multiple documents from.  On the 
other hand, if you don't mind having a precompiled table, then you're 
right, this eliminates one whole set of calls.

Am I going too far here?

> As someone else said, use typed opaque pointers:
>    typedef struct genxWriter_struct* genxWriter;

D'oh, that should have gone in the list of no-brainers.  Of course.

> Flags include:
>     gxoFILE -- next argument is FILE* for output
>     gxoNOPROLOG -- don't generate XML prolog
>     gxoSTANDALONE -- output "standalone='yes" in prolog
>     gxoABORT -- call abort() on any error (for debugging mode)
>     gxoFIXAMP -- turn & and < into &amp; and &lt;
>                  (perhaps gxoNOFIXMAP, I don't care)

I'm not too enthused about these, with the exception of the ABORT 
option, which could be a godsend at debugging time.

> genxScanUTF8 is a bad name -- looks to much like sscanf() et al.  
> Again, I'd merge that and the Check functions into the single Valid 
> predicate.

Yep, should be check not scan.

> How important is single-character output, really?  Making them use a 
> temporary buffer is not very inconvenient.  And if you believe must 
> single-char output will be in some kind of loop, anyway...

I'd use it all the time for odd characters by U+XXXX number

Cheers, Tim Bray  http://www.tbray.org/ongoing/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.