You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by er...@apache.org on 2004/03/04 19:30:49 UTC

cvs commit: xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2 DomImpl.java

ericvas     2004/03/04 10:30:49

  Modified:    v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
                        DomImpl.java
  Log:
  Fixed getParentNode
  
  Revision  Changes    Path
  1.16      +41 -1     xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/DomImpl.java
  
  Index: DomImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/DomImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DomImpl.java	3 Mar 2004 22:56:38 -0000	1.15
  +++ DomImpl.java	4 Mar 2004 18:30:49 -0000	1.16
  @@ -1172,7 +1172,47 @@
   
           if (c != null && c.isNonDomRoot())
           {
  -            throw new RuntimeException( "Not impl" );
  +            c.next();
  +            
  +            assert c.kind() > 0;
  +
  +            if (c.isText())
  +                c.next();
  +            else
  +            {
  +                c.toEnd();
  +                c.next();
  +            }
  +            
  +            if (c.isFinish())
  +            {
  +                c.release();
  +                c = null;
  +            }
  +            else
  +            {
  +                Cur frag = n.locale().tempCur();
  +                
  +                frag.createDomDocFragRoot();
  +
  +                frag.next();
  +
  +                c.toParent();
  +                c.next();
  +
  +                while ( !c.isFinish() )
  +                {
  +                    if (c.isText())
  +                        c.moveChars( frag, -1 );
  +                    else
  +                        c.moveNode( frag );
  +                }
  +
  +                c.moveToCur( frag );
  +                c.toParent();
  +
  +                frag.release();
  +            }
           }
   
           if (c == null)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org