Altova Mailing List Archives


RE: Parsing a String

From: Kay Michael <Michael.Kay@---.--->
To: "'Alaoui Karim'" <alaouik@---.--->, xml-dev@---.---
Date: 6/13/2000 1:40:00 AM
> Is it possible to use an XML Parser to parse  an XML text 
> contained in a String or a StringBuffer ?

yes, if the parser supports the SAX interface: take a look at the SAX
InputSource object. You actually need to supply a StringReader but that's
trivial. The one thing to be careful of is that it's a good idea to supply a
SystemId as well, to act as a base URL for resolving any relative URL's
within the document.

Mike Kay

***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.