1 57 58 package com.sun.org.apache.xerces.internal.impl.dv.xs; 59 60 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException; 61 import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext; 62 import com.sun.org.apache.xerces.internal.util.XMLChar; 63 64 72 public class IDREFDV extends TypeValidator{ 73 74 public short getAllowedFacets(){ 75 return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE ); 76 } 77 78 public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException { 79 if (!XMLChar.isValidNCName(content)) { 80 throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object []{content, "NCName"}); 81 } 82 return content; 83 } 84 85 public void checkExtraRules(Object value, ValidationContext context) throws InvalidDatatypeValueException { 86 context.addIdRef((String )value); 87 } 88 89 } 91 | Popular Tags |