Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Ignoring white spaces and line breaks between elements

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: ozkan ozcan <ozcozk AT>
  • To: XOM-interest AT
  • Subject: [XOM-interest] Ignoring white spaces and line breaks between elements
  • Date: Thu, 22 Dec 2005 11:00:58 +0100

I'm sorry that I have just sent an empty message accidentally. I'm quite new
at using Xom, which I heard about at JavaPolis. It is indeed a well-designed
library with respect to its easiness to use and its not having redundant
Well, my problem is that:

when I parse this document:

<?xml version="1.0" encoding="UTF-8"?>
<text id="1">Text 1 &amp;fgdgdg</text>
<text id="2">Text 2</text>
<text id="3">Text 3</text>
<text id="4">Text 4</text>
<text id="5">Text 5</text>
<text id="6">text 6</text>

when i try to extract all Text nodes with XPath (//text()), I get line
breaks also as Text nodes, which is not expected.
But when I do the same thing without pretty-printed, everything in one line
I get what i want.

Is there an easy way of making Builder ignore line breaks.
Any help is appreciated,
Thank you very much,

Archive powered by MHonArc 2.6.24.

Top of Page