You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Marcus C <ma...@yahoo.com> on 2004/04/13 00:28:28 UTC

SAX Parsing a C++ string or an input stream INSTEAD of a file

Hi all,
�
The API docs are not clear about whether the SAX2
Parser can parse from any source other than a URI
(file or URL).� I noticed in the Parser API that they
have this:
�
virtual void Parser::parse (�const InputSource
&�source �)�[pure virtual]
�
In the comments for this function, it says "The
application can use this method to instruct the SAX
parser to begin parsing an XML document from any valid
input source (a character stream, a byte stream, or a
URI)."

However, in the SAXParser documentation, it only
mentions that it can parse from a FILE.� Does anyone
know if I can definitely use a SAX parser to parse
either 1) a C++ string in memory, or 2) a C++ input
stream (string or byte).� Thanks for any help you can
give me.

Regards,
Marcus



__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: SAX Parsing a C++ string or an input stream INSTEAD of a file

Posted by "Jeroen N. Witmond" <jn...@xs4all.nl>.
> Hi all,
>
> The API docs are not clear about whether the SAX2
> Parser can parse from any source other than a URI
> (file or URL).  I noticed in the Parser API that they
> have this:
>
> virtual void Parser::parse ( const InputSource
> & source  ) [pure virtual]
>
> In the comments for this function, it says "The
> application can use this method to instruct the SAX
> parser to begin parsing an XML document from any valid
> input source (a character stream, a byte stream, or a
> URI)."
>
> However, in the SAXParser documentation, it only
> mentions that it can parse from a FILE.  Does anyone
> know if I can definitely use a SAX parser to parse
> either 1) a C++ string in memory, or 2) a C++ input
> stream (string or byte).  Thanks for any help you can
> give me.
>

Did you take a look at the samples, specifically StdInParse and MemParse?

Jeroen.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org