Free Trial - Stylus Studio, The World's Best XML IDE!


com.saxonica.validate
Class ComplexContentValidator

java.lang.Object
  |
  +--net.sf.saxon.event.ProxyReceiver
        |
        +--com.saxonica.validate.Validator
              |
              +--com.saxonica.validate.AttributeValidator
                    |
                    +--com.saxonica.validate.ComplexContentValidator
All Implemented Interfaces:
Receiver, javax.xml.transform.Result, javax.xml.transform.SourceLocator

public class ComplexContentValidator
extends AttributeValidator

This class is a filter that is used to validate the content of an element with a complex type. As each child element is encountered, it is used to compute a transition in the finite state machine compiled for the given complex type.


Field Summary
 
Fields inherited from class com.saxonica.validate.AttributeValidator
nil
 
Fields inherited from class com.saxonica.validate.Validator
xsiType
 
Fields inherited from class net.sf.saxon.event.ProxyReceiver
baseReceiver, config, systemId
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
protected ComplexContentValidator()
           
  ComplexContentValidator(UserComplexType type)
          Create a ComplexContentValidator for a given type
 
Method Summary
 void characters(java.lang.CharSequence chars, int properties)
          Handle character data appearing as a child of the element being validated
 void endElement()
          Validation at the end of the element being validated.
protected  Validator getChildValidator()
          Get a validator to handle the children of the current element.
 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)
          Handle the start tag for a child element of the element being validated
 
Methods inherited from class com.saxonica.validate.AttributeValidator
attribute, isNil, setAttributeGroup, startContent
 
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 net.sf.saxon.event.Receiver
comment, endDocument, getConfiguration, namespace, processingInstruction, setConfiguration, setDocumentLocator, setSystemId, setUnparsedEntity, startDocument
 
Methods inherited from interface javax.xml.transform.Result
getSystemId
 

Constructor Detail

ComplexContentValidator

protected ComplexContentValidator()

ComplexContentValidator

public ComplexContentValidator(UserComplexType type)
Create a ComplexContentValidator for a given type

Parameters:
type - the complex type
Method Detail

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
Handle the start tag for a child element 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()
Get a validator to handle the children of the current element. This is called immediately on return from the startElement call that starts this element.

Specified by:
getChildValidator in class Validator

characters

public void characters(java.lang.CharSequence chars,
                       int properties)
                throws javax.xml.transform.TransformerException
Handle character data appearing as a child of the element being validated

Specified by:
characters in interface Receiver
Overrides:
characters in class AttributeValidator
Parameters:
chars - The character content
properties - Additional properties
Throws:
javax.xml.transform.TransformerException - If this element does not allow character data

endElement

public void endElement()
                throws javax.xml.transform.TransformerException
Validation at the end of the element being validated.

Specified by:
endElement in interface Receiver
Overrides:
endElement in class ProxyReceiver
Throws:
javax.xml.transform.TransformerException - if the element is invalid


Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.