Author: mukulg
Date: Mon Jul 6 12:32:30 2009
New Revision: 791463
URL: http://svn.apache.org/viewvc?rev=791463&view=rev
Log:
implementation of XML Schema 1.1 type, xs:error
Added:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ErrorDV.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/Schema11DVFactoryImpl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
Added:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ErrorDV.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ErrorDV.java?rev=791463&view=auto
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ErrorDV.java
(added)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ErrorDV.java
Mon Jul 6 12:32:30 2009
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.xerces.impl.dv.xs;
+
+import org.apache.xerces.impl.dv.InvalidDatatypeValueException;
+import org.apache.xerces.impl.dv.ValidationContext;
+
+/**
+ * Represents the schema type "error"
+ *
+ * @xerces.internal
+ *
+ * @author Mukul Gandhi, IBM
+ *
+ */
+public class ErrorDV extends TypeValidator {
+
+ public short getAllowedFacets() {
+ return XSSimpleTypeDecl.FACET_NONE;
+ }
+
+ public Object getActualValue(String content, ValidationContext context)
throws InvalidDatatypeValueException {
+ throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1",
new Object[]{content, "error"});
+ }
+
+} // class ErrorDV
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java?rev=791463&r1=791462&r2=791463&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
Mon Jul 6 12:32:30 2009
@@ -43,11 +43,15 @@
final String DURATION = "duration";
final String YEARMONTHDURATION = "yearMonthDuration";
final String DAYTIMEDURATION = "dayTimeDuration";
+ final String ERROR = "error";
createBuiltInTypes(fBuiltInTypes, XSSimpleTypeDecl.fAnyAtomicType);
// add anyAtomicType
fBuiltInTypes.put(ANYATOMICTYPE, XSSimpleTypeDecl.fAnyAtomicType);
+
+ // add error
+ fBuiltInTypes.put(ERROR, XSSimpleTypeDecl.fError);
// add 2 duration types
XSSimpleTypeDecl durationDV =
(XSSimpleTypeDecl)fBuiltInTypes.get(DURATION);
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/Schema11DVFactoryImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/Schema11DVFactoryImpl.java?rev=791463&r1=791462&r2=791463&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/Schema11DVFactoryImpl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/Schema11DVFactoryImpl.java
Mon Jul 6 12:32:30 2009
@@ -44,11 +44,15 @@
final String YEARMONTHDURATION = "yearMonthDuration";
final String DAYTIMEDURATION = "dayTimeDuration";
final String PRECISIONDECIMAL = "precisionDecimal";
+ final String ERROR = "error";
createBuiltInTypes(fBuiltInTypes, XSSimpleTypeDecl.fAnyAtomicType);
// add anyAtomicType
fBuiltInTypes.put(ANYATOMICTYPE, XSSimpleTypeDecl.fAnyAtomicType);
+
+ // add error
+ fBuiltInTypes.put(ERROR, XSSimpleTypeDecl.fError);
// add 2 duration types
XSSimpleTypeDecl durationDV =
(XSSimpleTypeDecl)fBuiltInTypes.get(DURATION);
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=791463&r1=791462&r2=791463&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
Mon Jul 6 12:32:30 2009
@@ -91,6 +91,7 @@
static final short DV_YEARMONTHDURATION = DV_NOTATION + 7;
static final short DV_DAYTIMEDURATION = DV_NOTATION + 8;
static final short DV_ANYATOMICTYPE = DV_NOTATION + 9;
+ static final short DV_ERROR = DV_NOTATION + 10;
static final TypeValidator[] fDVs = {
new AnySimpleDV(),
@@ -122,7 +123,8 @@
new UnionDV(),
new YearMonthDurationDV(), // XML Schema 1.1 type
new DayTimeDurationDV(), // XML Schema 1.1 type
- new AnyAtomicDV() // XML Schema 1.1 type
+ new AnyAtomicDV(), // XML Schema 1.1 type
+ new ErrorDV() // XML Schema 1.1 type
};
static final short NORMALIZE_NONE = 0;
@@ -159,6 +161,7 @@
NORMALIZE_TRIM, //YearMonthDurationDV() (Schema 1.1)
NORMALIZE_TRIM, //DayTimeDurationDV() (Schema 1.1)
NORMALIZE_NONE, //AnyAtomicDV() (Schema 1.1)
+ NORMALIZE_NONE, //ErrorDV() (Schema 1.1)
};
static final short SPECIAL_PATTERN_NONE = 0;
@@ -182,6 +185,7 @@
public static final short DAYTIMEDURATION_DT = 47;
public static final short PRECISIONDECIMAL_DT = 48;
public static final short ANYATOMICTYPE_DT = 49;
+ public static final short ERROR_DT = 50;
// DOM Level 3 TypeInfo Derivation Method constants
static final int DERIVATION_ANY = 0;
@@ -2830,6 +2834,8 @@
static final XSSimpleTypeDecl fAnySimpleType = new XSSimpleTypeDecl(null,
"anySimpleType", DV_ANYSIMPLETYPE, ORDERED_FALSE, false, true, false, true,
XSConstants.ANYSIMPLETYPE_DT);
static final XSSimpleTypeDecl fAnyAtomicType = new
XSSimpleTypeDecl(fAnySimpleType, "anyAtomicType", DV_ANYATOMICTYPE,
ORDERED_FALSE, false, true, false, true, XSSimpleTypeDecl.ANYATOMICTYPE_DT);
+
+ static final XSSimpleTypeDecl fError = new
XSSimpleTypeDecl(fAnySimpleType, "error", DV_ERROR, ORDERED_FALSE, false, true,
false, true, XSSimpleTypeDecl.ERROR_DT);
/**
* Validation context used to validate facet values.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]