You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2006/09/26 21:52:31 UTC
svn commit: r450169 -
/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mrglavas
Date: Tue Sep 26 12:52:31 2006
New Revision: 450169
URL: http://svn.apache.org/viewvc?view=rev&rev=450169
Log:
The XSAttributeDecls for the xsi:* attributes are always the same objects. Only look them up once.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?view=diff&rev=450169&r1=450168&r2=450169
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Tue Sep 26 12:52:31 2006
@@ -304,6 +304,12 @@
// we expect an element to have. It's almost
// never > 1; so leave it at that.
protected static final int ID_CONSTRAINT_NUM = 1;
+
+ // xsi:* attribute declarations
+ static final XSAttributeDecl XSI_TYPE = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_TYPE);
+ static final XSAttributeDecl XSI_NIL = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_NIL);
+ static final XSAttributeDecl XSI_SCHEMALOCATION = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_SCHEMALOCATION);
+ static final XSAttributeDecl XSI_NONAMESPACESCHEMALOCATION = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION);
//
// Data
@@ -2729,18 +2735,18 @@
// for the 4 xsi attributes, get appropriate decl, and validate
if (fTempQName.uri == SchemaSymbols.URI_XSI) {
XSAttributeDecl attrDecl = null;
- if (fTempQName.localpart == SchemaSymbols.XSI_SCHEMALOCATION)
- attrDecl =
- SchemaGrammar.SG_XSI.getGlobalAttributeDecl(
- SchemaSymbols.XSI_SCHEMALOCATION);
- else if (fTempQName.localpart == SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION)
- attrDecl =
- SchemaGrammar.SG_XSI.getGlobalAttributeDecl(
- SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION);
- else if (fTempQName.localpart == SchemaSymbols.XSI_NIL)
- attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_NIL);
- else if (fTempQName.localpart == SchemaSymbols.XSI_TYPE)
- attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_TYPE);
+ if (fTempQName.localpart == SchemaSymbols.XSI_TYPE) {
+ attrDecl = XSI_TYPE;
+ }
+ else if (fTempQName.localpart == SchemaSymbols.XSI_NIL) {
+ attrDecl = XSI_NIL;
+ }
+ else if (fTempQName.localpart == SchemaSymbols.XSI_SCHEMALOCATION) {
+ attrDecl = XSI_SCHEMALOCATION;
+ }
+ else if (fTempQName.localpart == SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION) {
+ attrDecl = XSI_NONAMESPACESCHEMALOCATION;
+ }
if (attrDecl != null) {
processOneAttribute(element, attributes, index, attrDecl, null, attrPSVI);
continue;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org