You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ce...@apache.org on 2005/04/10 02:20:59 UTC
svn commit: r160727 -
xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/DomImpl.java
Author: cezar
Date: Sat Apr 9 17:20:59 2005
New Revision: 160727
URL: http://svn.apache.org/viewcvs?view=rev&rev=160727
Log:
Yana Kadiyska. Checking in updated docs
Modified:
xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/DomImpl.java
Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/DomImpl.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/DomImpl.java?view=diff&r1=160726&r2=160727
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/DomImpl.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/DomImpl.java Sat Apr 9 17:20:59 2005
@@ -1308,54 +1308,13 @@
case DOCFRAG :
case ATTR :
{
- /* if (n instanceof Xobj)
+ if (n instanceof Xobj)
{
Xobj node = (Xobj) n;
- if (node.isFirstChildPtrDomUsable())
- {
- Dom myNode = (Xobj.NodeXobj) node._firstChild;
- boolean nullFC =
- node._firstChild == null &&
- node._srcValue == null &&
- node._charNodesValue == null;
- boolean null1FC =
- node._firstChild != null &&
- !node._firstChild.isAttr() &&
- node._srcValue == null &&
- node._charNodesValue == null;
- String dump1 = null;
- if ( myNode != null ){
- dump1 = node._firstChild.new_cursor().xmlText();
- }
-
-
- Cur c = n.tempCur();
-
- c.next();
-
- if ((fc = c.getCharNodes()) == null)
- {
- c.moveToDom(n);
-
- if (c.toFirstChild())
- fc = c.getDom();
- }
-
- c.release();
- if (myNode != fc)
- {
- XmlCursor c1 = node.new_cursor();
- throw new RuntimeException("DOMFC wrong result " +
- c1.xmlText()+" B1 FC "+nullFC+" B2 FC "+null1FC+
- " exp "+fc+" got "+ dump1);
- }
-
- break;
-
-
- }
+ if (! node.isVacant() && node.isFirstChildPtrDomUsable())
+ return (Xobj.NodeXobj) node._firstChild;
}
- */
+
Cur c = n.tempCur();
@@ -1514,7 +1473,7 @@
if (n instanceof Xobj)
{
Xobj node = (Xobj) n;
- if (node.isNextSiblingPtrDomUsable())
+ if (!node.isVacant() && node.isNextSiblingPtrDomUsable())
return
(Xobj.NodeXobj) node._nextSibling;
}
@@ -2595,7 +2554,7 @@
if (i == 0 && (n instanceof Xobj))
{
Xobj node = (Xobj) n;
- if (node.isFirstChildPtrDomUsable())
+ if (!node.isVacant() && node.isFirstChildPtrDomUsable())
return
(Xobj.NodeXobj) node._firstChild;
}
@@ -2656,23 +2615,13 @@
//optimize for the 0 and 1 child case
- /* if (n instanceof Xobj)
+ if (n instanceof Xobj)
{
Xobj node = (Xobj) n;
int count;
- if ((count = node.getDomZeroOneChildren()) < 2){
- long version = n.locale().version();
- XmlCursor c1 = node.new_cursor();
- String s ="" ;//= c1.xmlText();
- int real = n.locale().domLength(n);
- if (count != real)
- throw new RuntimeException( "DOM ZEROONE short "+count+
- " real "+ real+" "+s+" "+c1.xmlText()+
- " ver1"+version+" ver2 "+n.locale().version());
- return count;
- }
-
- }*/
+ if (!node.isVacant() && (count = node.getDomZeroOneChildren()) < 2)
+ return count;
+ }
return n.locale().domLength(n);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org