Javax.Xml.Validation.SchemaFactory.NewSchema Method
Parses the specified source(s) as a schema and returns it as a schema.

Syntax

[Android.Runtime.Register("newSchema", "([Ljavax/xml/transform/Source;)Ljavax/xml/validation/Schema;", "GetNewSchema_arrayLjavax_xml_transform_Source_Handler")]
public abstract Schema NewSchema (Javax.Xml.Transform.ISource[] schemas)

Parameters

schemas
inputs to be parsed. Javax.Xml.Validation.SchemaFactory is required to recognize Javax.Xml.Transform.Stream.StreamSource, Javax.Xml.Transform.Sax.SAXSource, and Javax.Xml.Transform.Dom.DOMSource.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Org.Xml.Sax.SAXExceptionIf an error is found during processing the specified inputs. When an Org.Xml.Sax.IErrorHandler is set, errors are reported to there first. See SchemaFactory.ErrorHandler.
Java.Lang.NullPointerExceptionIf the schemas parameter itself is null or any item in the array is null.
Java.Lang.IllegalArgumentExceptionIf any item in the array is not recognized by this method.
Java.Lang.UnsupportedOperationExceptionIf the schema language doesn't support this operation.

Remarks

Parses the specified source(s) as a schema and returns it as a schema.

The callee will read all the Javax.Xml.Transform.ISources and combine them into a single schema. The exact semantics of the combination depends on the schema language that this Javax.Xml.Validation.SchemaFactory object is created for.

When an Org.Xml.Sax.IErrorHandler is set, the callee will report all the errors found in sources to the handler. If the handler throws an exception, it will abort the schema compilation and the same exception will be thrown from this method. Also, after an error is reported to a handler, the callee is allowed to abort the further processing by throwing it. If an error handler is not set, the callee will throw the first error it finds in the sources.

W3C XML Schema 1.0

The resulting schema contains components from the specified sources. The same result would be achieved if all these sources were imported, using appropriate values for schemaLocation and namespace, into a single schema document with a different targetNamespace and no components of its own, if the import elements were given in the same order as the sources. Section 4.2.3 of the XML Schema recommendation describes the options processors have in this regard. While a processor should be consistent in its treatment of JAXP schema sources and XML Schema imports, the behavior between JAXP-compliant parsers may vary; in particular, parsers may choose to ignore all but the first <import> for a given namespace, regardless of information provided in schemaLocation.

If the parsed set of schemas includes error(s) as specified in the section 5.1 of the XML Schema spec, then the error must be reported to the Org.Xml.Sax.IErrorHandler.

RELAX NG

For RELAX NG, this method must throw Java.Lang.UnsupportedOperationException if schemas.length!=1.

[Android Documentation]

Requirements

Namespace: Javax.Xml.Validation
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8