From: Harrie H. <Har...@KB...> - 2006-11-06 09:46:10
|
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 |
From: John K. - K. I. NL <jk...@in...> - 2006-11-06 10:35:55
|
In the new code this actually has nothing to do with "&s;" - there is no such check, my guess it's a typo of the website. It does have to do something with offsets: For the package I built, add a ++ after offset in getChar() (in the function getCharResolved()) Example, it was this: static Long getCharResolved(VTDNav *vn,int offset){ exception e; int ch =3D 0; int val =3D 0; Long inc =3D2; Long l =3D getChar(vn,offset); Change it to: static Long getCharResolved(VTDNav *vn,int offset){ exception e; int ch =3D 0; int val =3D 0; Long inc =3D2; Long l =3D getChar(vn,offset++); I'm not sure if this'll work on older versions. In a new version I threw in a bunch of typecasts too, to get rid of those pesky compiler warnings (on HP-UX a killer), but I'll release the package somewhat later when I'm convinced it works. Regards, John Kraal Harrie Hoogeveen wrote: > Hello, >=20 > I had a question about the built-in entity references. You support, as > told on the website only a few: >=20 > " &s; ' > < >=20 > 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 >=20 > Now, I have to adapt my xml, or the VTD code. I am looking at this > function getCharResolved() from VTDNav. >=20 > If you look at the swich, after the & sign, it detects this: >=20 > =20 >=20 > *case* 'a' : >=20 > ch =3D getCharUnit(offset); >=20 > *if* (ch =3D=3D 'm') { >=20 > *if* (getCharUnit(offset + 1) =3D=3D 'p' >=20 > && getCharUnit(offset + 2) =3D=3D '= ;') { >=20 > inc =3D 5; >=20 > val =3D '&'; >=20 > } *else* >=20 > *throw* *new* NavException("illegal > builtin reference"); >=20 > } *else* *if* (ch =3D=3D 'p') { >=20 > *if* (getCharUnit(offset + 1) =3D=3D 'o' >=20 > && getCharUnit(offset + 2) =3D=3D '= s' >=20 > && getCharUnit(offset + 3) =3D=3D '= ;') { >=20 > inc =3D 6; >=20 > val =3D '\''; >=20 > } *else* >=20 > *throw* *new* NavException("illegal > builtin reference"); >=20 > } *else* >=20 > *throw* *new* NavException("illegal > builtin reference"); >=20 > *break*; >=20 > =20 >=20 > Which in translation is amp; and apos; >=20 > =20 >=20 > Now it realy is getting confusing. >=20 > If a put &s; in my xml, it throws an exception any way: > =E2=80=9Cjavax.ejb.EJBException: com.ximpleware.EntityException: Errors= in > Entity: Illegal builtin reference=E2=80=9D on line 499 in VTDGen. >=20 > If I put & in my xml I get a: =E2=80=9CNavException: Invalid entity= char=E2=80=9D on > line 830 in VTDNav. >=20 > Of which you can see the code above, which should work for &. >=20 > Also the & is supported in VTDNav, if I see correct on line 740, bu= t > also gets a exception >=20 > What is going on? >=20 > Mabey it=E2=80=99s in this piece of code on line 729 in VTDNav: >=20 > =20 >=20 > ch =3D (*int*)l; >=20 > =20 >=20 > *if* (ch !=3D '&') >=20 > *return* l; >=20 > =20 >=20 > I have some time to correct this. What is the problem? Why did you bloc= k > it out like that? >=20 > =20 >=20 > Harrie Hoogeveen >=20 > =20 >=20 > =20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > 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 Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users --=20 Met vriendelijke groeten, With kind regards, John Kraal Programmer Kewill Interchain A member of the Kewill Group of companies (T) +31 (0)78 6 123 310 (E) jk...@in... (W) www.interchain.nl IMPORTANT NOTICE: This e-mail, and each of any attachments transmitted with it, is confidential, is the property of Kewill Interchain, and is intended solely for the information of the individual/entity to whom this e-mail is addressed. It may also be privileged or protected by other legal rules. If you have received it by mistake, please notify the author immediately by replying to this e-mail and then destroy/delete this e-mail and all attachments (if any). If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail. In accordance with Kewill Interchain's internal policy e-mails sent and/or received may be monitored. Whilst Kewill Interchain takes reasonable precautions (including use of anti-virus software) it accepts no responsibility for any loss or damage should this e-mail contain any virus, or similar destructive or mischievous code. (c) Kewill Interchain 2006. |
From: John K. - K. I. NL <jk...@in...> - 2006-11-06 10:51:37
|
Oops, I'm using c_1.7, not the java-one. Though it seems the errors have the same origin. Kind regards, John Kraal John Kraal - Kewill Interchain NL wrote: > In the new code this actually has nothing to do with "&s;" - there i= s > no such check, my guess it's a typo of the website. It does have to do > something with offsets: >=20 > For the package I built, add a ++ after offset in getChar() (in the > function getCharResolved()) >=20 > Example, it was this: >=20 > static Long getCharResolved(VTDNav *vn,int offset)= { > exception e; > int ch =3D 0; > int val =3D 0; > Long inc =3D2; > Long l =3D getChar(vn,offset); >=20 > Change it to: >=20 > static Long getCharResolved(VTDNav *vn,int offset)= { > exception e; > int ch =3D 0; > int val =3D 0; > Long inc =3D2; > Long l =3D getChar(vn,offset++); >=20 > I'm not sure if this'll work on older versions. >=20 > In a new version I threw in a bunch of typecasts too, to get rid of > those pesky compiler warnings (on HP-UX a killer), but I'll release the > package somewhat later when I'm convinced it works. >=20 > Regards, > John Kraal >=20 >=20 > Harrie Hoogeveen wrote: >> 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? >> >> For example a lot of parsers do not understand &s; but do understan= d >> & >> >> =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("illega= l >> 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("illega= l >> 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: >> =E2=80=9Cjavax.ejb.EJBException: com.ximpleware.EntityException: Error= s in >> Entity: Illegal builtin reference=E2=80=9D on line 499 in VTDGen. >> >> If I put & in my xml I get a: =E2=80=9CNavException: Invalid entit= y char=E2=80=9D 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, b= ut >> also gets a exception >> >> What is going on? >> >> Mabey it=E2=80=99s 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 blo= ck >> it out like that? >> >> =20 >> >> Harrie Hoogeveen >> >> =20 >> >> =20 >> >> >> ----------------------------------------------------------------------= -- >> >> ----------------------------------------------------------------------= --- >> Using Tomcat but need to do more? Need to support web services, securi= ty? >> 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 Gero= nimo >> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&da= t=3D121642 >> >> >> ----------------------------------------------------------------------= -- >> >> _______________________________________________ >> Vtd-xml-users mailing list >> Vtd...@li... >> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users >=20 |
From: Jimmy Z. <cra...@co...> - 2006-11-06 18:06:25
|
They should have the same issue since the porting is a literal translation ----- Original Message ----- From: "John Kraal - Kewill Interchain NL" <jk...@in...> To: "John Kraal - Kewill Interchain NL" <jk...@in...> Cc: "Harrie Hoogeveen" <Har...@KB...>; <vtd...@li...> Sent: Monday, November 06, 2006 2:51 AM Subject: Re: [Vtd-xml-users] built-in entity references > Oops, > > I'm using c_1.7, not the java-one. Though it seems the errors have the > same origin. > > Kind regards, > John Kraal > > John Kraal - Kewill Interchain NL wrote: >> In the new code this actually has nothing to do with "&s;" - there is >> no such check, my guess it's a typo of the website. It does have to do >> something with offsets: >> >> For the package I built, add a ++ after offset in getChar() (in the >> function getCharResolved()) >> >> Example, it was this: >> >> static Long getCharResolved(VTDNav *vn,int offset){ >> exception e; >> int ch = 0; >> int val = 0; >> Long inc =2; >> Long l = getChar(vn,offset); >> >> Change it to: >> >> static Long getCharResolved(VTDNav *vn,int offset){ >> exception e; >> int ch = 0; >> int val = 0; >> Long inc =2; >> Long l = getChar(vn,offset++); >> >> I'm not sure if this'll work on older versions. >> >> In a new version I threw in a bunch of typecasts too, to get rid of >> those pesky compiler warnings (on HP-UX a killer), but I'll release the >> package somewhat later when I'm convinced it works. >> >> Regards, >> John Kraal >> >> >> Harrie Hoogeveen wrote: >>> 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? >>> >>> For example a lot of parsers do not understand &s; but do understand >>> & >>> >>> >>> >>> 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: >>> >>> >>> >>> *case* 'a' : >>> >>> ch = getCharUnit(offset); >>> >>> *if* (ch == 'm') { >>> >>> *if* (getCharUnit(offset + 1) == 'p' >>> >>> && getCharUnit(offset + 2) == ';') { >>> >>> inc = 5; >>> >>> val = '&'; >>> >>> } *else* >>> >>> *throw* *new* NavException("illegal >>> builtin reference"); >>> >>> } *else* *if* (ch == 'p') { >>> >>> *if* (getCharUnit(offset + 1) == 'o' >>> >>> && getCharUnit(offset + 2) == 's' >>> >>> && getCharUnit(offset + 3) == ';') { >>> >>> inc = 6; >>> >>> val = '\''; >>> >>> } *else* >>> >>> *throw* *new* NavException("illegal >>> builtin reference"); >>> >>> } *else* >>> >>> *throw* *new* NavException("illegal >>> builtin reference"); >>> >>> *break*; >>> >>> >>> >>> Which in translation is amp; and apos; >>> >>> >>> >>> 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: >>> >>> >>> >>> ch = (*int*)l; >>> >>> >>> >>> *if* (ch != '&') >>> >>> *return* l; >>> >>> >>> >>> I have some time to correct this. What is the problem? Why did you block >>> it out like that? >>> >>> >>> >>> Harrie Hoogeveen >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------- >>> 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=lnk&kid=120709&bid=263057&dat=121642 >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Vtd-xml-users mailing list >>> Vtd...@li... >>> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users >> > > ------------------------------------------------------------------------- > 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=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |
From: John K. - K. I. NL <jk...@in...> - 2006-11-07 07:34:26
|
And I've posted the solution; just increment offset before the next getChar() (or GetCharUnit()). Jimmy Zhang wrote: > They should have the same issue since the porting is a literal translat= ion > ----- Original Message ----- From: "John Kraal - Kewill Interchain NL" > <jk...@in...> > To: "John Kraal - Kewill Interchain NL" <jk...@in...> > Cc: "Harrie Hoogeveen" <Har...@KB...>; > <vtd...@li...> > Sent: Monday, November 06, 2006 2:51 AM > Subject: Re: [Vtd-xml-users] built-in entity references >=20 >=20 >> Oops, >> >> I'm using c_1.7, not the java-one. Though it seems the errors have the >> same origin. >> >> Kind regards, >> John Kraal >> >> John Kraal - Kewill Interchain NL wrote: >>> In the new code this actually has nothing to do with "&s;" - there= is >>> no such check, my guess it's a typo of the website. It does have to d= o >>> something with offsets: >>> >>> For the package I built, add a ++ after offset in getChar() (in the >>> function getCharResolved()) >>> >>> Example, it was this: >>> >>> static Long getCharResolved(VTDNav *vn,int offse= t){ >>> exception e; >>> int ch =3D 0; >>> int val =3D 0; >>> Long inc =3D2; >>> Long l =3D getChar(vn,offset); >>> >>> Change it to: >>> >>> static Long getCharResolved(VTDNav *vn,int offse= t){ >>> exception e; >>> int ch =3D 0; >>> int val =3D 0; >>> Long inc =3D2; >>> Long l =3D getChar(vn,offset++); >>> >>> I'm not sure if this'll work on older versions. >>> >>> In a new version I threw in a bunch of typecasts too, to get rid of >>> those pesky compiler warnings (on HP-UX a killer), but I'll release t= he >>> package somewhat later when I'm convinced it works. >>> >>> Regards, >>> John Kraal >>> >>> >>> Harrie Hoogeveen wrote: >>>> 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= ? >>>> >>>> For example a lot of parsers do not understand &s; but do underst= and >>>> & >>>> >>>> >>>> >>>> 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: >>>> >>>> >>>> >>>> *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("ille= gal >>>> 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("ille= gal >>>> builtin reference"); >>>> >>>> } *else* >>>> >>>> *throw* *new* NavException("illegal >>>> builtin reference"); >>>> >>>> *break*; >>>> >>>> >>>> >>>> Which in translation is amp; and apos; >>>> >>>> >>>> >>>> Now it realy is getting confusing. >>>> >>>> If a put &s; in my xml, it throws an exception any way: >>>> =E2=80=9Cjavax.ejb.EJBException: com.ximpleware.EntityException: Err= ors in >>>> Entity: Illegal builtin reference=E2=80=9D on line 499 in VTDGen. >>>> >>>> If I put & in my xml I get a: =E2=80=9CNavException: Invalid ent= ity >>>> char=E2=80=9D 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=E2=80=99s in this piece of code on line 729 in VTDNav: >>>> >>>> >>>> >>>> ch =3D (*int*)l; >>>> >>>> >>>> >>>> *if* (ch !=3D '&') >>>> >>>> *return* l; >>>> >>>> >>>> >>>> I have some time to correct this. What is the problem? Why did you >>>> block >>>> it out like that? >>>> >>>> >>>> >>>> Harrie Hoogeveen >>>> >>>> >>>> >>>> >>>> >>>> >>>> --------------------------------------------------------------------= ---- >>>> >>>> >>>> --------------------------------------------------------------------= ----- >>>> >>>> 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=3D121642 >>>> >>>> >>>> >>>> --------------------------------------------------------------------= ---- >>>> >>>> >>>> _______________________________________________ >>>> Vtd-xml-users mailing list >>>> Vtd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users >>> >> >> ----------------------------------------------------------------------= --- >> Using Tomcat but need to do more? Need to support web services, securi= ty? >> 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&da= t=3D121642 >> _______________________________________________ >> Vtd-xml-users mailing list >> Vtd...@li... >> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users >> >=20 >=20 --=20 Met vriendelijke groeten, With kind regards, John Kraal Programmer Kewill Interchain A member of the Kewill Group of companies (T) +31 (0)78 6 123 310 (E) jk...@in... (W) www.interchain.nl IMPORTANT NOTICE: This e-mail, and each of any attachments transmitted with it, is confidential, is the property of Kewill Interchain, and is intended solely for the information of the individual/entity to whom this e-mail is addressed. It may also be privileged or protected by other legal rules. If you have received it by mistake, please notify the author immediately by replying to this e-mail and then destroy/delete this e-mail and all attachments (if any). If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail. In accordance with Kewill Interchain's internal policy e-mails sent and/or received may be monitored. Whilst Kewill Interchain takes reasonable precautions (including use of anti-virus software) it accepts no responsibility for any loss or damage should this e-mail contain any virus, or similar destructive or mischievous code. (c) Kewill Interchain 2006. |
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 |
From: Jimmy Z. <cra...@co...> - 2006-11-06 18:05:51
|
getCharResolved returns a long, upper 32 bit is the offset value of the detected char or entity, lower 32 bit is the actually char detected, this is a rewrite in v1.7 it eliminates a instance variable which was shared among many different things... the other thing, I have been doing a lot of comment conversion from // to /* */ :) ----- Original Message ----- From: "John Kraal - Kewill Interchain NL" <jk...@in...> To: "Harrie Hoogeveen" <Har...@KB...> Cc: <vtd...@li...> Sent: Monday, November 06, 2006 2:35 AM Subject: Re: [Vtd-xml-users] built-in entity references > In the new code this actually has nothing to do with "&s;" - there is > no such check, my guess it's a typo of the website. It does have to do > something with offsets: > > For the package I built, add a ++ after offset in getChar() (in the > function getCharResolved()) > > Example, it was this: > > static Long getCharResolved(VTDNav *vn,int offset){ > exception e; > int ch = 0; > int val = 0; > Long inc =2; > Long l = getChar(vn,offset); > > Change it to: > > static Long getCharResolved(VTDNav *vn,int offset){ > exception e; > int ch = 0; > int val = 0; > Long inc =2; > Long l = getChar(vn,offset++); > > I'm not sure if this'll work on older versions. > > In a new version I threw in a bunch of typecasts too, to get rid of > those pesky compiler warnings (on HP-UX a killer), but I'll release the > package somewhat later when I'm convinced it works. > > Regards, > John Kraal > > > Harrie Hoogeveen wrote: >> 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? >> >> For example a lot of parsers do not understand &s; but do understand >> & >> >> >> >> 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: >> >> >> >> *case* 'a' : >> >> ch = getCharUnit(offset); >> >> *if* (ch == 'm') { >> >> *if* (getCharUnit(offset + 1) == 'p' >> >> && getCharUnit(offset + 2) == ';') { >> >> inc = 5; >> >> val = '&'; >> >> } *else* >> >> *throw* *new* NavException("illegal >> builtin reference"); >> >> } *else* *if* (ch == 'p') { >> >> *if* (getCharUnit(offset + 1) == 'o' >> >> && getCharUnit(offset + 2) == 's' >> >> && getCharUnit(offset + 3) == ';') { >> >> inc = 6; >> >> val = '\''; >> >> } *else* >> >> *throw* *new* NavException("illegal >> builtin reference"); >> >> } *else* >> >> *throw* *new* NavException("illegal >> builtin reference"); >> >> *break*; >> >> >> >> Which in translation is amp; and apos; >> >> >> >> 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: >> >> >> >> ch = (*int*)l; >> >> >> >> *if* (ch != '&') >> >> *return* l; >> >> >> >> I have some time to correct this. What is the problem? Why did you block >> it out like that? >> >> >> >> Harrie Hoogeveen >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> 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=lnk&kid=120709&bid=263057&dat=121642 >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Vtd-xml-users mailing list >> Vtd...@li... >> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > > -- > Met vriendelijke groeten, > With kind regards, > > John Kraal > Programmer > > Kewill Interchain > A member of the Kewill Group of companies > > (T) +31 (0)78 6 123 310 > (E) jk...@in... > (W) www.interchain.nl > > IMPORTANT NOTICE: This e-mail, and each of any attachments transmitted > with it, is confidential, is the property of Kewill Interchain, and is > intended solely for the information of the individual/entity to whom > this e-mail is addressed. It may also be privileged or protected by > other legal rules. If you have received it by mistake, please notify the > > author immediately by replying to this e-mail and then destroy/delete > this e-mail and all attachments (if any). If you are not the intended > recipient you must not use, disclose, distribute, copy, print, or rely > on this e-mail. In accordance with Kewill Interchain's internal policy > e-mails sent and/or received may be monitored. Whilst Kewill Interchain > takes reasonable precautions (including use of anti-virus software) it > accepts no responsibility for any loss or damage should this e-mail > contain any virus, or similar destructive or mischievous code. (c) > Kewill Interchain 2006. > > ------------------------------------------------------------------------- > 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=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |
From: Jimmy Z. <cra...@co...> - 2006-11-06 18:14:58
|
It is actually a typo on the vtd-xml project page, teh right entity is & not &s... ----- Original Message ----- From: "John Kraal - Kewill Interchain NL" <jk...@in...> To: "Harrie Hoogeveen" <Har...@KB...> Cc: <vtd...@li...> Sent: Monday, November 06, 2006 2:35 AM Subject: Re: [Vtd-xml-users] built-in entity references > In the new code this actually has nothing to do with "&s;" - there is > no such check, my guess it's a typo of the website. It does have to do > something with offsets: > > For the package I built, add a ++ after offset in getChar() (in the > function getCharResolved()) > > Example, it was this: > > static Long getCharResolved(VTDNav *vn,int offset){ > exception e; > int ch = 0; > int val = 0; > Long inc =2; > Long l = getChar(vn,offset); > > Change it to: > > static Long getCharResolved(VTDNav *vn,int offset){ > exception e; > int ch = 0; > int val = 0; > Long inc =2; > Long l = getChar(vn,offset++); > > I'm not sure if this'll work on older versions. > > In a new version I threw in a bunch of typecasts too, to get rid of > those pesky compiler warnings (on HP-UX a killer), but I'll release the > package somewhat later when I'm convinced it works. > > Regards, > John Kraal > > > Harrie Hoogeveen wrote: >> 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? >> >> For example a lot of parsers do not understand &s; but do understand >> & >> >> >> >> 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: >> >> >> >> *case* 'a' : >> >> ch = getCharUnit(offset); >> >> *if* (ch == 'm') { >> >> *if* (getCharUnit(offset + 1) == 'p' >> >> && getCharUnit(offset + 2) == ';') { >> >> inc = 5; >> >> val = '&'; >> >> } *else* >> >> *throw* *new* NavException("illegal >> builtin reference"); >> >> } *else* *if* (ch == 'p') { >> >> *if* (getCharUnit(offset + 1) == 'o' >> >> && getCharUnit(offset + 2) == 's' >> >> && getCharUnit(offset + 3) == ';') { >> >> inc = 6; >> >> val = '\''; >> >> } *else* >> >> *throw* *new* NavException("illegal >> builtin reference"); >> >> } *else* >> >> *throw* *new* NavException("illegal >> builtin reference"); >> >> *break*; >> >> >> >> Which in translation is amp; and apos; >> >> >> >> 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: >> >> >> >> ch = (*int*)l; >> >> >> >> *if* (ch != '&') >> >> *return* l; >> >> >> >> I have some time to correct this. What is the problem? Why did you block >> it out like that? >> >> >> >> Harrie Hoogeveen >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> 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=lnk&kid=120709&bid=263057&dat=121642 >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Vtd-xml-users mailing list >> Vtd...@li... >> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > > -- > Met vriendelijke groeten, > With kind regards, > > John Kraal > Programmer > > Kewill Interchain > A member of the Kewill Group of companies > > (T) +31 (0)78 6 123 310 > (E) jk...@in... > (W) www.interchain.nl > > IMPORTANT NOTICE: This e-mail, and each of any attachments transmitted > with it, is confidential, is the property of Kewill Interchain, and is > intended solely for the information of the individual/entity to whom > this e-mail is addressed. It may also be privileged or protected by > other legal rules. If you have received it by mistake, please notify the > > author immediately by replying to this e-mail and then destroy/delete > this e-mail and all attachments (if any). If you are not the intended > recipient you must not use, disclose, distribute, copy, print, or rely > on this e-mail. In accordance with Kewill Interchain's internal policy > e-mails sent and/or received may be monitored. Whilst Kewill Interchain > takes reasonable precautions (including use of anti-virus software) it > accepts no responsibility for any loss or damage should this e-mail > contain any virus, or similar destructive or mischievous code. (c) > Kewill Interchain 2006. > > ------------------------------------------------------------------------- > 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=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |