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
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()){
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
3 matches
Mail list logo