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 2011/07/04 13:40:41 UTC
svn commit: r1142631 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
Author: mukulg
Date: Mon Jul 4 11:40:41 2011
New Revision: 1142631
URL: http://svn.apache.org/viewvc?rev=1142631&view=rev
Log:
doing a small fix to schema 1.1 type alternative implementation. if xpathDefaultNamespace is not present on xs:alternative, the implementation was not taking it's value from the ancestor xs:schema node (if it was present there). this commit solves this problem.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java?rev=1142631&r1=1142630&r2=1142631&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java Mon Jul 4 11:40:41 2011
@@ -83,7 +83,7 @@ class XSDTypeAlternativeTraverser extend
Object[] attrValues = fAttrChecker.checkAttributes(altElement, false, schemaDoc);
QName typeAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_TYPE];
String testStr = (String) attrValues[XSAttributeChecker.ATTIDX_XPATH];
- String xpathNS = (String) attrValues[XSAttributeChecker.ATTIDX_XPATHDEFAULTNS];
+ String xpathDefaultNS = (String) attrValues[XSAttributeChecker.ATTIDX_XPATHDEFAULTNS];
// get 'annotation'
Element childNode = DOMUtil.getFirstChildElement(altElement);
@@ -183,7 +183,7 @@ class XSDTypeAlternativeTraverser extend
reportSchemaError("s4s-elt-must-match.1", new Object[]{"type alternative", "(annotation?, (simpleType | complexType)?)", DOMUtil.getLocalName(childNode)}, childNode);
}
- // create type alternative
+ // create type alternative component
XSTypeAlternativeImpl typeAlternative = new XSTypeAlternativeImpl(element.fName, alternativeType, annotations);
// now look for other optional attributes like test and xpathDefaultNamespace
@@ -214,9 +214,12 @@ class XSDTypeAlternativeTraverser extend
// REVISIT : is using Document.getDocumentURI() correct to retrieve base URI in every case, for type alternatives?
typeAlternative.setBaseURI(fXsdHandler.getDocumentURI());
- if (xpathNS != null) {
+ if (xpathDefaultNS == null) {
+ xpathDefaultNS = schemaDoc.fXpathDefaultNamespace;
+ }
+ if (xpathDefaultNS != null) {
//set the xpathDefaultNamespace attribute value
- typeAlternative.setXPathDefauleNamespace(xpathNS);
+ typeAlternative.setXPathDefauleNamespace(xpathDefaultNS);
}
grammar.addTypeAlternative(element, typeAlternative);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org