[XOM-interest] mixed content

Elliotte Harold elharo at metalab.unc.edu
Sun Oct 7 07:13:52 EDT 2007


Dave Pawson wrote:
> Problem.
>   I have a string which is to be marked up with 'p' element, and
> contains acronyms.
> 
> A function is called to parse the string for acronyms, recursively.
> 
> How can I build the mixed content without passing in an Element to the function?
> xom complains
> 
> Exception in thread "main" nu.xom.CycleException: Cannot add a node to itself
>         at nu.xom.Element.checkCycle(Element.java:1020)
>         at nu.xom.Element.insertionAllowed(Element.java:1001)
>         at nu.xom.ParentNode._insertChild(ParentNode.java:113)
>         at nu.xom.ParentNode.insertChild(ParentNode.java:106)
>         at nu.xom.ParentNode.appendChild(ParentNode.java:160)
>         at uphill.Markup.findAcrs(Markup.java:123)
> 
> 

  This exception means that at some point you tried to make an element 
its own child (or its own grandpa) or some such. That's almost certainly 
a bug, but probably not the one you think it is.

Actual code would be really helpful here. I can't say more than that 
without seeing the program.


-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/


More information about the XOM-interest mailing list