Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] need ideas for HTML manipulation

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Luca Passani <passani AT eunet.no>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] need ideas for HTML manipulation
  • Date: Thu, 05 May 2005 01:57:10 +0200

other question. I have this:

<td>Hi there. My name is Luca </td>

I would like to have:

Hi there. My name is Luca <br/>


I parse it like this:


public Nodes finishMakingElement(Element element) {
:

//end of table cell => break-line
if (element.getLocalName().equalsIgnoreCase("td") ) {
Element br = new Element("br", "http://www.w3.org/1999/xhtml";); Elements td_els = element.getChildElements();
Nodes nds = new Nodes();
for (int i=0;i<td_els.size();i++) {
td_els.get(i).detach();
nds.append(td_els.get(i));
}
nds.append(br);
return nds;
}

I expect:

Hi there. My name is Luca <br/>

but I get just:

<br />

What am I doing wrong?
isn't text also a child of the 'td' element?

thanks

Luca








Archive powered by MHonArc 2.6.24.

Top of Page