morten 01/05/17 03:58:57
Modified: java/src/org/apache/xalan/xsltc/dom DOMImpl.java
Log:
Changed the TypedFollowingSiblingIterator and TypedFollowingIterator
inner classes of DOMImpl to fix the following::* iterators.
CHanged the DOM builder's endDocument() SAX entry point to properly
handle @xml:<blob> attributes (such as xml:lang and xml:space).
PR: bugzilla 1758 & 1677
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.5 +13 -15
xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java
Index: DOMImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DOMImpl.java 2001/05/03 18:22:16 1.4
+++ DOMImpl.java 2001/05/17 10:58:49 1.5
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: DOMImpl.java,v 1.4 2001/05/03 18:22:16 tmiller Exp $
+ * @(#)$Id: DOMImpl.java,v 1.5 2001/05/17 10:58:49 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -832,9 +832,10 @@
public int next() {
int node;
- while ((node = super.next()) != NULL && _type[node] != _nodeType) {
+ while ((node = super.next()) != NULL) {
+ if (_type[node] == _nodeType) return node;
}
- return node;
+ return END;
}
} // end of TypedFollowingSiblingIterator
@@ -1126,14 +1127,11 @@
}
public int next() {
- final int limit = _treeNodeLimit;
- int node = _node + 1;
- final int type = _nodeType;
- // skipping nodes not of desired type
- while (node < limit && _type[node] != type) {
- ++node;
+ int node;
+ while ((node = super.next()) != NULL) {
+ if (_type[node] == _nodeType) return node;
}
- return node == limit ? NULL : returnNode(_node = node);
+ return END;
}
} // end of TypedFollowingIterator
@@ -2390,9 +2388,8 @@
while (node != DOM.NULL) {
int attr = _lengthOrAttr[node];
while (attr != DOM.NULL) {
- if (_type[attr] == type) {
+ if (_type[attr] == type)
return(getNodeValue(attr));
- }
attr = _nextSibling[attr];
}
node = getParent(node);
@@ -2465,7 +2462,7 @@
private static final String XML_STRING = "xml";
private static final String XMLNS_STRING = "xmlns";
- private static final String XMLSPACE_STRING = "xmlns";
+ private static final String XMLSPACE_STRING = "xml:space";
private static final String PRESERVE_STRING = "preserve";
/**
@@ -2724,7 +2721,8 @@
return -1;
else if (name.startsWith(XMLSPACE_STRING))
xmlSpaceDefine(attList.getValue(i), parent);
- xmlAttr = true;
+ if (name.charAt(3) == ':')
+ xmlAttr = true;
}
// fall through to handle a regular attribute
@@ -2802,7 +2800,7 @@
for (int i = 0; i<namesSize; i++) {
final String qname = _namesArray[i];
final int col = _namesArray[i].lastIndexOf(':');
- if (col > -1) {
+ if ((!qname.startsWith(XML_STRING)) && (col > -1)) {
final String uri = _namesArray[i].substring(0, col);
final Integer idx = (Integer)_nsIndex.get(uri);
_namespace[i] = idx.shortValue();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]