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: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Luca Passani <passani AT eunet.no>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] need ideas for HTML manipulation
  • Date: Thu, 05 May 2005 07:53:01 -0400

Luca Passani wrote:

Is there a way, using NodeFactory, to turn this:

<a href="link"><img src="pic" alt="text" /></a>

into this:

<a href="link">text</a>


Yes, but you need to maintain state. That is, you need to set a field like

boolean insideA = true;

from startMakingElement.

Then inside finishMakingElement if insideA is true and the element is an img just return a Nodes containing the Text object.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page