Hi out there, I need to parse an xmlstream. I am using the Documentbuilderfactory for this and normaly all works fine. In some Tags sometimes a "&" occurs. I do not have the possibility to encode this data before creating the xmlstream. If the parser finds this symbol it throws a sax-parser-exception. Is there any way to parse this symbol without encoding it in the right way? Thx. Bye Mark
SAX Parser or any parser can only parse Well-formed XMLs. If any XMLs contain any & inside the element, then it is not a well-formed xml. Ideally it should be replaced with & You need to check for wellformedness of xml and then parse.
SCJP 1.4, SCDJWS , SCJA<br />I can do ALL things through CHRIST who strengthens me.
The problem is that the xml isnt generated by me but by another software. So I am not able to encode the "&" before parsing. I could convert the stream to a string and replace all "&" by the correct encoding and after that run the parser. But isnt there an easier way? Bye Mark
Hi, the cdata[[ works (I can define the xml-strucute in the thirdparty software but not the containing data)! So I dont have to encode manually. Thx a lot! Mark
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop