Re: [xml] Parsiing question



On Fri, Sep 12, 2008 at 02:40:40PM -0700, Prashanth R wrote:
Hello,
I am trying to make use of Libxml's sax interfaces . I however ran into a
few constraints which I hoped , someone could clear.


Following are the constraints

1. I am porting libxml to a target that does not have C filesystem support.
In other words, I cannot make use of calls such as
xmlSAXUserParseFile(FileName)
Also , I cannot use the same function with the memory option as I do not
want to load the entire file in memory.
The only capablity that my platform has is that of a FileStream object that
can do FILE * like operations such as seek , read etc

2.  I would want to use SAX to parse my xml

I was looking at the API definition and was wondering if this API
Function: xmlReadIO

  No that's a tree loading API, not a SAX one.

Can this API be used in conjunction with the SAX methodology? In other
words, If i am able to supply the callbacks for read and close , will I
still be getting SAX callbacks  ( such as StartElement , EndElement etc ).

I was wondering if someone can help me clarify this and provide an example
usage with SAX.

  I discourage the use of SAX due to the associated complexity and
various troubles with entities support, and suggest you use the reader,
see 
    http://xmlsoft.org/xmlreader.html
and
    http://xmlsoft.org/html/libxml-xmlreader.html#xmlReaderForIO

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]