XML DOM Parsing Issue with 


C

clowtown

I have been having trouble parsing this string.

<UserValue value="John O&quot;Hare
101 N. Main St"
title="ConsumedText"></UserValue>


The &quot; is being parsed correctly, but the &#xA is being converted
into a space instead of a linefeed/newline. The newline is crutial to
formatting in the application.

I have been searching for a couple days now and tried many different
methods and have not been able to get the parser to stop converting
this character set into a single space. I believe the issue is
occurring because it is an attribute value and not text in the node.


Please do not critique the format of the xml, as I know it is
undesireable. I am just trying to implement a short term solution.

I should also mention that searching the xml file before parsing is
not feasible.

Tech being used: JRE 1.4.2.10, Xerces DOMParser


Thanks in advance for any advice.

--Clowtown
 
P

Pavel Lepin

clowtown said:
I have been having trouble parsing this string.

<UserValue value="John O&quot;Hare
101 N. Main St"
title="ConsumedText"></UserValue>

The &quot; is being parsed correctly, but the &#xA is
being converted
into a space instead of a linefeed/newline. The newline
is crutial to formatting in the application.

You might want to read W3C's XML 1.0 4E, 3.3.3
(Attribute-Value Normalization).

Follow-ups set to comp.text.xml, this has very little to do
with Java, and everything to do with XML specs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top