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 Iain Gillies <i....@videonetworks.com> on 2001/03/22 10:36:47 UTC

SAX2 parsing from a stream

I am unable to parse a string of xml using xerces c++ 1.4.0

Can anyone please show a code snippet to show me how this is done.

I am trying to convert the following code snippet from Java to c++.


1	String xml = "<?xml
version=\"1.0\"?><sample><addressid>1234556</addressid><aNode>someValue</aNo
de></sample>";
2	SAXParser parser = new SAXParser();
3	parser.setDocumentHandler(new CountSax());
4	parser.parse(new InputSource(new
java.io.ByteArrayInputStream(xml.getBytes())));



I have had success parsing an xml file but cannot get line 4 of above code
snippet, converted to c++ without causing a run-time fatal error in the
function 'parser.parse()' of SAXParser.

Can anyone please help or tell me where I can see an example.


Thanks for your time and effort.
Iain G.





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