<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 09 20:48:26 GMT 2011 --> <TITLE> SchemaValidator </TITLE> <META NAME="date" CONTENT="2011-12-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SchemaValidator"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../net/sf/saxon/s9api/SchemaManager.html" title="class in net.sf.saxon.s9api"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/s9api/SequenceType.html" title="class in net.sf.saxon.s9api"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/s9api/SchemaValidator.html" target="_top"><B>FRAMES</B></A> <A HREF="SchemaValidator.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> net.sf.saxon.s9api</FONT> <BR> Class SchemaValidator</H2> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.saxon.s9api.SchemaValidator</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>SchemaValidator</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A></DL> </PRE> <P> A <tt>SchemaValidator</tt> is an object that is used for validating instance documents against a schema. The schema consists of the collection of schema components that are available within the schema cache maintained by the SchemaManager, together with any additional schema components located during the course of validation by means of an xsl:schemaLocation or xsi:noNamespaceSchemaLocation attribute within the instance document. <p>If validation fails, an exception is thrown. If validation succeeds, the validated document can optionally be written to a specified destination. This will be a copy of the original document, augmented with default values for absent elements and attributes, and carrying type annotations derived from the schema processing. Expansion of defaults can be suppressed by means of the method <A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setExpandAttributeDefaults(boolean)"><CODE>setExpandAttributeDefaults(boolean)</CODE></A>.</p> <p>A <tt>SchemaValidator</tt> is serially resuable but not thread-safe. That is, it should normally be used in the thread where it is created, but it can be used more than once, to validate multiple input documents.</p> <p>A <tt>SchemaValidator</tt> is a <tt>Destination</tt>, which allows it to receive the output of a query or transformation to be validated.</p> <p>Saxon does not deliver the full PSVI as described in the XML schema specifications, only the subset of the PSVI properties featured in the XDM data model.</p> <P> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#SchemaValidator(net.sf.saxon.Configuration)">SchemaValidator</A></B>(<A HREF="../../../../net/sf/saxon/Configuration.html" title="class in net.sf.saxon">Configuration</A> config)</CODE> <BR> </TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#close()">close</A></B>()</CODE> <BR> Close the destination, allowing resources to be released.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#getDestination()">getDestination</A></B>()</CODE> <BR> Get the Destination that will receive the validated document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#getDocumentElementName()">getDocumentElementName</A></B>()</CODE> <BR> Get the name of the required top-level element of the document to be validated.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../net/sf/saxon/type/SchemaType.html" title="interface in net.sf.saxon.type">SchemaType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#getDocumentElementType()">getDocumentElementType</A></B>()</CODE> <BR> Get the schema type against which the document element is to be validated</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#getDocumentElementTypeName()">getDocumentElementTypeName</A></B>()</CODE> <BR> Get the name of the required type of the top-level element of the document to be validated.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/ErrorListener.html?is-external=true" title="class or interface in javax.xml.transform">ErrorListener</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#getErrorListener()">getErrorListener</A></B>()</CODE> <BR> Get the ErrorListener being used while validating instance documents</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/event/Receiver.html" title="interface in net.sf.saxon.event">Receiver</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#getReceiver(net.sf.saxon.Configuration)">getReceiver</A></B>(<A HREF="../../../../net/sf/saxon/Configuration.html" title="class in net.sf.saxon">Configuration</A> config)</CODE> <BR> Return a Receiver.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#isExpandAttributeDefaults()">isExpandAttributeDefaults</A></B>()</CODE> <BR> Ask whether attribute defaults defined in a schema are to be expanded or not (by default, fixed and default attribute values are expanded, that is, they are inserted into the document during validation as if they were present in the instance being validated)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#isLax()">isLax</A></B>()</CODE> <BR> Ask whether validation is to be in lax mode.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#isUseXsiSchemaLocation()">isUseXsiSchemaLocation</A></B>()</CODE> <BR> Ask whether the schema processor is to take account of any xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes encountered while validating an instance document</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setDestination(net.sf.saxon.s9api.Destination)">setDestination</A></B>(<A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A> destination)</CODE> <BR> Set the Destination to receive the validated document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setDocumentElementName(net.sf.saxon.s9api.QName)">setDocumentElementName</A></B>(<A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> name)</CODE> <BR> Set the name of the required top-level element of the document to be validated (that is, the name of the outermost element of the document).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setDocumentElementTypeName(net.sf.saxon.s9api.QName)">setDocumentElementTypeName</A></B>(<A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> name)</CODE> <BR> Set the name of the required type of the top-level element of the document to be validated.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setErrorListener(javax.xml.transform.ErrorListener)">setErrorListener</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/ErrorListener.html?is-external=true" title="class or interface in javax.xml.transform">ErrorListener</A> listener)</CODE> <BR> Set the ErrorListener to be used while validating instance documents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setExpandAttributeDefaults(boolean)">setExpandAttributeDefaults</A></B>(boolean expand)</CODE> <BR> Set whether attribute defaults defined in a schema are to be expanded or not (by default, fixed and default attribute values are expanded, that is, they are inserted into the document during validation as if they were present in the instance being validated)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setLax(boolean)">setLax</A></B>(boolean lax)</CODE> <BR> The validation mode may be either strict or lax.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#setUseXsiSchemaLocation(boolean)">setUseXsiSchemaLocation</A></B>(boolean recognize)</CODE> <BR> Say whether the schema processor is to take account of any xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes encountered while validating an instance document</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/SchemaValidator.html#validate(javax.xml.transform.Source)">validate</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source)</CODE> <BR> Validate an instance document supplied as a Source object</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="SchemaValidator(net.sf.saxon.Configuration)"><!-- --></A><H3> SchemaValidator</H3> <PRE> protected <B>SchemaValidator</B>(<A HREF="../../../../net/sf/saxon/Configuration.html" title="class in net.sf.saxon">Configuration</A> config)</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setLax(boolean)"><!-- --></A><H3> setLax</H3> <PRE> public void <B>setLax</B>(boolean lax)</PRE> <DL> <DD>The validation mode may be either strict or lax. The default is strict; this method may be called to indicate that lax validation is required. With strict validation, validation fails if no element declaration can be located for the outermost element. With lax validation, the absence of an element declaration results in the content being considered valid. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lax</CODE> - true if validation is to be lax, false if it is to be strict</DL> </DD> </DL> <HR> <A NAME="isLax()"><!-- --></A><H3> isLax</H3> <PRE> public boolean <B>isLax</B>()</PRE> <DL> <DD>Ask whether validation is to be in lax mode. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>true if validation is to be in lax mode, false if it is to be in strict mode.</DL> </DD> </DL> <HR> <A NAME="setErrorListener(javax.xml.transform.ErrorListener)"><!-- --></A><H3> setErrorListener</H3> <PRE> public void <B>setErrorListener</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/ErrorListener.html?is-external=true" title="class or interface in javax.xml.transform">ErrorListener</A> listener)</PRE> <DL> <DD>Set the ErrorListener to be used while validating instance documents. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - The error listener to be used. This is notified of all errors detected during the validation episode.</DL> </DD> </DL> <HR> <A NAME="getErrorListener()"><!-- --></A><H3> getErrorListener</H3> <PRE> public <A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/ErrorListener.html?is-external=true" title="class or interface in javax.xml.transform">ErrorListener</A> <B>getErrorListener</B>()</PRE> <DL> <DD>Get the ErrorListener being used while validating instance documents <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>listener The error listener in use. This is notified of all errors detected during the validation episode. Returns null if no user-supplied ErrorListener has been set.</DL> </DD> </DL> <HR> <A NAME="setUseXsiSchemaLocation(boolean)"><!-- --></A><H3> setUseXsiSchemaLocation</H3> <PRE> public void <B>setUseXsiSchemaLocation</B>(boolean recognize)</PRE> <DL> <DD>Say whether the schema processor is to take account of any xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes encountered while validating an instance document <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>recognize</CODE> - true if these two attributes are to be recognized; false if they are to be ignored. Default is true.</DL> </DD> </DL> <HR> <A NAME="isUseXsiSchemaLocation()"><!-- --></A><H3> isUseXsiSchemaLocation</H3> <PRE> public boolean <B>isUseXsiSchemaLocation</B>()</PRE> <DL> <DD>Ask whether the schema processor is to take account of any xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes encountered while validating an instance document <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>true if these two attributes are to be recognized; false if they are to be ignored. Default is true.</DL> </DD> </DL> <HR> <A NAME="setDestination(net.sf.saxon.s9api.Destination)"><!-- --></A><H3> setDestination</H3> <PRE> public void <B>setDestination</B>(<A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A> destination)</PRE> <DL> <DD>Set the Destination to receive the validated document. If no destination is supplied, the validated document is discarded. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>destination</CODE> - the destination to receive the validated document</DL> </DD> </DL> <HR> <A NAME="getDestination()"><!-- --></A><H3> getDestination</H3> <PRE> public <A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A> <B>getDestination</B>()</PRE> <DL> <DD>Get the Destination that will receive the validated document. Return null if no destination has been set. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the destination to receive the validated document, or null if none has been supplied</DL> </DD> </DL> <HR> <A NAME="setDocumentElementName(net.sf.saxon.s9api.QName)"><!-- --></A><H3> setDocumentElementName</H3> <PRE> public void <B>setDocumentElementName</B>(<A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> name)</PRE> <DL> <DD>Set the name of the required top-level element of the document to be validated (that is, the name of the outermost element of the document). If no value is supplied, there is no constraint on the required element name <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the document element, as a QName; or null to remove a previously-specified value.</DL> </DD> </DL> <HR> <A NAME="getDocumentElementName()"><!-- --></A><H3> getDocumentElementName</H3> <PRE> public <A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> <B>getDocumentElementName</B>()</PRE> <DL> <DD>Get the name of the required top-level element of the document to be validated. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the name of the required document element, or null if no value has been set.</DL> </DD> </DL> <HR> <A NAME="setDocumentElementTypeName(net.sf.saxon.s9api.QName)"><!-- --></A><H3> setDocumentElementTypeName</H3> <PRE> public void <B>setDocumentElementTypeName</B>(<A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> name) throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Set the name of the required type of the top-level element of the document to be validated. If no value is supplied, there is no constraint on the required type <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the type of the document element, as a QName; or null to remove a previously-specified value. This must be the name of a type in the schema (typically but not necessarily a complex type). <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if there is no known type with this name</DL> </DD> </DL> <HR> <A NAME="getDocumentElementTypeName()"><!-- --></A><H3> getDocumentElementTypeName</H3> <PRE> public <A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> <B>getDocumentElementTypeName</B>()</PRE> <DL> <DD>Get the name of the required type of the top-level element of the document to be validated. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the name of the required type of the document element, or null if no value has been set.</DL> </DD> </DL> <HR> <A NAME="getDocumentElementType()"><!-- --></A><H3> getDocumentElementType</H3> <PRE> protected <A HREF="../../../../net/sf/saxon/type/SchemaType.html" title="interface in net.sf.saxon.type">SchemaType</A> <B>getDocumentElementType</B>()</PRE> <DL> <DD>Get the schema type against which the document element is to be validated <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the schema type</DL> </DD> </DL> <HR> <A NAME="setExpandAttributeDefaults(boolean)"><!-- --></A><H3> setExpandAttributeDefaults</H3> <PRE> public void <B>setExpandAttributeDefaults</B>(boolean expand)</PRE> <DL> <DD>Set whether attribute defaults defined in a schema are to be expanded or not (by default, fixed and default attribute values are expanded, that is, they are inserted into the document during validation as if they were present in the instance being validated) <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>expand</CODE> - true if defaults are to be expanded, false if not</DL> </DD> </DL> <HR> <A NAME="isExpandAttributeDefaults()"><!-- --></A><H3> isExpandAttributeDefaults</H3> <PRE> public boolean <B>isExpandAttributeDefaults</B>()</PRE> <DL> <DD>Ask whether attribute defaults defined in a schema are to be expanded or not (by default, fixed and default attribute values are expanded, that is, they are inserted into the document during validation as if they were present in the instance being validated) <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>true if defaults are to be expanded, false if not</DL> </DD> </DL> <HR> <A NAME="validate(javax.xml.transform.Source)"><!-- --></A><H3> validate</H3> <PRE> public void <B>validate</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Validate an instance document supplied as a Source object <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>source</CODE> - the instance document to be validated. The call getSystemId() applied to this source object must return the base URI used for dereferencing any xsi:schemaLocation or xsi:noNamespaceSchemaLocation attributes <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if the source document is found to be invalid</DL> </DD> </DL> <HR> <A NAME="getReceiver(net.sf.saxon.Configuration)"><!-- --></A><H3> getReceiver</H3> <PRE> public <A HREF="../../../../net/sf/saxon/event/Receiver.html" title="interface in net.sf.saxon.event">Receiver</A> <B>getReceiver</B>(<A HREF="../../../../net/sf/saxon/Configuration.html" title="class in net.sf.saxon">Configuration</A> config) throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../../net/sf/saxon/s9api/Destination.html#getReceiver(net.sf.saxon.Configuration)">Destination</A></CODE></B></DD> <DD>Return a Receiver. Saxon calls this method to obtain a Receiver, to which it then sends a sequence of events representing the content of an XML document. The method is intended primarily for internal use, and may give poor diagnostics if used incorrectly. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sf/saxon/s9api/Destination.html#getReceiver(net.sf.saxon.Configuration)">getReceiver</A></CODE> in interface <CODE><A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>config</CODE> - The Saxon configuration. This is supplied so that the destination can use information from the configuration (for example, a reference to the name pool) to construct or configure the returned Receiver. <DT><B>Returns:</B><DD>the Receiver to which events are to be sent. It is the caller's responsibility to initialize this Receiver with a <A HREF="../../../../net/sf/saxon/event/PipelineConfiguration.html" title="class in net.sf.saxon.event"><CODE>PipelineConfiguration</CODE></A> before calling its <code>open()</code> method. The caller is also responsible for ensuring that the sequence of events sent to the Receiver represents a well-formed document: in particular the event stream must include namespace events corresponding exactly to the namespace declarations that are required. If the calling code cannot guarantee this, it should insert a <A HREF="../../../../net/sf/saxon/event/NamespaceReducer.html" title="class in net.sf.saxon.event"><CODE>NamespaceReducer</CODE></A> into the pipeline in front of the returned Receiver. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if the Receiver cannot be created</DL> </DD> </DL> <HR> <A NAME="close()"><!-- --></A><H3> close</H3> <PRE> public void <B>close</B>() throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Close the destination, allowing resources to be released. Saxon calls this method when it has finished writing to the destination. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sf/saxon/s9api/Destination.html#close()">close</A></CODE> in interface <CODE><A HREF="../../../../net/sf/saxon/s9api/Destination.html" title="interface in net.sf.saxon.s9api">Destination</A></CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if any failure occurs</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../net/sf/saxon/s9api/SchemaManager.html" title="class in net.sf.saxon.s9api"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/s9api/SequenceType.html" title="class in net.sf.saxon.s9api"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/s9api/SchemaValidator.html" target="_top"><B>FRAMES</B></A> <A HREF="SchemaValidator.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright (c) 2004-2011 Saxonica Limited. All rights reserved. </BODY> </HTML>