File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes kXml - Preventing expanding entity references in attribute values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "kXml - Preventing expanding entity references in attribute values" Watch "kXml - Preventing expanding entity references in attribute values" New topic
Author

kXml - Preventing expanding entity references in attribute values

Vivek Viswanathan
Ranch Hand

Joined: Mar 03, 2001
Posts: 350
Hi

I am using kXml for parsing a well formed html page and I am having a problem since this parser expands entity references in attributes values.
Since the page that I am parsing is an HTML page it contains something on these lines

...href="http://foobar.com/FooToos.aspx?ito=4912&itc=0"...

As you can see the parser reads the attribute values &itc=0 and thinks that it is a begingning of an entity and then falls over since it doesnt get an ending ; it complains that it could not resolve &itc

But as you can see that is not an entity ref rather it is paramters passed to the page FooToos.aspx.

So comming back to my questions.

Has anyone going around and modified kXml source code so that it doesnt be too smart and starts expanding all the entity references it encounters in attribute values.


Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: kXml - Preventing expanding entity references in attribute values
 
Similar Threads
my attribute value is coming in html tag how to parse that value in java
kXml - Preventing expanding entity references in attribute values
EL expressions involvin . and [] operator
My two bits
Question on Entity References