Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAX and CDATA 1

Status
Not open for further replies.

chiph

Programmer
Jun 9, 1999
9,878
US
Just ran across this, don't know if anyone else has had this problem, but it wasn't easy to solve (lack of knowledge, more than anything else).

If the XML you're reading in via SAX has CDATA sections, the SAX contenthandler interface strips them out. You must use the IVBSAXLexicalHandler interface, which has events for startCDATA and endCDATA. These allow you to add the CDATA tags back in.

To get the SAX parser to recognize the lexical handler, you must set a property on it before calling the ParseURL method:
Code:
Call objSAX.putProperty("[URL unfurl="true"]http://xml.org/sax/properties/lexical-handler",[/URL] Me)
Call objSAX.parseURL("file:///" & sXMLFilePath)
Hope this helps.
Chip H.
 
fanningpj -

That was the value I saw in the MS XML 4.0 SDK help file. I wouldn't be surprised that it was out of date. :)

Chip H.
Error on line 9: Object of type SIGNATURE expected
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top