You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Eric Vasilik <er...@bea.com> on 2003/09/24 00:29:29 UTC

Fix for XmlCursor.copyXml and misc

- Fixed a bug in XmlCursor.copyXml where the wrong text was being copied under certain circumstances
- Run the junit tests with asserts on
- Turn on namesapce features of SAX parser during parsing tests
- Also updated copyright notice to exclude past years (diffs not included)


Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v1/build.xml,v
retrieving revision 1.3
diff -u -r1.3 build.xml
--- build.xml   16 Sep 2003 19:57:58 -0000      1.3
+++ build.xml   23 Sep 2003 22:12:38 -0000
@@ -53,9 +53,11 @@
     <echo message="Running xbean product drt tests"/>
     <echo message="JUnit output being sent to xbean/build/test/output/drt-product.txt"/>
     <junit fork="yes" printsummary="yes" haltonfailure="yes" showoutput="yes">
+      <jvmarg value="-ea"/>
       <sysproperty key="xbean.rootdir" value="${basedir}"/>
       <sysproperty key="treeasserts" value="true"/>
       <classpath>
+        <pathelement location="external/lib/junit.jar"/>
         <pathelement location="build/ar/xbean.jar"/>
         <pathelement location="build/private/lib/drt.jar"/>
         <pathelement location="build/private/lib/easypo.jar"/>
Index: bin/scomp
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v1/bin/scomp,v
retrieving revision 1.1
diff -u -r1.1 scomp
--- bin/scomp   15 Sep 2003 17:19:19 -0000      1.1
+++ bin/scomp   23 Sep 2003 22:12:38 -0000
@@ -4,6 +4,6 @@
 #Builds XBean types from xsd files.

 cp=
-cp=$cp:$XMLBEANS_HOME/build/arbxbean.jar
+cp=$cp:$XMLBEANS_HOME/build/ar/xbean.jar

 java -classpath $cp ort.apache.xmlbeanseimpl.toolmSchemaCompiler $*
Index: src/xmlstore/org/apache/xmlbeans/impl/store/Cursor.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v1/src/xmlstore/org/apache/xmlbeans/impl/store/Cursor.java,v
retrieving revision 1.1
diff -u -r1.1 Cursor.java
--- src/xmlstore/org/apache/xmlbeans/impl/store/Cursor.java     15 Sep 2003 18:20:38 -0000      1.1
+++ src/xmlstore/org/apache/xmlbeans/impl/store/Cursor.java     23 Sep 2003 22:12:40 -0000
@@ -2509,11 +2509,34 @@
         Root rDst = cDst.getRoot();

         Splay copy = s.copySplay();
+
+        Object txt = r._text;
+        int cp = r.getCp( s );
+        int cch = copy.getCchLeft() + copy.getCch();
+
+        //
+        // Remove text after which might be between leaf value and first attr value
+        //
+
+        if (s.isLeaf() && s.getCchAfter() > 0)
+        {
+            int cchValue = s.getCchValue();
+            int cchAfter = s.getCchAfter();

-        sDst.insert(
-            rDst, pDst, copy,
-            r._text, r.getCp( s ), copy.getCchLeft() + copy.getCch(),
-            true );
+            if (cchValue == 0)
+                cp += cchAfter;
+            else if (s.nextSplay().isAttr())
+            {
+                char[] buf = new char [ cch ];
+                r._text.fetch( buf, 0, cp, cchValue );
+                r._text.fetch( buf, cchValue, cp + cchValue + cchAfter, cch - cchValue );
+
+                txt = buf;
+                cp = 0;
+            }
+        }
+
+        sDst.insert( rDst, pDst, copy, txt, cp, cch, true );

         return true;
     }
Index: test/src/drt/drtcases/StoreTests.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v1/test/src/drt/drtcases/StoreTests.java,v
retrieving revision 1.1
diff -u -r1.1 StoreTests.java
--- test/src/drt/drtcases/StoreTests.java       15 Sep 2003 18:20:44 -0000      1.1
+++ test/src/drt/drtcases/StoreTests.java       23 Sep 2003 22:12:42 -0000
@@ -2563,15 +2563,15 @@
         InputSource is = new InputSource( new StringReader(  xml ) );
         XmlSaxHandler sh = XmlObject.Factory.newXmlSaxHandler();

-//        xr.setFeature(
-//            "http://xml.org/sax/features/namespace-prefixes",
-//            true );
-//
-//        xr.setFeature(
-//            "http://xml.org/sax/features/namespaces", true );
-//
-//        xr.setFeature(
-//            "http://xml.org/sax/features/validation", false );
+        xr.setFeature(
+            "http://xml.org/sax/features/namespace-prefixes",
+            true );
+
+        xr.setFeature(
+            "http://xml.org/sax/features/namespaces", true );
+
+        xr.setFeature(
+            "http://xml.org/sax/features/validation", false );

         xr.setContentHandler( sh.getContentHandler() );

cvs server: test/src/drt/drtcases/StoreTestsXqrl.java was removed, no comparison available
Index: test/src/ericschema/ericschema.xsd

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/