xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eric...@apache.org
Subject cvs commit: xml-xmlbeans/v2/test/src/erictest EricTest.java
Date Fri, 26 Mar 2004 23:37:28 GMT
ericvas     2004/03/26 15:37:28

  Modified:    v2       build.xml
               v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
                        CharUtil.java Cur.java DomImpl.java Jsr173.java
                        Locale.java Public2.java
               v2/src/xmlstore/org/apache/xmlbeans/impl/store Root.java
                        Type.java
               v2/test/src/ericschema ericschema.xsd
               v2/test/src/erictest EricTest.java
  Added:       v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
                        TypeImpl.java
  Removed:     v2/src/typestore/org/apache/xmlbeans/impl/values
                        TypeStoreFactory.java
  Log:
  misc dom fixes
  
  Revision  Changes    Path
  1.55      +2 -1      xml-xmlbeans/v2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/build.xml,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- build.xml	22 Mar 2004 07:56:30 -0000	1.54
  +++ build.xml	26 Mar 2004 23:37:27 -0000	1.55
  @@ -850,10 +850,11 @@
     <!-- newstore2 target ============================================== -->
   
     <target name="newstore2.classes"
  -        depends="dirs, common.classes, xmlpublic.classes, saaj_api.classes">
  +        depends="dirs, common.classes, xmlpublic.classes, typestore.classes, saaj_api.classes">
       <mkdir dir="build/classes/newstore2"/>
       <javac srcdir="src/newstore2" destdir="build/classes/newstore2" source="1.4" debug="on">
         <classpath id="newstore2.compile.path">
  +        <pathelement location="build/classes/typestore"/>
           <pathelement location="build/lib/jsr173_api.jar"/>
           <pathelement location="build/classes/xmlinputstream"/>
           <pathelement location="build/classes/xmlpublic"/>
  
  
  
  1.6       +231 -220  xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/CharUtil.java
  
  Index: CharUtil.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/CharUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CharUtil.java	27 Feb 2004 22:32:47 -0000	1.5
  +++ CharUtil.java	26 Mar 2004 23:37:27 -0000	1.6
  @@ -25,224 +25,6 @@
       {
           return (CharUtil) tl_charUtil.get();
       }
  -    
  -    public CharUtil ( int charBufSize )
  -    {
  -        _charBufSize = charBufSize;
  -    }
  -    
  -    public static final class CharJoin
  -    {
  -        public CharJoin (
  -            Object srcLeft,  int offLeft,  int cchLeft,
  -            Object srcRight, int offRight, int cchRight )
  -        {
  -            _srcLeft  = srcLeft;  _offLeft  = offLeft;  _cchLeft  = cchLeft;
  -            _srcRight = srcRight; _offRight = offRight; _cchRight = cchRight;
  -
  -            int depth = 0;
  -            
  -            if (srcLeft instanceof CharJoin)
  -                depth = ((CharJoin) srcLeft)._depth;
  -            
  -            if (srcRight instanceof CharJoin)
  -            {
  -                int rightDepth = ((CharJoin) srcRight)._depth;
  -                
  -                if (rightDepth > depth)
  -                    depth = rightDepth;
  -            }
  -            
  -            _depth = depth;
  -        }
  -        
  -        public final Object _srcLeft;
  -        public final int    _offLeft;
  -        public final int    _cchLeft;
  -
  -        public final Object _srcRight;
  -        public final int    _offRight;
  -        public final int    _cchRight;
  -
  -        public final int _depth;
  -
  -        public int length ( ) { return _cchLeft + _cchRight; }
  -
  -        public boolean isValid ( int off, int cch )
  -        {
  -            // Eliminate left recursion
  -            
  -            for ( CharJoin cj = this ; ; cj = (CharJoin) cj._srcLeft )
  -            {
  -                if (off < 0 || cch < 0 || off > cj.length() || off + cch > cj.length())
  -                    return false;
  -
  -                if (!CharUtil.isValid( cj._srcRight, cj._offRight, cj._cchRight ))
  -                    return false;
  -
  -                if (!(cj._srcLeft instanceof CharJoin))
  -                      return CharUtil.isValid( cj._srcLeft, cj._offLeft, cj._cchLeft );
  -
  -                off = cj._offLeft;
  -                cch = cj._cchLeft;
  -            }
  -        }
  -
  -        private void getString ( StringBuffer sb, int d, int off, int cch )
  -        {
  -            assert cch > 0;
  -            
  -            // Avoid deep left recursion
  -            
  -            if (d++ < 32)
  -            {
  -                if (off < _cchLeft)
  -                {
  -                    int cchL = _cchLeft - off;
  -
  -                    if (cchL > cch)
  -                        cchL = cch;
  -                        
  -                    CharUtil.getString( sb, d, _srcLeft, _offLeft + off, cchL );
  -                    
  -                    cch -= cchL;
  -                    
  -                    if (cch > 0)
  -                        CharUtil.getString( sb, d, _srcRight, _offRight, cch );
  -                }
  -                else
  -                {
  -                    CharUtil.getString( sb, d, _srcRight, _offRight + off - _cchLeft, cch );
  -                }
  -            }
  -            else
  -            {
  -                ArrayList left = new ArrayList();
  -                
  -                for ( CharJoin cj = this ; ; cj = (CharJoin) cj._srcLeft )
  -                {
  -                    left.add( cj );
  -                    
  -                    if (!(cj._srcLeft instanceof CharJoin))
  -                    {
  -                        if (off < cj._cchLeft)
  -                        {
  -                            int cchL = cj._cchLeft - off;
  -
  -                            if (cchL > cch)
  -                                cchL = cch;
  -
  -                            CharUtil.getString( sb, d, cj._srcLeft, cj._offLeft + off, cchL );
  -
  -                            cch -= cchL;
  -                        }
  -                        
  -                        break;
  -                    }
  -                }
  -
  -                for ( int i = left.size() - 1 ; i >= 0 ; i-- )
  -                {
  -                    if (cch <= 0)
  -                        break;
  -                    
  -                    CharJoin cj = (CharJoin) left.get( i );
  -
  -                    int cchR = cch < cj._cchRight ? cch : cj._cchRight;
  -
  -                    CharUtil.getString( sb, d, cj._srcRight, cj._offRight, cchR );
  -
  -                    cch -= cchR;
  -                }
  -            }
  -        }
  -
  -        private void getChars ( char[] chars, int start, int d, int off, int cch )
  -        {
  -            assert cch > 0;
  -
  -            if (d++ < 32)
  -            {
  -                if (off < _cchLeft)
  -                {
  -                    int cchL = _cchLeft - off;
  -
  -                    if (cchL > cch)
  -                        cchL = cch;
  -
  -                    CharUtil.getChars( chars, start, d, _srcLeft, _offLeft + off, cchL );
  -
  -                    start += cchL;
  -                    cch -= cchL;
  -                    
  -                    if (cch > 0)
  -                        CharUtil.getChars( chars, start, d, _srcRight, _offRight, cch );
  -                }
  -                else
  -                {
  -                    CharUtil.getChars(
  -                        chars, start, d, _srcRight, _offRight + off - _cchLeft, cch );
  -                }
  -            }
  -            else
  -            {
  -                ArrayList left = new ArrayList();
  -
  -                for ( CharJoin cj = this ; ; cj = (CharJoin) cj._srcLeft )
  -                {
  -                    left.add( cj );
  -
  -                    if (!(cj._srcLeft instanceof CharJoin))
  -                    {
  -                        if (off < cj._cchLeft)
  -                        {
  -                            int cchL = cj._cchLeft - off;
  -
  -                            if (cchL > cch)
  -                                cchL = cch;
  -
  -                            CharUtil.getChars(
  -                                chars, start, d, cj._srcLeft, cj._offLeft + off, cchL );
  -
  -                            start += cchL;
  -                            cch -= cchL;
  -                        }
  -
  -                        break;
  -                    }
  -                }
  -
  -                for ( int i = left.size() - 1 ; i >= 0 ; i-- )
  -                {
  -                    if (cch <= 0)
  -                        break;
  -
  -                    CharJoin cj = (CharJoin) left.get( i );
  -
  -                    int cchR = cch < cj._cchRight ? cch : cj._cchRight;
  -
  -                    CharUtil.getChars( chars, start, d, cj._srcRight, cj._offRight, cchR );
  -
  -                    start += cchR;
  -                    cch -= cchR;
  -                }
  -            }
  -        }
  -
  -        private void dumpChars( int off, int cch )
  -        {
  -            dumpChars( System.out, off, cch );
  -        }
  -        
  -        private void dumpChars( PrintStream p, int off, int cch )
  -        {
  -            p.print( "( " );
  -            CharUtil.dumpChars( p, _srcLeft, _offLeft, _cchLeft );
  -            p.print( ", " );
  -            CharUtil.dumpChars( p, _srcRight, _offRight, _cchRight );
  -            p.print( " )" );
  -        }
  -    }
   
       private static void getString ( StringBuffer sb, int d, Object src, int off, int cch )
       {
  @@ -643,12 +425,241 @@
   
           return false;
       }
  +
  +    // These members are used to communicate offset and character count
  +    // information back to a caller of various methods on CharUtil.
  +    // Usually, the methods returns the src Object, and these two hold
  +    // the offset and the char count.
  +    
  +    public int _offSrc;
  +    public int _cchSrc;
  +
  +    //
  +    // Private stuff
  +    //
  +    
  +    private static final class CharJoin
  +    {
  +        public CharJoin (
  +            Object srcLeft,  int offLeft,  int cchLeft,
  +            Object srcRight, int offRight, int cchRight )
  +        {
  +            _srcLeft  = srcLeft;  _offLeft  = offLeft;  _cchLeft  = cchLeft;
  +            _srcRight = srcRight; _offRight = offRight; _cchRight = cchRight;
  +
  +            int depth = 0;
  +            
  +            if (srcLeft instanceof CharJoin)
  +                depth = ((CharJoin) srcLeft)._depth;
  +            
  +            if (srcRight instanceof CharJoin)
  +            {
  +                int rightDepth = ((CharJoin) srcRight)._depth;
  +                
  +                if (rightDepth > depth)
  +                    depth = rightDepth;
  +            }
  +            
  +            _depth = depth;
  +        }
  +        
  +        public final Object _srcLeft;
  +        public final int    _offLeft;
  +        public final int    _cchLeft;
  +
  +        public final Object _srcRight;
  +        public final int    _offRight;
  +        public final int    _cchRight;
  +
  +        public final int _depth;
  +
  +        public int length ( ) { return _cchLeft + _cchRight; }
  +
  +        public boolean isValid ( int off, int cch )
  +        {
  +            // Eliminate left recursion
  +            
  +            for ( CharJoin cj = this ; ; cj = (CharJoin) cj._srcLeft )
  +            {
  +                if (off < 0 || cch < 0 || off > cj.length() || off + cch > cj.length())
  +                    return false;
  +
  +                if (!CharUtil.isValid( cj._srcRight, cj._offRight, cj._cchRight ))
  +                    return false;
  +
  +                if (!(cj._srcLeft instanceof CharJoin))
  +                      return CharUtil.isValid( cj._srcLeft, cj._offLeft, cj._cchLeft );
  +
  +                off = cj._offLeft;
  +                cch = cj._cchLeft;
  +            }
  +        }
  +
  +        private void getString ( StringBuffer sb, int d, int off, int cch )
  +        {
  +            assert cch > 0;
  +            
  +            // Avoid deep left recursion
  +            
  +            if (d++ < 32)
  +            {
  +                if (off < _cchLeft)
  +                {
  +                    int cchL = _cchLeft - off;
  +
  +                    if (cchL > cch)
  +                        cchL = cch;
  +                        
  +                    CharUtil.getString( sb, d, _srcLeft, _offLeft + off, cchL );
  +                    
  +                    cch -= cchL;
  +                    
  +                    if (cch > 0)
  +                        CharUtil.getString( sb, d, _srcRight, _offRight, cch );
  +                }
  +                else
  +                {
  +                    CharUtil.getString( sb, d, _srcRight, _offRight + off - _cchLeft, cch );
  +                }
  +            }
  +            else
  +            {
  +                ArrayList left = new ArrayList();
  +                
  +                for ( CharJoin cj = this ; ; cj = (CharJoin) cj._srcLeft )
  +                {
  +                    left.add( cj );
  +                    
  +                    if (!(cj._srcLeft instanceof CharJoin))
  +                    {
  +                        if (off < cj._cchLeft)
  +                        {
  +                            int cchL = cj._cchLeft - off;
  +
  +                            if (cchL > cch)
  +                                cchL = cch;
  +
  +                            CharUtil.getString( sb, d, cj._srcLeft, cj._offLeft + off, cchL );
  +
  +                            cch -= cchL;
  +                        }
  +                        
  +                        break;
  +                    }
  +                }
  +
  +                for ( int i = left.size() - 1 ; i >= 0 ; i-- )
  +                {
  +                    if (cch <= 0)
  +                        break;
  +                    
  +                    CharJoin cj = (CharJoin) left.get( i );
  +
  +                    int cchR = cch < cj._cchRight ? cch : cj._cchRight;
  +
  +                    CharUtil.getString( sb, d, cj._srcRight, cj._offRight, cchR );
  +
  +                    cch -= cchR;
  +                }
  +            }
  +        }
  +
  +        private void getChars ( char[] chars, int start, int d, int off, int cch )
  +        {
  +            assert cch > 0;
  +
  +            if (d++ < 32)
  +            {
  +                if (off < _cchLeft)
  +                {
  +                    int cchL = _cchLeft - off;
  +
  +                    if (cchL > cch)
  +                        cchL = cch;
  +
  +                    CharUtil.getChars( chars, start, d, _srcLeft, _offLeft + off, cchL );
  +
  +                    start += cchL;
  +                    cch -= cchL;
  +                    
  +                    if (cch > 0)
  +                        CharUtil.getChars( chars, start, d, _srcRight, _offRight, cch );
  +                }
  +                else
  +                {
  +                    CharUtil.getChars(
  +                        chars, start, d, _srcRight, _offRight + off - _cchLeft, cch );
  +                }
  +            }
  +            else
  +            {
  +                ArrayList left = new ArrayList();
  +
  +                for ( CharJoin cj = this ; ; cj = (CharJoin) cj._srcLeft )
  +                {
  +                    left.add( cj );
  +
  +                    if (!(cj._srcLeft instanceof CharJoin))
  +                    {
  +                        if (off < cj._cchLeft)
  +                        {
  +                            int cchL = cj._cchLeft - off;
  +
  +                            if (cchL > cch)
  +                                cchL = cch;
  +
  +                            CharUtil.getChars(
  +                                chars, start, d, cj._srcLeft, cj._offLeft + off, cchL );
  +
  +                            start += cchL;
  +                            cch -= cchL;
  +                        }
  +
  +                        break;
  +                    }
  +                }
  +
  +                for ( int i = left.size() - 1 ; i >= 0 ; i-- )
  +                {
  +                    if (cch <= 0)
  +                        break;
  +
  +                    CharJoin cj = (CharJoin) left.get( i );
  +
  +                    int cchR = cch < cj._cchRight ? cch : cj._cchRight;
  +
  +                    CharUtil.getChars( chars, start, d, cj._srcRight, cj._offRight, cchR );
  +
  +                    start += cchR;
  +                    cch -= cchR;
  +                }
  +            }
  +        }
  +
  +        private void dumpChars( int off, int cch )
  +        {
  +            dumpChars( System.out, off, cch );
  +        }
  +        
  +        private void dumpChars( PrintStream p, int off, int cch )
  +        {
  +            p.print( "( " );
  +            CharUtil.dumpChars( p, _srcLeft, _offLeft, _cchLeft );
  +            p.print( ", " );
  +            CharUtil.dumpChars( p, _srcRight, _offRight, _cchRight );
  +            p.print( " )" );
  +        }
  +    }
  +    
  +    private CharUtil ( int charBufSize )
  +    {
  +        _charBufSize = charBufSize;
  +    }
       
       private static ThreadLocal tl_charUtil =
           new ThreadLocal() { protected Object initialValue() { return new CharUtil( 1024 * 32 ); } };
   
  -    public int _offSrc;
  -    public int _cchSrc;
  +    // Current char buffer we're allcoating new chars to
   
       private int    _charBufSize;
       private int    _currentOffset;
  
  
  
  1.26      +282 -39   xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Cur.java
  
  Index: Cur.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Cur.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Cur.java	22 Mar 2004 16:51:12 -0000	1.25
  +++ Cur.java	26 Mar 2004 23:37:27 -0000	1.26
  @@ -60,6 +60,7 @@
   
   import java.util.Iterator;
   import java.util.ArrayList;
  +import java.util.List;
   
   import org.apache.xmlbeans.impl.newstore2.Locale.LoadContext;
   
  @@ -70,8 +71,23 @@
   import org.apache.xmlbeans.impl.newstore2.DomImpl.SaajTextNode;
   import org.apache.xmlbeans.impl.newstore2.DomImpl.SaajCdataNode;
   
  +import org.apache.xmlbeans.SchemaField;
  +import org.apache.xmlbeans.SchemaType;
  +import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlCursor;
  +import org.apache.xmlbeans.XmlOptions;
  +import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.XmlException;
  +import org.apache.xmlbeans.QNameSet;
  +
  +import org.apache.xmlbeans.impl.values.TypeStore;
  +import org.apache.xmlbeans.impl.values.TypeStoreUser;
  +import org.apache.xmlbeans.impl.values.TypeStoreVisitor;
  +
   import javax.xml.namespace.QName;
   
  +import org.apache.xmlbeans.impl.common.ValidatorListener;
  +
   final class Cur
   {
       static final int TEMP = 0;
  @@ -94,10 +110,12 @@
       Cur ( Locale l )
       {
           _locale = l;
  +        _pos = -1;
       }
   
       static boolean kindIsContainer ( int t ) { return t ==  ELEM || t ==  ROOT; }
       static boolean kindIsFinish    ( int t ) { return t == -ELEM || t == -ROOT; }
  +    static boolean kindIsNode      ( int t ) { return t > 0  || t != TEXT; }
       
       int kind ( ) { assert isNormal(); return _xobj == null ? NONE : _xobj.kind( _pos ); }
   
  @@ -110,7 +128,10 @@
       boolean isProcinst  ( ) { return kind() == PROCINST; }
       
       boolean isContainer ( ) { return kindIsContainer( kind() ); }
  -    boolean isFinish    ( ) { return kindIsFinish( kind() ); }
  +    boolean isFinish    ( ) { return kindIsFinish   ( kind() ); }
  +    boolean isNode      ( ) { return kindIsNode     ( kind() ); }
  +    
  +//    boolean isTypeable  ( ) { return _xobj.isTypeable(); }
   
       boolean isDomDocRoot ( )
       {
  @@ -306,6 +327,13 @@
           return _xobj == that._xobj && _pos == that._xobj.posEnd();
       }
   
  +    boolean isAtEndOfLastPush ( )
  +    {
  +        assert _stack != null && _stack.size() > 0;
  +
  +        return isAtEndOf( (Cur) _stack.get( _stack.size() - 1 ) );
  +    }
  +
       void moveToCur ( Cur to )
       {
           assert isNormal();
  @@ -330,6 +358,8 @@
           if (_selection == null)
               _selection = new ArrayList();
   
  +        // TODO - make this more efficient ....
  +        //        Need to add call changeCallback ....
           _selection.add( permCur() );
       }
       
  @@ -664,6 +694,27 @@
           return true;
       }
       
  +    boolean nextWithAttrs ( )
  +    {
  +        int k = kind();
  +
  +        if (k == ROOT || k == ELEM)
  +        {
  +            if (toFirstAttr())
  +                return true;
  +        }
  +        else if (k == ATTR)
  +        {
  +            if (toNextAttr())
  +                return true;
  +            
  +            if (!toParentRaw())
  +                return false;
  +        }
  +        
  +        return next();
  +    }
  +    
       boolean next ( )
       {
           assert isNormal();
  @@ -1181,12 +1232,14 @@
               Xobj newXo = xo.newNode();
   
               newXo._srcValue = xo._srcValue;
  -            newXo._srcAfter = xo._srcAfter;
               newXo._offValue = xo._offValue;
  -            newXo._offAfter = xo._offAfter;
               newXo._cchValue = xo._cchValue;
  +            
  +            newXo._srcAfter = xo._srcAfter;
  +            newXo._offAfter = xo._offAfter;
               newXo._cchAfter = xo._cchAfter;
   
  +            // TODO - strange to have charNode stuff inside here .....
               newXo._charNodesValue = CharNode.copyNodes( xo._charNodesValue, newXo );
               newXo._charNodesAfter = CharNode.copyNodes( xo._charNodesAfter, newXo );
   
  @@ -1199,8 +1252,10 @@
               {
                   newParent = newXo;
                   xo = xo._firstChild;
  +                continue;
               }
  -            else if (xo._nextSibling == null)
  +            
  +            if (xo._nextSibling == null)
               {
                   do
                   {
  @@ -1217,8 +1272,8 @@
               }
               else if (xo == _xobj)
                   break walk;
  -            else
  -                xo = xo._nextSibling;
  +            
  +            xo = xo._nextSibling;
           }
   
           copy._srcAfter = null;
  @@ -1339,6 +1394,41 @@
           return x;
       }
   
  +//    boolean isInvalid ( )
  +//    {
  +//        assert isNormal() && isPositioned() && _pos == 0;
  +//
  +//        return _xobj.isInvalid();
  +//    }
  +
  +//    void setType ( SchemaType type )
  +//    {
  +//        assert isNormal() && isPositioned() && _pos == 0;
  +//        _xobj.setType( type );
  +//    }
  +    
  +//    TypeStoreUser getTypeStoreUser ( )
  +//    {
  +//        assert isNormal() && isPositioned() && _pos == 0;
  +//
  +//        return _xobj.getTypeStoreUser();
  +//    }
  +    
  +//    void setTypeStoreUser ( TypeStoreUser user )
  +//    {
  +//        assert isNormal() && isPositioned() && _pos == 0;
  +//
  +//        _xobj.setTypeStoreUser( user );
  +//    }
  +
  +//    TypeStore getTypeStore ( )
  +//    {
  +//        assert isNormal() && isPositioned();
  +//        assert isElem() || isAttr() || isRoot();
  +//
  +//        return (TypeStore) _xobj;
  +//    }
  +    
       Dom getDom ( )
       {
           assert isNormal();
  @@ -1646,7 +1736,7 @@
       //
       //
   
  -    private abstract static class Xobj
  +    private abstract static class Xobj implements TypeStore
       {
           Xobj ( Locale l, int kind, int domType )
           {
  @@ -1655,11 +1745,11 @@
                       kind == COMMENT || kind == PROCINST;
                       
               _locale = l;
  -            _bits = (domType << 8) + kind;
  +            _bits = (domType << 4) + kind;
           }
   
  -        final int kind    ( ) { return _bits & 0xFF; }
  -        final int domType ( ) { return _bits >> 8;   }
  +        final int kind    ( ) { return _bits & 0xF; }
  +        final int domType ( ) { return (_bits & 0xF0) >> 4; }
           
           final boolean isRoot      ( ) { return kind() == ROOT; }
           final boolean isAttr      ( ) { return kind() == ATTR; }
  @@ -1702,6 +1792,106 @@
           abstract Xobj newNode ( );
   
           //
  +        // 
  +        //
  +
  +//        final boolean isValid    ( ) { return (_bits & 0x100) == 0; }
  +//        final boolean isInvalid  ( ) { return (_bits & 0x100) != 0; }
  +//        final void    setValid   ( ) { _bits &= ~0x100; }
  +//        final void    setInvalid ( ) { _bits &=  0x100; }
  +
  +        final boolean isVacant   ( ) { return (_bits & 0x100) != 0; }
  +        final boolean isOccupied ( ) { return (_bits & 0x100) == 0; }
  +
  +        final void fillVacancy ( )
  +        {
  +            assert isOccupied();
  +
  +            throw new RuntimeException( "Not implemented" );
  +        }
  +
  +        final void vacate ( )
  +        {
  +            if (isOccupied())
  +            {
  +                throw new RuntimeException( "Not implemented" );
  +            }
  +        }
  +
  +//        static void setType ( SchemaType type )
  +//        {
  +//            TypeStoreUser user = getTypeStoreUser();
  +//
  +//            if (user == null || user.get_schema_type() == type)
  +//            {
  +//                if (c.isRoot())
  +//                {
  +//                    disconnectTree();
  +//                    setTypeStoreUser( ((TypeStoreUserFactory) type).createTypeStoreUser() );
  +//                }
  +//                else
  +//                    throw new RuntimeException( "Not impl" );
  +//            }
  +//        }
  +//
  +//        private static void disconnectTree ( )
  +//        {
  +//            // Disconnect all type store uses in this tree.  If there is no
  +//            // user at the top, then there can be no children.
  +//
  +//            // TODO - make not recursive
  +//            if (getTypeStoreUser() != null)
  +//            {
  +//                setTypeStoreUserLocal( null );
  +//
  +//                for ( Xobj x = _firstChild ; x != null ; x = x._nextSibling )
  +//                    disconnectTree( x );
  +//            }
  +//        }
  +    
  +        final TypeStoreUser getTypeStoreUser ( )
  +        {
  +            // Don't assert isNormal() here ... infinite recursion
  +            return _user;
  +        }
  +        
  +//        private final void setTypeStoreUserHelper ( TypeStoreUser user )
  +//        {
  +//            assert isValid();
  +//            _user = user;
  +//        }
  +
  +        // Just set the local user without dealing with disconnecting
  +        // children...
  +        void setTypeStoreUserLocal ( TypeStoreUser newUser )
  +        {
  +//            assert isNormal( 0 );
  +//            
  +//            if (isInvalid())
  +//            {
  +//                assert _cchValue == 0;
  +//
  +//                TypeStoreUser oldUser = getTypeStoreUser();
  +//
  +//                String newValue = oldUser.build_text( this );
  +//
  +//                setValid();
  +//
  +//                oldUser.disconnect_store();
  +//
  +//                Cur c = tempCur();
  +//                c.next();
  +//                c.insertChars( newValue, 0, newValue.length() );
  +//                c.release();
  +//            }
  +//
  +//            setTypeStoreUserHelper( newUser );
  +//
  +//            if (newUser != null)
  +//                newUser.attach_store( this );
  +        }
  +        
  +        //
           // Dom interface
           //
   
  @@ -1723,7 +1913,9 @@
           //
           //
           //
  -        
  +
  +        // TODO - should be able to have Cur's which are not pointing
  +        // at text not be on either list.
           Cur getEmbedded ( )
           {
               Cur c = _locale._unembedded;
  @@ -1767,21 +1959,28 @@
                   return false;
   
               if (isRoot())
  -                return p <= posEnd();
  -
  -            if (!isAttr())
  -                return p < posMax();
  -
  -            if (p <= posEnd())
  -                return true;
  +            {
  +                if (p > posEnd())
  +                    return false;
  +            }
  +            else if (!isAttr())
  +            {
  +                if (p >= posMax())
  +                    return false;
  +            }
  +            else if (p > posEnd())
  +            {
  +                if (_cchAfter == 0)
  +                    return false;
   
  -            if (_cchAfter == 0)
  -                return false;
  +                if (_nextSibling != null && _nextSibling.isAttr())
  +                    return false;
   
  -            if (_nextSibling != null && _nextSibling.isAttr())
  -                return false;
  +                if (_parent == null || !(_parent.isRoot() || _parent.kind() == ELEM))
  +                    return false;
  +            }
   
  -            if (_parent == null || !(_parent.isRoot() || _parent.kind() == ELEM))
  +            if (isVacant() && (_cchAfter != 0 || getTypeStoreUser() == null))
                   return false;
   
               return true;
  @@ -1907,32 +2106,76 @@
               
               return src;
           }
  +
  +        //
  +        // TypeStore
  +        //
  +        
  +        public boolean is_attribute ( ) { return isAttr(); }
  +        public boolean validate_on_set ( ) { return _locale._validateOnSet; }
  +        public void invalidate_text ( ) { vacate(); }
  +        
  +        public XmlCursor new_cursor ( ) { return TypeImpl.typeStore_new_cursor( this ); }
  +        public void validate ( ValidatorListener vEventSink ) { TypeImpl.typeStore_validate( this, vEventSink ); }
  +        public SchemaTypeLoader get_schematypeloader ( ) { return TypeImpl.typeStore_get_schematypeloader( this ); }
  +        public TypeStoreUser change_type ( SchemaType sType ) { return TypeImpl.typeStore_change_type( this, sType ); }
  +        public QName get_xsi_type ( ) { return TypeImpl.typeStore_get_xsi_type( this ); }
  +        public String fetch_text ( int whitespaceRule ) { return TypeImpl.typeStore_fetch_text( this, whitespaceRule ); }
  +        public void store_text ( String text ) { TypeImpl.typeStore_store_text( this, text ); }
  +        public String compute_default_text ( ) { return TypeImpl.typeStore_compute_default_text( this ); }
  +        public int compute_flags ( ) { return TypeImpl.typeStore_compute_flags( this ); }
  +        public SchemaField get_schema_field ( ) { return TypeImpl.typeStore_get_schema_field( this ); }
  +        public void invalidate_nil ( ) { TypeImpl.typeStore_invalidate_nil( this ); }
  +        public boolean find_nil ( ) { return TypeImpl.typeStore_find_nil( this ); }
  +        public int count_elements ( QName name ) { return TypeImpl.typeStore_count_elements( this, name ); }
  +        public int count_elements ( QNameSet names ) { return TypeImpl.typeStore_count_elements( this, names ); }
  +        public TypeStoreUser find_element_user ( QName name, int i ) { return TypeImpl.typeStore_find_element_user( this, name, i ); }
  +        public TypeStoreUser find_element_user ( QNameSet names, int i ) { return TypeImpl.typeStore_find_element_user( this, names, i ); }
  +        public void find_all_element_users ( QName name, List fillMeUp ) { TypeImpl.typeStore_find_all_element_users( this, name, fillMeUp ); }
  +        public void find_all_element_users ( QNameSet name, List fillMeUp ) { TypeImpl.typeStore_find_all_element_users( this, name, fillMeUp ); }
  +        public TypeStoreUser insert_element_user ( QName name, int i ) { return TypeImpl.typeStore_insert_element_user( this, name, i ); }
  +        public TypeStoreUser insert_element_user ( QNameSet set, QName name, int i ) { return TypeImpl.typeStore_insert_element_user( this, set, name, i ); }
  +        public TypeStoreUser add_element_user ( QName name ) { return TypeImpl.typeStore_add_element_user( this, name ); }
  +        public void remove_element ( QName name, int i ) { TypeImpl.typeStore_remove_element( this, name, i ); }
  +        public void remove_element ( QNameSet names, int i ) { TypeImpl.typeStore_remove_element( this, names, i ); }
  +        public TypeStoreUser find_attribute_user ( QName name ) { return TypeImpl.typeStore_find_attribute_user( this, name ); }
  +        public TypeStoreUser add_attribute_user ( QName name ) { return TypeImpl.typeStore_add_attribute_user( this, name ); }
  +        public void remove_attribute ( QName name ) { TypeImpl.typeStore_remove_attribute( this, name ); }
  +        public TypeStoreUser copy_contents_from ( TypeStore source ) { return TypeImpl.typeStore_copy_contents_from( this, source ); }
  +        public void array_setter ( XmlObject[] sources, QName elementName ) { TypeImpl.typeStore_array_setter( this, sources, elementName ); }
  +        public void visit_elements ( TypeStoreVisitor visitor ) { TypeImpl.typeStore_visit_elements( this, visitor ); }
  +        public XmlObject[] exec_query ( String queryExpr, XmlOptions options ) throws XmlException { return TypeImpl.typeStore_exec_query( this, queryExpr, options ); }
  +        public Object get_root_object ( ) { return TypeImpl.typeStore_get_root_object( this ); }
  +        public String find_prefix_for_nsuri ( String nsuri, String suggested_prefix ) { return TypeImpl.typeStore_find_prefix_for_nsuri( this, nsuri, suggested_prefix ); }
  +        public String getNamespaceForPrefix ( String prefix ) { return TypeImpl.typeStore_getNamespaceForPrefix( this, prefix ); }
           
           //
           //
           //
   
           Locale _locale;
  +        QName _name;
   
  -        Cur _embedded;
  +        private Cur _embedded;
           
  -        int _bits;
  +        private int _bits;
   
  -        QName _name;
  +        private Xobj _parent;
  +        private Xobj _nextSibling;
  +        private Xobj _prevSibling;
  +        private Xobj _firstChild;
  +        private Xobj _lastChild;
  +        
  +        private Object _srcValue, _srcAfter;
  +        private int    _offValue, _offAfter;
  +        private int    _cchValue, _cchAfter;
   
  -        Xobj _parent;
  -        Xobj _nextSibling;
  -        Xobj _prevSibling;
  -        Xobj _firstChild;
  -        Xobj _lastChild;
  -        
  -        Object _srcValue, _srcAfter;
  -        int    _offValue, _offAfter;
  -        int    _cchValue, _cchAfter;
  +        // TODO - put this in a ptr off this node
  +        private CharNode _charNodesValue;
  +        private CharNode _charNodesAfter;
   
           // TODO - put this in a ptr off this node
  -        CharNode _charNodesValue;
  -        CharNode _charNodesAfter;
  +        private TypeStoreUser _user;
       }
   
       private abstract static class NodeXobj extends Xobj implements Dom, Node, NodeList
  @@ -2656,8 +2899,8 @@
   
       Locale _locale;
       
  -    Xobj _xobj;
  -    int _pos;
  +    private Xobj _xobj;
  +    private int _pos;
   
       int _state;
       int _curKind;
  
  
  
  1.27      +27 -52    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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- DomImpl.java	22 Mar 2004 16:51:12 -0000	1.26
  +++ DomImpl.java	26 Mar 2004 23:37:27 -0000	1.27
  @@ -1615,70 +1615,45 @@
               case ATTR :
                   break;
           }
  -        
  -        Cur end = n.tempCur();
  -        end.toEnd();
   
           Cur c = n.tempCur();
   
  -        ;
  -        
  -        for ( boolean justSawText = false ; !c.isSamePos( end ) ; justSawText = c.isText() )
  -        {
  -            if (c.isContainer() && c.toFirstAttr())
  -            {
  -                do
  -                {
  -                    c.next();
  -                    normalizeTextNodes( c );
  -                    c.toParent();
  -                }
  -                while ( c.toNextAttr() );
  +        c.push();
   
  -                c.toParent();
  -            }
  -            
  -            c.next();
  -
  -            if (!justSawText)
  -                normalizeTextNodes( c );
  -        }
  -
  -        c.release();
  -        end.release();
  -    }
  -
  -    private static void normalizeTextNodes ( Cur c )
  -    {
  -        CharNode cn = c.getCharNodes();
  -
  -        if (cn != null)
  +        for ( c.nextWithAttrs() ; ! c.isAtEndOfLastPush() ; c.nextWithAttrs() )
           {
  -            if (!c.isText())
  +            CharNode cn = c.getCharNodes();
  +
  +            if (cn != null)
               {
  -                while ( cn != null )
  +                if (!c.isText())
                   {
  -                    cn._src = null;
  -                    cn._off = 0;
  -                    cn._cch = 0;
  -                    
  -                    cn = CharNode.remove( cn, cn );
  +                    while ( cn != null )
  +                    {
  +                        cn._src = null;
  +                        cn._off = 0;
  +                        cn._cch = 0;
  +
  +                        cn = CharNode.remove( cn, cn );
  +                    }
                   }
  -            }
  -            else if (cn._next != null)
  -            {
  -                while ( cn._next != null )
  +                else if (cn._next != null)
                   {
  -                    cn._src = null;
  -                    cn._off = 0;
  -                    cn._cch = 0;
  -                    
  -                    cn = CharNode.remove( cn, cn._next );
  +                    while ( cn._next != null )
  +                    {
  +                        cn._src = null;
  +                        cn._off = 0;
  +                        cn._cch = 0;
  +
  +                        cn = CharNode.remove( cn, cn._next );
  +                    }
                   }
  +
  +                c.setCharNodes( cn );
               }
  -            
  -            c.setCharNodes( cn );
           }
  +        
  +        c.release();
       }
   
       //////////////////////////////////////////////////////////////////////////////////////
  
  
  
  1.8       +7 -9      xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Jsr173.java
  
  Index: Jsr173.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Jsr173.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Jsr173.java	23 Mar 2004 23:57:13 -0000	1.7
  +++ Jsr173.java	26 Mar 2004 23:37:27 -0000	1.8
  @@ -829,13 +829,6 @@
           }
   
   
  -        public NamespaceContext getNamespaceContext ( )
  -        {
  -            checkChanged();
  -
  -            return this;
  -        }
  -
           public Object getProperty ( String name )
           {
               checkChanged();
  @@ -920,6 +913,11 @@
           public String getPublicId() { return null; }
           public String getSystemId() { return null; }
   
  +        public NamespaceContext getNamespaceContext ( )
  +        {
  +            throw new RuntimeException( "This version of getNamespaceContext should not be called");
  +        }
  +
           public String getNamespaceURI ( String prefix )
           {
               checkChanged();
  @@ -1145,7 +1143,7 @@
           public int getNamespaceCount ( ) { synchronized ( _l ) { _l.enter(); try { return _xs.getNamespaceCount(); } finally { _l.exit(); } } }
           public String getNamespacePrefix ( int index ) { synchronized ( _l ) { _l.enter(); try { return _xs.getNamespacePrefix ( index ); } finally { _l.exit(); } } }
           public String getNamespaceURI ( int index ) { synchronized ( _l ) { _l.enter(); try { return _xs.getNamespaceURI ( index ); } finally { _l.exit(); } } }
  -        public NamespaceContext getNamespaceContext ( ) { synchronized ( _l ) { _l.enter(); try { return _xs.getNamespaceContext(); } finally { _l.exit(); } } }
  +        public NamespaceContext getNamespaceContext ( ) { return this; }
           public int getEventType ( ) { synchronized ( _l ) { _l.enter(); try { return _xs.getEventType(); } finally { _l.exit(); } } }
           public String getText ( ) { synchronized ( _l ) { _l.enter(); try { return _xs.getText(); } finally { _l.exit(); } } }
           public char[] getTextCharacters ( ) { synchronized ( _l ) { _l.enter(); try { return _xs.getTextCharacters(); } finally { _l.exit(); } } }
  @@ -1207,7 +1205,7 @@
           public int getNamespaceCount ( ) { try { _l.enter(); return _xs.getNamespaceCount(); } finally { _l.exit(); } }
           public String getNamespacePrefix ( int index ) { try { _l.enter(); return _xs.getNamespacePrefix ( index ); } finally { _l.exit(); } }
           public String getNamespaceURI ( int index ) { try { _l.enter(); return _xs.getNamespaceURI ( index ); } finally { _l.exit(); } }
  -        public NamespaceContext getNamespaceContext ( ) { try { _l.enter(); return _xs.getNamespaceContext(); } finally { _l.exit(); } }
  +        public NamespaceContext getNamespaceContext ( ) { return this; }
           public int getEventType ( ) { try { _l.enter(); return _xs.getEventType(); } finally { _l.exit(); } }
           public String getText ( ) { try { _l.enter(); return _xs.getText(); } finally { _l.exit(); } }
           public char[] getTextCharacters ( ) { try { _l.enter(); return _xs.getTextCharacters(); } finally { _l.exit(); } }
  
  
  
  1.14      +3 -3      xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Locale.java
  
  Index: Locale.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Locale.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Locale.java	22 Mar 2004 16:51:12 -0000	1.13
  +++ Locale.java	26 Mar 2004 23:37:27 -0000	1.14
  @@ -444,7 +444,6 @@
               c = new Cur( this );
               c._state = Cur.POOLED;
               c._tempFrame = -1;
  -            c._pos = -1;
           }
           else
           {
  @@ -454,8 +453,7 @@
           }
   
           assert c._prev == null && c._next == null;
  -        assert c._xobj == null;
  -        assert c._pos == -1;
  +        assert !c.isPositioned();
           assert c._obj == null;
                   
           c._curKind = curKind;
  @@ -1143,4 +1141,6 @@
       Dom _ownerDoc;
   
       QNameFactory _qnameFactory;
  +
  +    boolean _validateOnSet;
   }
  
  
  
  1.10      +6 -3      xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Public2.java
  
  Index: Public2.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Public2.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Public2.java	22 Mar 2004 16:51:12 -0000	1.9
  +++ Public2.java	26 Mar 2004 23:37:27 -0000	1.10
  @@ -25,6 +25,7 @@
   
   import org.apache.xmlbeans.XmlCursor;
   import org.apache.xmlbeans.XmlOptions;
  +import org.apache.xmlbeans.XmlObject;
   
   import java.io.PrintStream;
   
  @@ -252,9 +253,11 @@
   
           c.dump();
   
  -        c.next();
  -        c.next();
  -        c.next();
  +//        c.setType( XmlObject.type );
  +
  +//        TypeStore store = c.getTypeStore();
  +
  +//        store.invalidate_text();
   
           c.dump();
           
  
  
  
  1.1                  xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/TypeImpl.java
  
  Index: TypeImpl.java
  ===================================================================
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  
  package org.apache.xmlbeans.impl.newstore2;
  
  import org.apache.xmlbeans.impl.values.TypeStore;
  import org.apache.xmlbeans.impl.values.TypeStoreUser;
  import org.apache.xmlbeans.impl.values.TypeStoreVisitor;
  import org.apache.xmlbeans.impl.values.TypeStoreUserFactory;
  
  import org.apache.xmlbeans.SchemaField;
  import org.apache.xmlbeans.SchemaType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlCursor;
  import org.apache.xmlbeans.XmlOptions;
  import org.apache.xmlbeans.XmlObject;
  import org.apache.xmlbeans.XmlException;
  import org.apache.xmlbeans.QNameSet;
  
  import java.util.List;
  
  import javax.xml.namespace.QName;
  
  import org.apache.xmlbeans.impl.common.ValidatorListener;
  
  final class TypeImpl
  {
  //    static void setType ( Cur c, SchemaType type )
  //    {
  //        assert c.isTypeable();
  //
  //        TypeStoreUser user = c.getTypeStoreUser();
  //
  //        if (user != null && user.get_schema_type() == type)
  //            return;
  //
  //        if (c.isRoot())
  //        {
  //            disconnectTree( c );
  //            c.setTypeStoreUser( ((TypeStoreUserFactory) type).createTypeStoreUser() );
  //            return;
  //        }
  //        
  //        throw new RuntimeException( "Not impl" );
  //    }
  
  //    private static void disconnectTree ( Cur c )
  //    {
  //        assert c.isTypeable();
  //        
  //        // Disconnect all type store uses in this tree.  If there is no
  //        // user at the top, then there can be no children.
  //
  //        for ( c.push() ; ! c.isAtEndOfLastPush() || !c.pop() ; )
  //        {
  //            if (!c.isNode())
  //                c.next();
  //            else if (c.getTypeStoreUser() != null)
  //            {
  //                c.setTypeStoreUser( null );
  //                c.nextWithAttrs();
  //            }
  //            else
  //                c.toEnd();
  //        }
  //    }
      
      public static void typeStore_invalidate_text ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static XmlCursor typeStore_new_cursor ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_validate ( TypeStore typeStore, ValidatorListener vEventSink )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static SchemaTypeLoader typeStore_get_schematypeloader ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_change_type ( TypeStore typeStore, SchemaType sType )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static QName typeStore_get_xsi_type ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static String typeStore_fetch_text ( TypeStore typeStore, int whitespaceRule )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_store_text ( TypeStore typeStore, String text )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static String typeStore_compute_default_text ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static int typeStore_compute_flags ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static boolean typeStore_validate_on_set ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static SchemaField typeStore_get_schema_field ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_invalidate_nil ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static boolean typeStore_find_nil ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static int typeStore_count_elements ( TypeStore typeStore, QName name )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static int typeStore_count_elements ( TypeStore typeStore, QNameSet names )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_find_element_user ( TypeStore typeStore, QName name, int i )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_find_element_user ( TypeStore typeStore, QNameSet names, int i )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_find_all_element_users ( TypeStore typeStore, QName name, List fillMeUp )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_find_all_element_users ( TypeStore typeStore, QNameSet name, List fillMeUp )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_insert_element_user ( TypeStore typeStore, QName name, int i )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_insert_element_user ( TypeStore typeStore, QNameSet set, QName name, int i )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_add_element_user ( TypeStore typeStore, QName name )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_remove_element ( TypeStore typeStore, QName name, int i )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_remove_element ( TypeStore typeStore, QNameSet names, int i )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_find_attribute_user ( TypeStore typeStore, QName name )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_add_attribute_user ( TypeStore typeStore, QName name )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_remove_attribute ( TypeStore typeStore, QName name )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static TypeStoreUser typeStore_copy_contents_from ( TypeStore typeStore, TypeStore source )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_array_setter ( TypeStore typeStore, XmlObject[] sources, QName elementName )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static void typeStore_visit_elements ( TypeStore typeStore, TypeStoreVisitor visitor )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static XmlObject[] typeStore_exec_query ( TypeStore typeStore, String queryExpr, XmlOptions options ) throws XmlException
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static Object typeStore_get_root_object ( TypeStore typeStore )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
  
      public static String typeStore_find_prefix_for_nsuri ( TypeStore typeStore, String nsuri, String suggested_prefix )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
      
      public static String typeStore_getNamespaceForPrefix ( TypeStore typeStore, String prefix )
      {
          throw new RuntimeException( "Not implemeneted" );
      }
  }
  
  
  1.11      +0 -4      xml-xmlbeans/v2/src/xmlstore/org/apache/xmlbeans/impl/store/Root.java
  
  Index: Root.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlstore/org/apache/xmlbeans/impl/store/Root.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Root.java	22 Mar 2004 16:51:12 -0000	1.10
  +++ Root.java	26 Mar 2004 23:37:27 -0000	1.11
  @@ -24,7 +24,6 @@
   import org.apache.xmlbeans.impl.store.Splay.Finish;
   import org.apache.xmlbeans.impl.values.NamespaceManager;
   import org.apache.xmlbeans.impl.values.XmlStore;
  -import org.apache.xmlbeans.impl.values.TypeStoreFactory;
   import org.apache.xmlbeans.QNameCache;
   import org.apache.xmlbeans.QNameSet;
   import org.apache.xmlbeans.SchemaType;
  @@ -116,8 +115,6 @@
   
           _validateOnSet = options.hasOption( XmlOptions.VALIDATE_ON_SET );
   
  -        _factory = (TypeStoreFactory) options.get( TypeStoreFactory.KEY );
  -
           _doc.setType( this, sType );
       }
   
  @@ -3626,5 +3623,4 @@
   
       nthCache _nthCache_A = new nthCache();
       nthCache _nthCache_B = new nthCache();
  -    TypeStoreFactory _factory;
   }
  
  
  
  1.4       +2 -17     xml-xmlbeans/v2/src/xmlstore/org/apache/xmlbeans/impl/store/Type.java
  
  Index: Type.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlstore/org/apache/xmlbeans/impl/store/Type.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Type.java	12 Feb 2004 20:06:30 -0000	1.3
  +++ Type.java	26 Mar 2004 23:37:27 -0000	1.4
  @@ -100,27 +100,12 @@
       
       TypeStoreUser create_element_user ( QName eltName, QName xsiType )
       {
  -        TypeStoreUser ret = null;
  -        if (getRoot()._factory != null)
  -            ret = getRoot()._factory.createElementUser(get_schema_type(), eltName, xsiType);
  -
  -        if (ret == null)
  -            ret = _user.create_element_user( eltName, xsiType );
  -
  -        return ret;
  +        return _user.create_element_user( eltName, xsiType );
       }
               
       TypeStoreUser create_attribute_user( QName attrName )
       {
  -        TypeStoreUser ret = null;
  -
  -        if (getRoot()._factory != null)
  -            ret = getRoot()._factory.createAttributeUser(get_schema_type(),  attrName);
  -
  -        if (ret == null)
  -            ret = _user.create_attribute_user( attrName );
  -
  -        return ret;
  +        return _user.create_attribute_user( attrName );
       }
   
       XmlObject getXmlObject ( )
  
  
  
  1.3       +8 -16     xml-xmlbeans/v2/test/src/ericschema/ericschema.xsd
  
  Index: ericschema.xsd
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/ericschema/ericschema.xsd,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ericschema.xsd	17 Mar 2004 05:43:15 -0000	1.2
  +++ ericschema.xsd	26 Mar 2004 23:37:28 -0000	1.3
  @@ -1,16 +1,8 @@
  -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  -	<xs:element name="Elem">
  -		<xs:complexType>
  -  		  <xs:sequence>
  -            <xs:element name="Field">
  -              <xs:simpleType>
  -                <xs:restriction base="xs:string">
  -                    <xs:enumeration value="abc" />
  -                    <xs:enumeration value="xyz" />
  -                </xs:restriction>
  -              </xs:simpleType>
  -            </xs:element>
  -  		  </xs:sequence>
  -		</xs:complexType>
  -	</xs:element>
  -</xs:schema>
  +<?xml version="1.0" encoding="UTF-8"?>
  +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:nfi="http://nfis.org/nfi" targetNamespace="http://nfis.org/nfi">
  +  <element name="top_element">
  +    <complexType>
  +      <attribute name="top_attr" type="string" fixed="top attribute" use="required"/>
  +    </complexType>
  +  </element>
  +</schema>
  
  
  
  1.42      +9 -21     xml-xmlbeans/v2/test/src/erictest/EricTest.java
  
  Index: EricTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/erictest/EricTest.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- EricTest.java	22 Mar 2004 16:51:12 -0000	1.41
  +++ EricTest.java	26 Mar 2004 23:37:28 -0000	1.42
  @@ -29,6 +29,7 @@
   import org.apache.xmlbeans.SchemaType;
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.SchemaTypeSystem;
  +import org.apache.xmlbeans.SchemaGlobalElement;
   import org.apache.xmlbeans.XmlBeans;
   import org.apache.xmlbeans.XmlCursor.TokenType;
   import org.apache.xmlbeans.XmlCursor.XmlBookmark;
  @@ -103,37 +104,24 @@
   
   import org.apache.xmlbeans.impl.newstore2.Public2;
   
  -import noNamespace.*;
  -import noNamespace.ElemDocument.Elem;
  +import org.nfis.nfi.*;
  +import org.nfis.nfi.TopElementDocument.*;
   
   public class EricTest
   {
       public static void main ( String[] args ) throws Exception
       {
  -        Document doc = Public2.parse( "<a x='y'/>" );
  +        Public2.parse( "<xml-fragment><b><c/></b><d/></xml-fragment>" ).cloneNode( true );
   
  -        Element e = doc.getDocumentElement();
  -
  -        Public2.dump( e.cloneNode( false ) );
  -        
           
  -//        XmlOptions options = new XmlOptions();
  -//        options.setValidateOnSet();
  +//        XmlCursor c = Public2.newStore();
   //
  -//        Elem e = Elem.Factory.newInstance();
  +//        c.toNextToken();
   //
  -//        System.out.println( e.getField() );
  +//        c.beginElement( "foo" );
  +//        c.toStartDoc();
   //
  -//        try
  -//        {
  -//            e.setField( null );
  -//        }
  -//        catch ( Throwable ee )
  -//        {
  -//            ee.printStackTrace( System.out );
  -//        }
  -//        
  -//        System.out.println( e.getField() );
  +//        Public2.test( c.getDomNode() );
       }
   }
   
  
  
  

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


Mime
View raw message