Skip to Content.
Sympa Menu

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

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: ozkan ozcan <ozcozk AT gmail.com>
  • To: XOM-interest AT lists.ibiblio.org
  • 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
methods.
Well, my problem is that:

when I parse this document:

<?xml version="1.0" encoding="UTF-8"?>
<chapter>
<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>
</chapter>

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,
Ozkan




Archive powered by MHonArc 2.6.24.

Top of Page