
com.saxonica.validate
Class SimpleContentValidator
java.lang.Object
|
+--net.sf.saxon.event.ProxyReceiver
|
+--com.saxonica.validate.Validator
|
+--com.saxonica.validate.AttributeValidator
|
+--com.saxonica.validate.SimpleContentValidator
- All Implemented Interfaces:
- Receiver, javax.xml.transform.Result, javax.xml.transform.SourceLocator
- public class SimpleContentValidator
- extends AttributeValidator
This class is a filter that is used to validate that an element has simple content
conforming to a given simple type. This filter accumulates the character data in
a buffer and invokes the validation method of the simple type at the time that
endElement() is called. Child elements are rejected as invalid. This validator
can handle simple types, or complex types with simple content: the attributes
are validated by the superclass, Validator.
| Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
|
Method Summary |
void |
characters(java.lang.CharSequence chars,
int properties)
Handle character data |
void |
endElement()
End of element being validated |
protected Validator |
getChildValidator()
Return a validator to handle the children of the element just started. |
java.lang.CharSequence |
getSimpleContent()
|
int |
getTypeAnnotation()
Get the type annotation to be used for an element or attribute that conforms
to the type being validated against |
void |
startElement(int nameCode,
int typeCode,
int properties)
Output element start tag (for a child of the element being validated) |
| Methods inherited from class com.saxonica.validate.Validator |
checkDerivation, getAnnotation, getColumnNumber, getContainingElement, getContainingElementName, getElementDeclaration, getLineNumber, getNamespaceResolver, getPublicId, getSystemId, isNillable, makeValidator, makeValidator, makeValidator, setAnnotation, setContainingElement, setDocumentLocator, setElementDeclaration, setNamespaceResolver, setNillable, setXSIType |
| Methods inherited from class net.sf.saxon.event.ProxyReceiver |
comment, endDocument, getConfiguration, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startDocument |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.xml.transform.Result |
getSystemId |
SimpleContentValidator
public SimpleContentValidator(ElementDecl declaration,
SchemaType type)
- Create a simple content validator
- Parameters:
declaration - The element declaration (may be null). Used to check fixed/default valuestype - The schema type of the element
getTypeAnnotation
public int getTypeAnnotation()
- Get the type annotation to be used for an element or attribute that conforms
to the type being validated against
- Specified by:
getTypeAnnotation in class Validator
startElement
public void startElement(int nameCode,
int typeCode,
int properties)
throws javax.xml.transform.TransformerException
- Output element start tag (for a child of the element being validated)
- Specified by:
startElement in interface Receiver- Overrides:
startElement in class AttributeValidator
- Parameters:
nameCode - integer code identifying the name of the element within the name pool.typeCode - integer code identifying the element's type within the name pool.
javax.xml.transform.TransformerException
getChildValidator
protected Validator getChildValidator()
- Return a validator to handle the children of the element just started.
This will never be called, because an exception would have been thrown when
the element was started
- Specified by:
getChildValidator in class Validator
characters
public void characters(java.lang.CharSequence chars,
int properties)
throws javax.xml.transform.TransformerException
- Handle character data
- Specified by:
characters in interface Receiver- Overrides:
characters in class AttributeValidator
- Parameters:
chars - properties -
- Throws:
javax.xml.transform.TransformerException
endElement
public void endElement()
throws javax.xml.transform.TransformerException
- End of element being validated
- Specified by:
endElement in interface Receiver- Overrides:
endElement in class ProxyReceiver
javax.xml.transform.TransformerException
getSimpleContent
public java.lang.CharSequence getSimpleContent()
Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.