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

Re: Genx


jan h karl

----- Original Message ----- 
From: "Joe Gregorio" <joe@b...>
> > Have you looked at the API of James Clark's Expat?
> 
> Based on your question I just took a look at
> Expat and saw a mix of calls in xmlparse.h,
> some using strings that are null terminated, 
> some that are not:
> 
>   /* s is not 0 terminated. */
>   typedef void (*XML_CharacterDataHandler)(void *userData,
> const XML_Char *s,
> int len);
> 
>   /* target and data are 0 terminated */
>   typedef void (*XML_ProcessingInstructionHandler)(void *userData,
> const XML_Char *target,
> const XML_Char *data);
> 
>   /* data is 0 terminated */
>   typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
> 
> 
> Now this was a quick look and I could be poking
> around in the wrong file, please point me
> it the right direction if that's the case.

The right file in the current Expat would be expat.h, but that does not 
change your observation. As far as I can tell there are two reasons:

1) Due to a low frequency, the impact of copying is low for some call-backs
2) Based on its internal logic Expat needs to copy some data out anyway
   (e.g. it has to remember the name of a start tag to check for the proper
    occurrence of the end-tag). In that case Expat will pass the internal copy
    which is a null-termninated string. 

Karl



  • References:

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.