From: Jimmy Z. <cra...@co...> - 2006-11-06 18:03:12
|
Thanks for pointing that out, I have to look at the code again, it may = be a bug that you discovered... ----- Original Message -----=20 From: Harrie Hoogeveen=20 To: vtd...@li...=20 Sent: Monday, November 06, 2006 1:46 AM Subject: [Vtd-xml-users] built-in entity references Hello, I had a question about the built-in entity references. You support, as = told on the website only a few: " &s; ' > < Q1: I was wondering why is it not & and &apo; as in the standard?=20 For example a lot of parsers do not understand &s; but do = understand &=20 =20 Now, I have to adapt my xml, or the VTD code. I am looking at this = function getCharResolved() from VTDNav. If you look at the swich, after the & sign, it detects this: =20 case 'a' : ch =3D getCharUnit(offset); if (ch =3D=3D 'm') { if (getCharUnit(offset + 1) =3D=3D 'p' && getCharUnit(offset + 2) =3D=3D = ';') { inc =3D 5; val =3D '&'; } else throw new NavException("illegal = builtin reference"); } else if (ch =3D=3D 'p') { if (getCharUnit(offset + 1) =3D=3D 'o' && getCharUnit(offset + 2) =3D=3D = 's' && getCharUnit(offset + 3) =3D=3D = ';') { inc =3D 6; val =3D '\''; } else throw new NavException("illegal = builtin reference"); } else throw new NavException("illegal builtin = reference"); break; =20 Which in translation is amp; and apos; =20 Now it realy is getting confusing. If a put &s; in my xml, it throws an exception any way: = "javax.ejb.EJBException: com.ximpleware.EntityException: Errors in = Entity: Illegal builtin reference" on line 499 in VTDGen. If I put & in my xml I get a: "NavException: Invalid entity char" = on line 830 in VTDNav. Of which you can see the code above, which should work for &. Also the & is supported in VTDNav, if I see correct on line 740, = but also gets a exception What is going on? Mabey it's in this piece of code on line 729 in VTDNav: =20 ch =3D (int)l; =20 if (ch !=3D '&') return l; =20 I have some time to correct this. What is the problem? Why did you = block it out like that? =20 Harrie Hoogeveen =20 =20 -------------------------------------------------------------------------= ----- = -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 -------------------------------------------------------------------------= ----- _______________________________________________ Vtd-xml-users mailing list Vtd...@li... https://lists.sourceforge.net/lists/listinfo/vtd-xml-users |