xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r1023650 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLAssertPsychopathImpl.java traversers/XSDAbstractTraverser.java traversers/XSDComplexTypeTraverser.java
Date Mon, 18 Oct 2010 04:54:16 GMT
Author: mrglavas
Date: Mon Oct 18 04:54:15 2010
New Revision: 1023650

URL: http://svn.apache.org/viewvc?rev=1023650&view=rev
Log:
Fixing some subtle bugs. Should only be trimming XML spaces off of a value. Use XMLChar.trim()
instead of String.trim() (which trims off all sorts of non-XML space characters).

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java?rev=1023650&r1=1023649&r2=1023650&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
Mon Oct 18 04:54:15 2010
@@ -34,6 +34,7 @@ import org.apache.xerces.impl.dv.XSSimpl
 import org.apache.xerces.impl.xs.assertion.XMLAssertAdapter;
 import org.apache.xerces.impl.xs.assertion.XSAssertImpl;
 import org.apache.xerces.impl.xs.util.XSTypeHelper;
+import org.apache.xerces.util.XMLChar;
 import org.apache.xerces.xni.Augmentations;
 import org.apache.xerces.xni.QName;
 import org.apache.xerces.xni.XMLAttributes;
@@ -332,7 +333,7 @@ public class XMLAssertPsychopathImpl ext
             else {
                 // white-space normalization is needed for the string value of
                 // $value in case of derivation from non xs:string atomic types.
-                value = (textValueContents.toString()).trim();
+                value = XMLChar.trim(textValueContents.toString());
             }    
         }
         else {

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java?rev=1023650&r1=1023649&r2=1023650&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
Mon Oct 18 04:54:15 2010
@@ -42,6 +42,7 @@ import org.apache.xerces.impl.xs.util.XS
 import org.apache.xerces.util.DOMUtil;
 import org.apache.xerces.util.NamespaceSupport;
 import org.apache.xerces.util.SymbolTable;
+import org.apache.xerces.util.XMLChar;
 import org.apache.xerces.xni.QName;
 import org.apache.xerces.xs.XSAttributeUse;
 import org.apache.xerces.xs.XSConstants;
@@ -518,11 +519,11 @@ abstract class XSDAbstractTraverser {
                     assertImpl.setXPathDefaultNamespace(xpathDefaultNamespace);
                     assertImpl.setXPath2NamespaceContext(new SchemaNamespaceSupport
                                                      (schemaDoc.fNamespaceSupport));
-                    String assertMessage = content.getAttributeNS(
+                    String assertMessage = XMLChar.trim(content.getAttributeNS(
                                                 SchemaSymbols.URI_XERCES_EXTENSIONS,
-                                                SchemaSymbols.ATT_ASSERT_MESSAGE);
-                    if (!"".equals(assertMessage.trim())) {
-                       assertImpl.setMessage(assertMessage.trim());
+                                                SchemaSymbols.ATT_ASSERT_MESSAGE));
+                    if (!"".equals(assertMessage)) {
+                       assertImpl.setMessage(assertMessage);
                     }
                     
                     if (assertData == null) {

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=1023650&r1=1023649&r2=1023650&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
Mon Oct 18 04:54:15 2010
@@ -41,6 +41,7 @@ import org.apache.xerces.impl.xs.asserti
 import org.apache.xerces.impl.xs.util.XInt;
 import org.apache.xerces.impl.xs.util.XSObjectListImpl;
 import org.apache.xerces.util.DOMUtil;
+import org.apache.xerces.util.XMLChar;
 import org.apache.xerces.xni.QName;
 import org.apache.xerces.xs.XSAttributeUse;
 import org.apache.xerces.xs.XSComplexTypeDefinition;
@@ -1711,11 +1712,11 @@ class  XSDComplexTypeTraverser extends X
             assertImpl.setXPathDefaultNamespace(xpathDefaultNamespace);
             assertImpl.setXPath2NamespaceContext(new SchemaNamespaceSupport
                                             (schemaDoc.fNamespaceSupport));
-            String assertMessage = assertElement.getAttributeNS(
+            String assertMessage = XMLChar.trim(assertElement.getAttributeNS(
                                           SchemaSymbols.URI_XERCES_EXTENSIONS, 
-                                          SchemaSymbols.ATT_ASSERT_MESSAGE);
-            if (!"".equals(assertMessage.trim())) {
-               assertImpl.setMessage(assertMessage.trim());
+                                          SchemaSymbols.ATT_ASSERT_MESSAGE));
+            if (!"".equals(assertMessage)) {
+               assertImpl.setMessage(assertMessage);
             }
 
             // add assertion object, to the list of assertions to be processed



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org


Mime
View raw message