How to insert after using XmlCursor?

2013-10-23 Thread Michael Bishop
Hello all, I'm a bit stuck in trying to achieve this with XmlObjects and XmlCursor. Imagine the following scenario: parent childSome text/child /parent I want to insert a new element AFTER the child element. parent childSome text/child !-- New element here! -- /parent I don't

Re: How to insert after using XmlCursor?

2013-10-23 Thread jerry . sy
You need to go to the END of the parent cursor or to the nextToken of the END of the lastChild, then do the insert. XmlObject test1 = XmlObject.Factory.parse(parentchildfirst/child/parent); XmlCursor testcurs = test1.newCursor(); if (testcurs.isStartdoc()){

Re: How to insert after using XmlCursor?

2013-10-23 Thread Michael Bishop
That's really helpful. That got me most of the way there. I have to take into account that child may not be the only kind of child a parent can have. Given schema constraints, I have to make sure children appear in the right order. I've found a solution that still needs testing for all cases. The