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 Wed, 17 Mar 2004 22:44:31 GMT
ericvas     2004/03/17 14:44:31

  Modified:    v2/src/newstore2/org/apache/xmlbeans/impl/newstore2 Cur.java
                        Cursor.java Locale.java Saver.java
               v2/src/xmlpublic/org/apache/xmlbeans QNameCache.java
               v2/test/src/erictest EricTest.java
  Added:       v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
                        QNameFactory.java
  Log:
  toFirstChild implemented
  
  Revision  Changes    Path
  1.24      +10 -16    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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Cur.java	16 Mar 2004 21:57:42 -0000	1.23
  +++ Cur.java	17 Mar 2004 22:44:31 -0000	1.24
  @@ -122,11 +122,6 @@
           return isRoot() && _xobj instanceof DocumentFragXobj;
       }
   
  -//    boolean isNonDomRoot ( )
  -//    {
  -//        return isRoot() && _xobj instanceof RootXobj;
  -//    }
  -
       private int cchRight ( )
       {
           assert _xobj != null &&  isNormal();
  @@ -148,7 +143,6 @@
       void createRoot ( )
       {
           createDomDocFragRoot();
  -//        set( new RootXobj( _locale ), 0 );
       }
       
       void createDomDocFragRoot ( )
  @@ -379,6 +373,16 @@
           _stack.add( permCur() );
       }
   
  +    void popButStay ( )
  +    {
  +        if (_stack == null || _stack.size() == 0)
  +            return;
  +        
  +        Cur c = (Cur) _stack.remove( _stack.size() - 1 );
  +
  +        c.release();
  +    }
  +    
       boolean pop ( )
       {
           if (_stack == null || _stack.size() == 0)
  @@ -1742,7 +1746,6 @@
           {
               assert _parent != null || (!isRoot() && cchAfter() == 0);
               return _parent == null ? new DocumentFragXobj( _locale ).appendXobj( this )
: _parent;
  -//            return _parent == null ? new RootXobj( _locale ).appendXobj( this ) : _parent;
           }
   
           final int cchRight ( int p )
  @@ -1924,15 +1927,6 @@
           CharNode _charNodesValue;
           CharNode _charNodesAfter;
       }
  -
  -//    private static class RootXobj extends Xobj
  -//    {
  -//        RootXobj ( Locale l ) { super( l, ROOT, 0 ); }
  -//        
  -//        Dom getDom ( ) { throw new IllegalStateException(); }
  -//        
  -//        Xobj newNode ( ) { return new RootXobj( _locale ); }
  -//    }
   
       private abstract static class NodeXobj extends Xobj implements Dom, Node, NodeList
       {
  
  
  
  1.12      +25 -29    xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Cursor.java
  
  Index: Cursor.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Cursor.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Cursor.java	16 Mar 2004 21:57:42 -0000	1.11
  +++ Cursor.java	17 Mar 2004 22:44:31 -0000	1.12
  @@ -361,21 +361,6 @@
           return _locale;
       }
       
  -    public boolean _toFirstChild ( )
  -    {
  -        throw new RuntimeException( "Not implemented" );
  -//        Cur c = _cur.tempCur();
  -//
  -//        if (!c.toNearestContainer() || !c.toFirstChildElem())
  -//            return false;
  -//
  -//        _cur.moveToCur( c );
  -//
  -//        c.release();
  -//
  -//        return true;
  -    }
  -
       public boolean _toParent ( )
       {
           Cur c = _cur.tempCur();
  @@ -390,15 +375,10 @@
           return true;
       }
   
  -
  -
  -
  -
  -    
  -
       public XmlDocumentProperties _documentProperties ( )
       {
           throw new RuntimeException( "Not implemented" );
  +//        _cur.
       }
       
       public XMLStreamReader _newXMLStreamReader ( )
  @@ -715,29 +695,45 @@
           throw new RuntimeException( "Not implemented" );
       }
       
  -    public boolean _toChild ( String name )
  +    public boolean _toFirstChild ( )
       {
  -        throw new RuntimeException( "Not implemented" );
  +        if (!Locale.pushToContainer( _cur ))
  +            return false;
  +
  +        if (!_cur.hasChildren() || (_cur.next() && !_cur.isElem() && !_toNextSibling()))
  +        {
  +            _cur.pop();
  +            return false;
  +        }
  +
  +        _cur.popButStay();
  +
  +        return true;
       }
  -    
  -    public boolean _toChild ( String namespace, String name )
  +
  +    public boolean _toChild ( String local )
       {
  -        throw new RuntimeException( "Not implemented" );
  +        return Locale.toChild( _cur, null, local, 0 );
       }
       
       public boolean _toChild ( QName name )
       {
  -        throw new RuntimeException( "Not implemented" );
  +        return Locale.toChild( _cur, name, 0 );
  +    }
  +    
  +    public boolean _toChild ( String namespace, String local )
  +    {
  +        return Locale.toChild( _cur, namespace, local, 0 );
       }
       
       public boolean _toChild ( int index )
       {
  -        throw new RuntimeException( "Not implemented" );
  +        return Locale.toChild( _cur, null, null, index );
       }
       
       public boolean _toChild ( QName name, int index )
       {
  -        throw new RuntimeException( "Not implemented" );
  +        return Locale.toChild( _cur, name.getNamespaceURI(), name.getLocalPart(), index
);
       }
       
       public boolean _toNextSibling ( String name )
  
  
  
  1.12      +306 -27   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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Locale.java	16 Mar 2004 01:50:55 -0000	1.11
  +++ Locale.java	17 Mar 2004 22:44:31 -0000	1.12
  @@ -27,6 +27,8 @@
   import org.xml.sax.XMLReader;
   import org.xml.sax.SAXException;
   
  +import java.util.HashMap;
  +
   import java.lang.ref.ReferenceQueue;
   import java.lang.ref.Reference;
   import java.lang.ref.PhantomReference;
  @@ -57,6 +59,9 @@
   import org.apache.xmlbeans.impl.newstore2.DomImpl.SaajTextNode;
   import org.apache.xmlbeans.impl.newstore2.DomImpl.SaajCdataNode;
   
  +import org.apache.xmlbeans.QNameSet;
  +import org.apache.xmlbeans.QNameCache;
  +import org.apache.xmlbeans.XmlBeans;
   import org.apache.xmlbeans.XmlError;
   import org.apache.xmlbeans.XmlRuntimeException;
   import org.apache.xmlbeans.XmlDocumentProperties;
  @@ -65,6 +70,14 @@
   
   final class Locale implements DOMImplementation, SaajCallback
   {
  +    static final int NONE     = Cur.NONE;
  +    static final int ROOT     = Cur.ROOT;
  +    static final int ELEM     = Cur.ELEM;
  +    static final int ATTR     = Cur.ATTR;
  +    static final int COMMENT  = Cur.COMMENT;
  +    static final int PROCINST = Cur.PROCINST;
  +    static final int TEXT     = Cur.TEXT;
  +
       static final String _xsi         = "http://www.w3.org/2001/XMLSchema-instance";
       static final String _schema      = "http://www.w3.org/2001/XMLSchema";
       static final String _openFragUri = "http://www.openuri.org/fragment";
  @@ -75,57 +88,282 @@
       static final QName _xsiType         = new QName( _xsi, "type" );
       static final QName _openuriFragment = new QName( _openFragUri, "fragment" );
       static final QName _xmlFragment     = new QName( "xml-fragment" );
  +
  +    // TODO (ericvas ) - have a qname factory here so that the same factory may be
  +    // used by the parser.  This factory would probably come from my
  +    // high speed parser.  Otherwise, use a thread local one
       
  -    Locale ( )
  +    QName makeQName ( String uri, String localPart )
       {
  -        _noSync = true;
  -        _tempFrames = new Cur [ _numTempFramesLeft = 8 ];
  -        _charUtil = CharUtil.getThreadLocalCharUtil();
  +        assert localPart != null && localPart.length() > 0;
  +        // TODO - make sure name is a well formed name?
  +
  +        return _qnameFactory.getQName( uri, localPart );
       }
   
  -    static XmlDocumentProperties getDocProps ( Cur c )
  +    QName makeQName ( String uri, String local, String prefix )
       {
  -        Cur cRoot = c.tempCur();
  +        return _qnameFactory.getQName( uri, local, prefix == null ? "" : prefix );
  +    }
  +
  +    QName makeQualifiedQName ( String uri, String qname )
  +    {
  +        if (qname == null)
  +            qname = "";
  +
  +        int i = qname.indexOf( ':' );
  +
  +        return i < 0
  +            ? _qnameFactory.getQName( uri, qname )
  +            : _qnameFactory.getQName( uri, qname.substring( i + 1 ), qname.substring( 0,
i ) );
  +    }
   
  -        while ( cRoot.toParent() )
  +    static XmlDocumentProperties getDocProps ( Cur c, boolean ensure )
  +    {
  +        c.push();
  +
  +        while ( c.toParent() )
               ;
   
           XmlDocumentProperties props =
  -            (XmlDocumentProperties) cRoot.getBookmark( XmlDocumentProperties.class );
  +            (XmlDocumentProperties) c.getBookmark( XmlDocumentProperties.class );
  +
  +//        if (props == null)
  +//        {
  +//            props = new XmlDocumentProperties
  +//        }
   
  -        cRoot.release();
  +        c.pop();
   
           return props;
       }
   
  -    long version ( )
  +    static boolean pushToContainer ( Cur c )
       {
  -        return _versionAll;
  -    }
  +        if (c.isContainer())
  +            return true;
   
  -    QName makeQName ( String uri, String localPart )
  -    {
  -        assert localPart != null && localPart.length() > 0;
  -        // TODO - make sure name is a well formed name?
  +        c.push();
  +
  +        boolean move = false;
  +
  +        if (c.isAttr())
  +        {
  +            c.toParent();
  +            c.next();
  +        }
  +
  +        loop:
  +        for ( ; ; )
  +        {
  +            assert c.isContainer() || c.isFinish() || c.isComment() || c.isProcinst() ||
c.isText();
  +            
  +            switch ( c.kind() )
  +            {
  +            case ROOT :
  +            case ELEM :
  +                move = true;
  +                break loop;
  +
  +            case - ROOT :
  +            case - ELEM :
  +                break loop;
  +
  +            case COMMENT :
  +            case PROCINST :
  +                c.toEnd();
  +                // Fall thru
  +
  +            default :
  +                c.next();
  +                break;
  +            }
  +        }
  +
  +        if (move)
  +            return true;
  +
  +        c.pop();
   
  -        return new QName( uri, localPart );
  +        return false;
       }
   
  -    QName makeQName ( String uri, String local, String prefix )
  +    static boolean toChild ( Cur c, String uri, String local, int i )
       {
  -        return new QName( uri, local, prefix == null ? "" : prefix );
  +        return toChild( c, c._locale.makeQName( uri, local ), i );
       }
  -
  -    QName makeQualifiedQName ( String uri, String qname )
  +    
  +    static boolean toChild ( Cur c, QName name, int i )
       {
  -        if (qname == null)
  -            qname = "";
  +//        if (!c.pushToContainer())
  +//            return false;
  +//
  +        throw new RuntimeException( "Not implemented" );
  +//        c.pop....
  +    }
   
  -        int i = qname.indexOf( ':' );
  +//    private final class NthChildCache
  +//    {
  +//        private boolean namesSame ( QName pattern, QName name )
  +//        {
  +//            return pattern == null || pattern.equals( name );
  +//        }
  +//
  +//        private boolean setsSame ( QNameSet patternSet, QNameSet set)
  +//        {
  +//            // value equality is probably too expensive. Since the use case
  +//            // involves QNameSets that are generated by the compiler, we
  +//            // can use identity comparison.
  +//            return patternSet != null && patternSet == set;
  +//        }
  +//
  +//        private boolean nameHit(QName namePattern,  QNameSet setPattern, QName name)
  +//        {
  +//            if (setPattern == null)
  +//                return namesSame(namePattern, name);
  +//            else
  +//                return setPattern.contains(name);
  +//        }
  +//
  +//        private boolean cacheSame (QName namePattern,  QNameSet setPattern)
  +//        {
  +//            return setPattern == null ? namesSame(namePattern, _name) :
  +//                setsSame(setPattern, _set);
  +//        }
  +//
  +//        int distance ( Splay parent, QName name, QNameSet set, int n )
  +//        {
  +//            assert n >= 0;
  +//
  +//            if (_version != Root.this.getVersion())
  +//                return Integer.MAX_VALUE - 1;
  +//
  +//            if (parent != _parent || !cacheSame(name, set))
  +//                return Integer.MAX_VALUE;
  +//
  +//            return n > _n ? n - _n : _n - n;
  +//        }
  +//
  +//        Begin fetch ( Splay parent, QName name, QNameSet set, int n )
  +//        {
  +//            assert n >= 0;
  +//
  +//            if (_version != Root.this.getVersion() || _parent != parent ||
  +//                  ! cacheSame(name, set) || n == 0)
  +//            {
  +//                _version = Root.this.getVersion();
  +//                _parent = parent;
  +//                _name = name;
  +//                _child = null;
  +//                _n = -1;
  +//
  +//                if (!parent.isLeaf())
  +//                {
  +//                    loop:
  +//                    for ( Splay s = parent.nextSplay() ; ; s = s.nextSplay() )
  +//                    {
  +//                        switch ( s.getKind() )
  +//                        {
  +//                        case END  :
  +//                        case ROOT : break loop;
  +//
  +//                        case BEGIN :
  +//                            if (nameHit( name, set, s.getName() ))
  +//                            {
  +//                                _child = s;
  +//                                _n = 0;
  +//                                break loop;
  +//                            }
  +//
  +//                            s = s.getFinishSplay();
  +//                            break;
  +//                        }
  +//                    }
  +//                }
  +//            }
  +//
  +//            if (_n < 0)
  +//                return null;
  +//
  +//            if (n > _n)
  +//            {
  +//                while ( n > _n )
  +//                {
  +//                    for ( Splay s = _child.getFinishSplay().nextSplay() ; ;
  +//                          s = s.nextSplay() )
  +//                    {
  +//                        if (s.isFinish())
  +//                            return null;
  +//
  +//                        if (s.isBegin())
  +//                        {
  +//                            if (nameHit( name, set, s.getName() ))
  +//                            {
  +//                                _child = s;
  +//                                _n++;
  +//                                break;
  +//                            }
  +//
  +//                            s = s.getFinishSplay();
  +//                        }
  +//                    }
  +//                }
  +//            }
  +//            else if (n < _n)
  +//            {
  +//                while ( n < _n )
  +//                {
  +//                    Splay s = _child;
  +//
  +//                    for ( ; ; )
  +//                    {
  +//                        s = s.prevSplay();
  +//
  +//                        if (s.isLeaf() || s.isEnd())
  +//                        {
  +//                            if (s.isEnd())
  +//                                s = s.getContainer();
  +//
  +//                            if (nameHit( name, set, s.getName() ))
  +//                            {
  +//                                _child = s;
  +//                                _n--;
  +//                                break;
  +//                            }
  +//                        }
  +//                        else if (s.isContainer())
  +//                            return null;
  +//                    }
  +//                }
  +//            }
  +//
  +//            return (Begin) _child;
  +//        }
  +//
  +//        private long     _version;
  +//        private Splay    _parent;
  +//        private QName    _name;
  +//        private QNameSet _set;
  +//        
  +//        private Splay _child;
  +//        private int   _n;
  +//    }
  +    
  +    //
  +    // 
  +    //
   
  -        return i < 0
  -            ? new QName( uri, qname )
  -            : new QName( uri, qname.substring( i + 1 ), qname.substring( 0, i ) );
  +    Locale ( )
  +    {
  +        _noSync = true;
  +        _tempFrames = new Cur [ _numTempFramesLeft = 8 ];
  +        _charUtil = CharUtil.getThreadLocalCharUtil();
  +        _qnameFactory = new DefaultQNameFactory();
  +    }
  +
  +    long version ( )
  +    {
  +        return _versionAll;
       }
   
       Cur permCur ( )
  @@ -796,6 +1034,45 @@
           return DomImpl.saajCallback_importSoapElement( (Dom) doc, elem, deep, parentName
);
       }
   
  +    
  +    private static final class DefaultQNameFactory implements QNameFactory
  +    {
  +        private QNameCache _cache = XmlBeans.getQNameCache();
  +        
  +        public QName getQName ( String uri, String local )
  +        {
  +            return _cache.getName( uri, local, "" );
  +        }
  +
  +        public QName getQName ( String uri, String local, String prefix )
  +        {
  +            return _cache.getName( uri, local, prefix );
  +        }
  +
  +        public QName getQName (
  +            char[] uriSrc,   int uriPos,   int uriCch,
  +            char[] localSrc, int localPos, int localCch )
  +        {
  +            return
  +                _cache.getName(
  +                    new String( uriSrc, uriPos, uriCch ),
  +                    new String( localSrc, localPos, localCch ),
  +                    "" );
  +        }
  +
  +        public QName getQName (
  +            char[] uriSrc,    int uriPos,    int uriCch,
  +            char[] localSrc,  int localPos,  int localCch,
  +            char[] prefixSrc, int prefixPos, int prefixCch )
  +        {
  +            return
  +                _cache.getName(
  +                    new String( uriSrc, uriPos, uriCch ),
  +                    new String( localSrc, localPos, localCch ),
  +                    new String( prefixSrc, prefixPos, prefixCch ) );
  +        }
  +    }
  +    
       //
       //
       //
  @@ -821,4 +1098,6 @@
       Saaj _saaj;
       
       Dom _ownerDoc;
  +
  +    QNameFactory _qnameFactory;
   }
  
  
  
  1.19      +2 -1      xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Saver.java
  
  Index: Saver.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Saver.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Saver.java	16 Mar 2004 19:35:42 -0000	1.18
  +++ Saver.java	17 Mar 2004 22:44:31 -0000	1.19
  @@ -717,6 +717,7 @@
           boolean considerCreatingDefault, boolean mustHavePrefix )
       {
           assert uri != null;
  +        assert uri.length() > 0 || !mustHavePrefix;
   
           // Can be called for no-namespaced things
   
  @@ -847,7 +848,7 @@
   
               if (encoding != null)
               {
  -                XmlDocumentProperties props = Locale.getDocProps( c );
  +                XmlDocumentProperties props = Locale.getDocProps( c, false );
                   
                   String version = props == null ? null : props.getVersion();
   
  
  
  
  1.1                  xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/QNameFactory.java
  
  Index: QNameFactory.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 javax.xml.namespace.QName;
  
  public interface QNameFactory
  {
      public QName getQName ( String uri, String local );
      
      public QName getQName ( String uri, String local, String prefix );
  
      public QName getQName (
          char[] uriSrc,   int uriPos,   int uriCch,
          char[] localSrc, int localPos, int localCch );
      
      public QName getQName (
          char[] uriSrc,    int uriPos,    int uriCch,
          char[] localSrc,  int localPos,  int localCch,
          char[] prefixSrc, int prefixPos, int prefixCch );
  }
  
  
  1.3       +31 -11    xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/QNameCache.java
  
  Index: QNameCache.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/QNameCache.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QNameCache.java	12 Feb 2004 20:06:27 -0000	1.2
  +++ QNameCache.java	17 Mar 2004 22:44:31 -0000	1.3
  @@ -61,24 +61,31 @@
           this(initialCapacity, DEFAULT_LOAD);
       }
   
  +    public QName getName(String uri, String localName)
  +    {
  +        return getName( uri, localName, "" );
  +    }
  +    
       /**
        * Fetches a QName with the given namespace and localname.
        * Creates one if one is not found in the cache.
        * 
        * @param uri the namespace
        * @param localName the localname
  +     * @param prefix the prefix
        * @return the cached QName
        */ 
  -    public QName getName(String uri, String localName)
  +    public QName getName(String uri, String localName, String prefix)
       {
           /*
  -        return new QName(uri, localName);
  +        return new QName(uri, localName, prefix);
           */
           assert localName != null;
           
           if (uri == null) uri = "";
  +        if (prefix == null) prefix = "";
   
  -        int index = hash(uri, localName) & hashmask;
  +        int index = hash(uri, localName, prefix) & hashmask;
           while (true) {
               QName q = table[index];
               if (q == null)
  @@ -87,9 +94,9 @@
                   if (numEntries >= threshold)
                       rehash();
   
  -                return table[index] = new QName(uri, localName);
  +                return table[index] = new QName(uri, localName, prefix);
               }
  -            else if (equals(q, uri, localName))
  +            else if (equals(q, uri, localName, prefix))
                   return q;
               else 
                   index = (index-1) & hashmask;
  @@ -107,24 +114,37 @@
               QName q = table[i];
               if (q != null)
               {
  -                int newIndex = hash(q.getNamespaceURI(), q.getLocalPart()) & newHashmask;
  +                int newIndex =
  +                    hash( q.getNamespaceURI(), q.getLocalPart(), q.getPrefix() ) &
newHashmask;
  +                
                   while (newTable[newIndex] != null)
                       newIndex = (newIndex - 1) & newHashmask;
  +                
                   newTable[newIndex] = q;
               }
           }
   
           table = newTable;
           hashmask = newHashmask;
  -        threshold = (int)(newLength * loadFactor);
  +        threshold = (int) (newLength * loadFactor);
       }
  -    private static int hash(String uri, String localName)
  +    
  +    private static int hash(String uri, String localName, String prefix)
       {
  -        return (uri.hashCode() << 5) + localName.hashCode();
  +        int h = 0;
  +
  +        h += prefix.hashCode() << 10;
  +        h += uri.hashCode() << 5;
  +        h += localName.hashCode();
  +
  +        return h;
       }
   
  -    private static boolean equals(QName q, String uri, String localName)
  +    private static boolean equals(QName q, String uri, String localName, String prefix)
       {
  -        return q.getLocalPart().equals(localName) && q.getNamespaceURI().equals(uri);
  +        return
  +            q.getLocalPart().equals(localName) &&
  +                q.getNamespaceURI().equals(uri) &&
  +                    q.getPrefix().equals(prefix);
       }
   }
  
  
  
  1.40      +24 -14    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.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- EricTest.java	17 Mar 2004 05:43:15 -0000	1.39
  +++ EricTest.java	17 Mar 2004 22:44:31 -0000	1.40
  @@ -110,23 +110,33 @@
   {
       public static void main ( String[] args ) throws Exception
       {
  -        XmlOptions options = new XmlOptions();
  -        options.setValidateOnSet();
  -
  -        Elem e = Elem.Factory.newInstance();
  +//        XmlObject x = XmlObject.Factory.parse( "<a x='y'><b/></a>"
);
  +        XmlCursor c = Public2.getCursor( Public2.parse( "<a x='y'><b><c/></b></a>"
) );
  +        
  +        c.toNextToken();
  +        c.toNextToken();
   
  -        System.out.println( e.getField() );
  +        Public2.dump( c );
   
  -        try
  -        {
  -            e.setField( null );
  -        }
  -        catch ( Throwable ee )
  -        {
  -            ee.printStackTrace( System.out );
  -        }
  +        System.out.println( c.toFirstChild() );
           
  -        System.out.println( e.getField() );
  +//        XmlOptions options = new XmlOptions();
  +//        options.setValidateOnSet();
  +//
  +//        Elem e = Elem.Factory.newInstance();
  +//
  +//        System.out.println( e.getField() );
  +//
  +//        try
  +//        {
  +//            e.setField( null );
  +//        }
  +//        catch ( Throwable ee )
  +//        {
  +//            ee.printStackTrace( System.out );
  +//        }
  +//        
  +//        System.out.println( e.getField() );
       }
   }
   
  
  
  

---------------------------------------------------------------------
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