1 16 17 package org.apache.xerces.impl.dv.dtd; 18 19 import org.apache.xerces.impl.dv.*; 20 import org.apache.xerces.util.XML11Char; 21 22 42 public class XML11IDREFDatatypeValidator extends IDREFDatatypeValidator { 43 44 public XML11IDREFDatatypeValidator() { 46 super(); 47 } 48 49 59 public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException { 60 61 if(context.useNamespaces()) { 63 if (!XML11Char.isXML11ValidNCName(content)) { 64 throw new InvalidDatatypeValueException("IDREFInvalidWithNamespaces", new Object []{content}); 65 } 66 } 67 else { 68 if (!XML11Char.isXML11ValidName(content)) { 69 throw new InvalidDatatypeValueException("IDREFInvalid", new Object []{content}); 70 } 71 } 72 73 context.addIdRef(content); 74 75 } 76 77 } 78 79 | Popular Tags |