You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/06/04 15:49:37 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
sboag 01/06/04 06:49:37
Modified: java/src/org/apache/xml/dtm/ref/dom2dtm Tag: DTM_EXP
DOM2DTM.java
Log:
Added support for the normalize space arg on dispatchCharacters.
Revision Changes Path
No revision
No revision
1.1.2.8 +24 -3 xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/Attic/DOM2DTM.java
Index: DOM2DTM.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/Attic/DOM2DTM.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- DOM2DTM.java 2001/05/30 20:31:05 1.1.2.7
+++ DOM2DTM.java 2001/06/04 13:49:36 1.1.2.8
@@ -1337,6 +1337,18 @@
}
// ========== Direct SAX Dispatch, for optimization purposes ========
+
+ /**
+ * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
+ * of whitespace. Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
+ * the definition of <CODE>S</CODE></A> for details.
+ * @param ch Character to check as XML whitespace.
+ * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
+ */
+ private static boolean isSpace(char ch)
+ {
+ return XMLCharacterRecognizer.isWhiteSpace(ch); // Take the easy way out for now.
+ }
/**
* Directly call the
@@ -1356,9 +1368,18 @@
boolean normalize)
throws org.xml.sax.SAXException
{
- int type = getNodeType(nodeHandle);
- Node node = getNode(nodeHandle);
- dispatchNodeData(node, ch, 0);
+ if(normalize)
+ {
+ XMLString str = getStringValue(nodeHandle);
+ str = str.fixWhiteSpace(true, true, false);
+ str.dispatchCharactersEvents(ch);
+ }
+ else
+ {
+ int type = getNodeType(nodeHandle);
+ Node node = getNode(nodeHandle);
+ dispatchNodeData(node, ch, 0);
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org