Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] bug in insertChild?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT ibiblio.org>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] bug in insertChild?
  • Date: Mon, 10 Aug 2009 08:16:31 -0700

On Mon, Aug 10, 2009 at 8:01 AM, T Benjamins<davidbowie2nl AT yahoo.com> wrote:
> Hi all,
>
> I'm running XOM 1.2.1 and i have problems running the folloing code:
>
>
>
> for
> Node tempNode = newMVHElement.copy();
> babElement.insertChild(tempNode, insertMVHIndex);
> }
>
> i want to insert a certain Node as a new child to babElement.
> When i run this code, it gets appended at the 3rd position instead of the
> 5th, (probably because my node array children of an Element
> contain Text(\n\t) and Node objects, so it gets inserted at position 5 in
> the array, but apparently that's position 2
> ) When i multiply the desired insertion index by 2 it works as expected.
>
> This is  a bug? Or am i dong something horribly wrong in loading the
> document??


It sounds like you're not properly accounting for text nodes
containing white space, but without a complete sample program
demonstrating the behavior I can't really say for sure.

--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page