Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml and java

Status
Not open for further replies.

MultipartRequest

Programmer
Sep 12, 2001
19
CL
well, I have this little problem. I am parsing an xml file with jdom, the thing is I have an element which contains a large text. This text is made of different paragraphs (line breaks).
Here is the deal, when I parse the document in order to extract the element text, I loose the paragraph structure, that means it returns me the whole text with no line brakes.

How can I solve this problem??
excuse my english.
 
do u have any control over how the contents of the xml file are generated, or are u getting it from a thrid party?
 
yes i do have control. I can remove, update or add elements to the xml file, I have full acces to it.
 
I had this problem myself. It drove me crazy because after so many characters strung together, it started to truncate the files. I inquired on several forums, but got no response. To this minute, I'm not sure if I could have accomplished this a different (or more efficient) way, but it works. I finally solved my problem by first writing a class to accept the end of para codes together (</p>) using a vector array and then tokenizing the paras subsequently to a file.

Hope this helps some. Maybe someone has a better idea? :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top