You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mu...@apache.org on 2012/09/07 14:03:52 UTC
svn commit: r1381986 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java
Author: mukulg
Date: Fri Sep 7 12:03:52 2012
New Revision: 1381986
URL: http://svn.apache.org/viewvc?rev=1381986&view=rev
Log:
committing fix for jira issue, XERCESJ-1577
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java?rev=1381986&r1=1381985&r2=1381986&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java Fri Sep 7 12:03:52 2012
@@ -1611,21 +1611,20 @@ public class XSAttributeChecker {
StringTokenizer st = new StringTokenizer(attrVal, " \n\t\r");
while (st.hasMoreTokens()) {
Object avalue = dv.validate(st.nextToken(), schemaDoc.fValidationContext, null);
+ modifyQNameForChameleonProcessing(schemaDoc, avalue);
((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue);
}
}
else {
Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
+ modifyQNameForChameleonProcessing(schemaDoc, avalue);
((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue);
}
}
else {
- Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
- // kludge to handle chameleon includes/redefines...
+ Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
if (oneAttr.dvIndex == DT_QNAME) {
- QName qname = (QName)avalue;
- if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
- qname.uri = schemaDoc.fTargetNamespace;
+ modifyQNameForChameleonProcessing(schemaDoc, avalue);
}
attrValues[oneAttr.valueIndex] = avalue;
}
@@ -1687,6 +1686,21 @@ public class XSAttributeChecker {
return attrValues;
}
+ /*
+ * If chameleon pre-processing is required, then this method would modify the QName value appropriately.
+ *
+ * @param schemaDoc metadata about the schema document
+ * @param qnameVal validated QName value
+ *
+ */
+ private void modifyQNameForChameleonProcessing(XSDocumentInfo schemaDoc, Object qnameVal) {
+ // kludge to handle chameleon includes/redefines...
+ QName qname = (QName)qnameVal;
+ if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema) {
+ qname.uri = schemaDoc.fTargetNamespace;
+ }
+ }
+
private Object validate(Object[] attrValues, String attr, String ivalue, int dvIndex,
XSDocumentInfo schemaDoc) throws InvalidDatatypeValueException {
if (ivalue == null)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org