Skip Headers

Oracle9i Supplied Java Packages Reference
Release 2 (9.2)

Part Number A96609-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

7
Package oracle.XML.parser.schema

This chapter describes the oracle.XML.parser.schema package. The classes contained in package oracle.XML.parser.schema implement the Oracle XML Schema Processor for Java.

In addition to the class reference, this chapter contains these sections:


Package oracle.XML.parser.schema Description

The classes contained in package oracle.XML.parser.schema implement the Oracle XML Schema Processor for Java and support the World Wide Web Consortium (W3C) XML Schema specification.

XML Schema can be used to define a class of XML documents. The term instance document describes an XML document that conforms to a particular XML Schema definition or XSD. This document assumes familiarity with the W3C recommendations for XML Schema. The W3C recommendations can be found at http://www.w3.org/.

Features in Oracle XML Schema Processor for Java

The Oracle XML Schema Processor for Java is built on the Oracle XML Parser for Java v2 and includes these features:

What's Needed to Run XML Schema Processor for Java

To run XML Schema Processor for Java, you need an operating system that supports Java 1.1.x or above and the JDK 1.1.x. or above.

See Also:

Package oracle.XML.parser.schema Summary

The classes contained in package oracle.xml.parser.schema implement support for XML Schema and for XML Schema Definition.

Table 7-1 Summary of oracle.XML.parser.schema Classes and Interfaces 
Class/Interface Description

XMLSchema Class

Sets top-level XMLSchema document declarations, definitions, schema location, and schema target namespace.

XMLSchemaNode

Sets top-level XMLSchema document declarations and definitions plus schema location and schema target namespace.

XSDAttribute Class

Represents the complexType attribute group.

XSDBuilder Class

Builds an XMLSchema object from XMLSchema document.

XSDComplexType Class

Manages XML Schema Definition (XSD) for complexType for the XML document.

XSDConstants Interface

Implements the XSDContants interface.

XSDConstrainingFacet Class

Implements XSDTypeConstants.

XSDDataValue Class

Implements XSDTypeConstants.

XSDElement Class

Presents XMLSchema Definition for element.

XSDException

Indicates that an exception occurred during XMLSchema validation.

XSDGroup Class

Presents the complexType model group.

XSDIdentity Class

Presents identity parameters for the XSD.

XSDNode Class

Root class for most of XSD classes.

XSDSimpleType Class

Implements XSDTypeContstants to derive a type.

XSDTypeConstants Interface

Implements the interface for XSDTypeConstants.

XSDValidator Class

Validates an instance XML document against an XMLSchema.


XMLSchema Class

Description

This class contains a set of XML Schemas for different target namespaces. They are used by XSDParser for validation of instance XML documents, and by XSDBuilder as imported schemas.

Syntax

public class XMLSchema extends oracle.xml.parser.schema.XSDNode
 
oracle.xml.parser.schema.XSDNode
  |
  +--oracle.xml.parser.schema.XMLSchema


Methods

Table 7-2  Methods of XMLSchemaNode
Method Description

XMLSchema()

Class constructor.

getAllTargetNS()

Get all target namespaces for this set of Schemas.

getSchemaByTargetNS()

Get Schema node for the given namespace.

getSchemaTargetNS()

Get the top level Schema's target namespace.

getXMLSchemaNodeTable()

Get Schema node hashtable.

getXMLSchemaURLS()

Get the Schema URL.

printSchema()

Print the given Schema.

XMLSchema()

Description

XMLSchema class constructor.

Syntax

Table 7-3 Versions of XMLSchema Constructor
Syntax

public XMLSchema() throws XSDException

public XMLSchema(int n) throws XSDException

Parameters

Table 7-4 Parameters of XMLSchema Constructor
Parameter Description

n

Initial size of schemanode set

getAllTargetNS()

Description

Get all the Target Name spaces defined in the Schema.

Syntax

public java.lang.String[] getAllTargetNS()

getSchemaByTargetNS()

Description

Get schemaNode for the given namespace.

Syntax

public XMLSchemaNode getSchemaByTargetNS(java.lang.String namespace)

Parameters

namespace - Target namespace of the required schema

Returns

XMLSchemaNode

getSchemaTargetNS()

Description

Get the top level schema's target Namespace. In case there are more than one top level schema, the last one being built is returned.

Syntax

public java.lang.String getSchemaTargetNS()

getXMLSchemaNodeTable()

Description

Get XMLSchemaNode table

Syntax

public java.util.Hashtable getXMLSchemaNodeTable()

Returns

Hashtable

getXMLSchemaURLS()

Description

Get XMLSchema URLs

Syntax

public java.lang.String[] getXMLSchemaURLS()

Returns

Array of schema URLs

printSchema()

Description

Print schema information.

Syntax

Table 7-5 Versions of printSchema() 
Syntax Description

public void printSchema()

Prints schema information

public void printSchema( boolean all)

Prints schema information, including buildins

Parameters

Table 7-6 Parameters of printSchema
Parameter Description

all

Flag to indicate that all information, including built-ins, should be printed.


XMLSchemaNode


Description of XMLSchemaNode

XMLSchemaNode class sets top-level XMLSchema document declarations and definitions plus schema location and schema target namespace. XMLSchema objects are created by XSDBuilder as a result of processing XMLSchema documents.


Syntax of XMLSchemaNode

public class XMLSchemaNode extends oracle.xml.parser.schema.XSDNode
 
oracle.xml.parser.schema.XSDNode
  |
  +--oracle.xml.parser.schema.XMLSchemaNode


Methods of XMLSchemaNode

Table 7-7 Summary of Methods of XMLSchemaNode
Method Description

XMLSchemaNode()

XNLSchema constructor

getAttributeDeclarations()

Get all the top level attributes in the schema

getComplexTypeSet()

Get all the top level attributes in the schema

getComplexTypeSet()

Get all the top level complexType elements in the schema

getComplexTypeTable()

Get the complexType definitions

getElementSet()

Get all the top level elements in the schema

getSimpleTypeSet()

Get all the top level simpleType elements in the schema

getSimpleTypeTable()

Get the simple type definitions

getTargetNS()

Get targetNS of the schema

getTypeDefinitionTable()

Get the type definitions

XMLSchemaNode()

Description

XNLSchema constructor.

Syntax

public  XMLSchemaNode()

getAttributeDeclarations()

Description

Get all the top level attributes in the schema

Syntax

public XSDAttribute getAttributeDeclarations()

Returns

an array of top level attribute definitions

getComplexTypeSet()

Description

Get all the top level complexType elements in the schema

Syntax

public XSDNode getComplexTypeSet()

Returns

an array of top level complexType nodes

getComplexTypeTable()

Description

Get the complexType definitions

Syntax

public java.util.Hashtable getComplexTypeTable()

Returns

Hashtable of complexTypes

getElementSet()

Description

Get all the top level elements in the schema

Syntax

public XSDNode getElementSet()

Returns

an array of top level XSDNode elements

getSimpleTypeSet()

Description

Get all the top level simpleType elements in the schema

Syntax

public XSDNode getSimpleTypeSet()

Returns

an array of top level simpleType nodes

getSimpleTypeTable()

Description

Get the simple type definitions

Syntax

public java.util.Hashtable getSimpleTypeTable()

Returns

Hashtable of simpleTypes

getTargetNS()

Description

Get targetNS of the schema. Overrides XSDNode.getTargetNS() in class XSDNode.

Syntax

public java.lang.String getTargetNS()

Returns

value targetNS

getTypeDefinitionTable()

Description

Get the type definitions

Syntax

public java.util.Hashtable getTypeDefinitionTable()

Returns

Hashtable of type definitions


XSDAttribute Class


Description of XSDAttribute

XSDAttribute class. Represents the complexType attribute group for XMLSchema.


Syntax of XSDAttribute

public class XSDAttribute extends oracle.xml.parser.schema.XSDNode
 
oracle.xml.parser.schema.XSDNode
  |
  +--oracle.xml.parser.schema.XSDAttribute


Methods of XSDAttribute

Table 7-8 Summary of Methods of XSDAttribute 
Method Description

getDefaultVal()

Get the value of 'default' attr in case of element, and the value of 'value' attr based on 'use' attribute

getFixedVal()

Get the value of 'fixed' attr in case of element, and the value of 'value' attr based on 'use' attribute

getName()

Get the name of the node

getRefLocalname()

Get the local name of the resolved 'ref' attribute

getRefNamespace()

Get the namespace of the resolved 'ref' attribute

getRefState()

Get refState

getTargetNS()

Get target namespace

getType()

Get the node type

isRequired()

Check if the attribute is required

getDefaultVal()

Description

Get the value of 'default' attr in case of element, and the value of 'value' attr based on 'use' attribute

Syntax

public java.lang.String getDefaultVal()

Returns

defaultVal

getFixedVal()

Description

Get the value of 'fixed' attr in case of element, and the value of 'value' attr based on 'use' attribute

Syntax

public java.lang.String getFixedVal()

Returns

defaultVal

getName()

Description

Get the name of the node. Overrides XSDNode.getName() in class XSDNode

Syntax

public java.lang.String getName()

Returns

name

getRefLocalname()

Description

Get the local name of the resolved 'ref' attribute

Syntax

public java.lang.String getRefLocalname()

Returns

refLocalname

getRefNamespace()

Description

Get the namespace of the resolved 'ref' attribute

Syntax

public java.lang.String getRefNamespace()

Returns

refNamespace

getRefState()

Description

Get refState. The return value is one of the following: TYPE_UNRESOLVED, TYPE_RESOLVED, REF_UNRESOLVED, REF_RESOLVED

Syntax

public int getRefState()

Returns

refstate value

getTargetNS()

Description

Get target namespace

Syntax

public java.lang.String getTargetNS()

Overrides

XSDNode.getTargetNS() in class XSDNode

getType()

Description

Get the node type

Syntax

public XSDNode getType()

Returns

nodeType, which is either simpleType or complexType.

isRequired()

Description

Check if the attribute is required.

Syntax

public boolean isRequired()

XSDBuilder Class


Description of XSDBuilder

Builds an XMLSchema object from XMLSchema document. XMLSchema object is a set of objects (infoset) corresponding to top-level schema declarations and definitions. Schema document is 'XML' parsed and converted to a DOM tree. This schema DOM tree is 'Schema' parsed in a following order: (if any) builds a schema object and makes it visible. (if any) is replaced by corresponding DOM tree. Top-level declarations and definitions are registered as a current schema infoset of items. Finally, top-level tree elements (infoset items) are 'Schema' parsed. The resulting XMLSchema object is a set (infoset) of objects (top-level input elements). Object's contents is a tree with nodes corresponding to low-level element/group decls/refs preceded by node/object of type SNode containing cardinality info (min/maxOccurs).


Syntax of XSDBuilder

public class XSDBuilder extends oracle.xml.parser.schema.XSDNode
 
oracle.xml.parser.schema.XSDNode
  |
  +--oracle.xml.parser.schema.XSDBuilder


Methods of XSDBuilder

Table 7-9 Summary of Methods of XSDBuilder  
Method Description

XSDBuilder()

Class constructor

build()

Build an XMLSchema object or document

getObject()

Returns XML schema object.

setEntityResolver()

Set an EntityResolver for resolving imports/include

setError()

Sets XMLError object.

setLocale()

Sets locale for error reporting.

XSDBuilder()

Description

XSDBuilder constructor.

Syntax

public XSDBuilder() throws XSDException

build()

Description

Build an XMLSchema object/document.

Syntax

Table 7-10 Syntax of build()  
Syntax

public Object build(InputStream in, URL baseurl) throws Exception

public Object build(Reader r, URL baseurl) throws Exception

public Object build(String sysId) throws Exception

public Object build(String ns, String sysid) throws Exception

public Object build(String ns, URL sysid) throws Exception

public Object build(URL schemaurl) throws Exception

public Object build(XMLDocument schemaDoc) throws Exception

public Object build(XMLDocument[] schemaDocs, URL baseurl)

public Object build(XMLDocument doc, String fragment, String ns, URL sysid)

public Object build(XMLDocument schemaDoc, URL baseurl)

Parameters

Table 7-11 Parameters of build()
Parameter Description

baseurl

URL used to resolve any relative refs; used for any import/include in document

doc

XMLdocument contain the schema element

fragment

Fragment ID of the schema element

in

Inputstream of Schema

ns

Schema target namespace used to validate targetNamespace

r

Reader of Schema

schemaDoc

XMLDocument

schemaDocs

Array of XMLDocuments

sysId

Schema location

url

URL of Schema

Returns

Object - XMLSchema

Throws

An Exception is thrown if Builder fails to build an XMLSchema object.

getObject()

Description

Returns XML schema object.

Syntax

public Object getObject()

Returns

XMLSchema object.

setEntityResolver()

Description

Set an EntityResolver for resolving imports/include. See also org.xml.sax.EintityResolver.

Syntax

public void setEntityResolver( org.xml.sax.entityResolver entResolver)

Parameters

Table 7-12 Parameters of setEntityResolver
Parameter Description

entResolver

EntityResolver

setError()

Description

Sets XMLError error object.

Syntax

public void setError(XMLError er)

Parameters

Table 7-13 Parameters of setError
Parameter Description

er

XMLError object

setLocale()

Description

Sets locale for error reporting.

Syntax

public void setLocale(Locale locale)

Parameters

Table 7-14 Parameters of setLocale
Parameter Description

locale

Locale object


XSDComplexType Class


Description of XSDComplexType

XSDComplexType class manages the complexType for XML Schema Definition (XSD) for XML document. In XML Schema, the structure of the instance document or an element is called complexType.


Syntax of XSDComplexType

public class XSDComplexType extends oracle.xml.parser.schema.XSDNode
 
oracle.xml.parser.schema.XSDNode
  |
  +--oracle.xml.parser.schema.XSDComplexType


Methods XSDComplexType

Table 7-15  Summary of Methods of XSDComplexType
Method Description

getAttributeDeclarations()

Get attribute declarations of this complexType does not include wild card array of attribute declarations

getAttributeWildcard()

Get all the attributes of the complexType elements

getAttributeWildcard()

get attribute wildcard of this complexType

getBaseType()

Get all the local elements of the base Type of this complexType element

getBaseType()

Get the base type of this complexType

getContent()

Get the content of this complexType.

getDerivationMethod()

Get numeric code indicating how this type was derived from its parent type.

getElementSet()

Get all the local elements inside a complexType element If the complexType element extends another complexType element

getGroup()

Get the attribute group or the child and attribute group

getRefLocalname()

Get the local name of resolved 'base' attr

getTypeGroup()

Get the kind of group for this complexType.

init()

Initialize this group.

isAbstract()

Declare abstract or not abstract for this complexType, with Boolean true or false.

getAttributeDeclarations()

Description

Get attribute declarations of this complexType; does not include wild card array of attribute declarations

Syntax

public XSDAttribute getAttributeDeclarations()

getAttributeWildcard()

Description

Get attribute wildcard of this complexType.

Syntax

public oracle.xml.parser.schema.XSDAny getAttributeWildcard()

Returns

The attribute wildcard, if this type has one.

getBaseType()

Description

Get the base type of this complexType.

Syntax

public XSDNode getBaseType()

Returns

XSDNode - base type

getContent()

Description

Get the content of this complexType.

Syntax

public int getContent()

getDerivationMethod()

Description

Returns a numeric code indicating the kind of derivation used to construct this type.

Syntax

public short getDerivationMethod()

Returns

A code number for: EXTENSION_DERIVATION or RESTRICTION_DERIVATION.

getElementSet()

Description

Gets all the local elements inside a complexType element if the complexType element extends another complexType element

Syntax

public XSDNode getElementSet()

Returns

an array of local elements

getGroup()

Description

Get the attribute group or the child and attribute group

Syntax

public XSDGroup getGroup()

Returns

group

getRefLocalname()

Description

Get the local name of resolved 'base' attr

Syntax

public java.lang.String getRefLocalname()

Returns

refLocalname

getTypeGroup()

Description

Get the kind of group for this complexType as either: model group or attribute group.

Syntax

public XSDGroup getTypeGroup()

init()

Description

Initialize this group.

Syntax

public static void init()

isAbstract()

Description

Make the group abstract or not abstract, with Boolean true or false.

Syntax

public boolean isAbstract()

XSDConstants Interface


Description of XSDConstants

Implements the XSDConstants interface.


Syntax of XSDConstants

public class XSDConstants

oracle.xml.parser.schema.XSDConstants

Methods of XSDConstants

XSDConstants()

Description

Class constructor.

Syntax

public XSDConstants()

XSDConstrainingFacet Class


Description of XSDConstrainingFacet

Implements XSDTypeConstants. XML Schema defines fifteen facets for applying constraints when deriving a datatype through restriction. Facets constrain the permitted values of a datatype.

Some facets use a value space for defining the restrictions on a datatype. A value space is the set of values for a given datatype. A lexical space is the set of valid literals for a datatype. Enumeration constrains the value space to a specified set of values. Each value in the value space of a datatype is denoted by one or more literals in its lexical space.


Syntax of XSDConstrainingFacet

public class XSDConstrainingFacet extends java.lang.Object implements 
oracle.xml.parser.schema.XSDTypeConstants
 
java.lang.Object
  |
  +--oracle.xml.parser.schema.XSDConstrainingFacet


Implemented Interfaces of XSDConstrainingFacet

XSDTypeConstants

Methods of XSDConstrainingFacet

Table 7-16 Summary of Methods of XSDConstrainingFacet  
Method Description

getFacetId()

Get ID for the facet.

getLexicalEnumeration()

Get the starting and ending points for the enumerated literals that define the value space for this facet.

getLexicalValue()

Get value for lexical space for facet.

getName()

Get name of facet.

isFixed(boolean)

Declare facet is fixed or not fixed, with Boolean true or false.

validateFacet(XSDDataValue)

Validate facet against datatype.

getFacetId()

Description

Get the facet ID.

Syntax

public int getFacetId()

getLexicalEnumeration()

Description

Get the starting and ending points for the enumerated literals that define the value space for this facet.

Syntax

public java.util.Vector getLexicalEnumeration()

getLexicalValue()

Description

Get value for lexical space for facet.

Syntax

public java.lang.String getLexicalValue()

getName()

Description

Get name of facet.

Syntax

public java.lang.String getName()

isFixed(boolean)

Description

Declare facet is fixed or not fixed, with Boolean true or false.

Syntax

public boolean isFixed(boolean fixed)

validateFacet(XSDDataValue)

Description

Validate facet against XML Schema Definition.

Syntax

public void validateFacet(XSDDataValue value)

XSDDataValue Class


Description of XSDDataValue

Implements XSDTypeConstants


Syntax of XSDDataValue

public class XSDDataValue extends java.lang.Object implements 
oracle.xml.parser.schema.XSDTypeConstants
 
java.lang.Object
  |
  +--oracle.xml.parser.schema.XSDDataValue


Implemented Interfaces of XSDDataValue

XSDTypeConstants


Methods of XSDDataValue

Table 7-17 Summary of Methods of XSDDataValue
Method Description

compareTo()

Compare two values return int -1 -- smaller, 0 -- equal, 1 -- greater

getLength()

Gets the length of STRING/BINARY value.

getLexicalValue()

Gets LEXICAL value from the XSDDataValue class return String value

getPrecision()

Gets the precision of decimal value return int precision

getScale()

Gets the scale of decimal value return int scale

compareTo()

Description

Compare two values; return int -1 -- smaller, 0 -- equal, 1 -- greater

Syntax

public int compareTo(XSDDataValue val)

Throws

XSDException - if the data values are not comparable

getLength()

Description

Gets the length of STRING/BINARY value; return int length.

Syntax

public int getLength()

Throws

XSDException - if the data value is not of String/Binary type

getLexicalValue()

Description

Gets LEXICAL value from the XSDDataValue class; return String value

Syntax

public java.lang.String getLexicalValue()

getPrecision()

Description

Gets the precision of decimal value return int precision

Syntax

public int getPrecision()

Throws

XSDException - if the data value is not of decimal type

getScale()

Description

Gets the scale of decimal value return int scale

Syntax

public int getScale()

Throws

XSDException - if the data value is not decimal type


XSDElement Class


Description of XSDElement

XSDElement class. Represents XMLSchema Definition for element.


Syntax of XSDElement

public class XSDElement
 
oracle.xml.parser.schema.XSDElement


Methods of XSDElement

Table 7-18 Summary of Methods of XSDElement  
Method Description

findEquivClass()

Find the equivalent class corresponding to this class

getDefaultVal()

Get the value of 'default' attr in case of element, and the value of 'value' attr based on 'use' attribute

getEquivClassRef()

Get the local name of the resolved derive class

getFixedVal()

Get the value of 'fixed' attr in case of element, and the value of 'value' attr based on 'use' attribute

getIdentities()

Returns the set of identities

getMaxOccurs()

Get the maxOccurs

getMinOccurs()

Get the minOccurs

getName()

Get Name

getRefLocalname()

Get the local name of the resolved 'ref' attribute

getRefNamespace()

Get the namespace of the resolved 'ref' attribute

getRefState()

Get refState

getSubstitutionGroup()

Get the substitutionGroup

getTargetNS()

Get target namespace

getType()

Get the node type

isAbstract()

Abstract, true or false.

isNullable()

Nullable, true or false.

setMaxOccurs()

Set the maxOccurs

setMinOccurs()

Set the minOccurs

findEquivClass()

Description

Find the equivalent class corresponding to this class

Syntax

public XSDElement findEquivClass(java.lang.String ns, java.lang.String nm)

Parameters

Table 7-19 Parameters of findEquivClass
Parameter Description

ns

namespace for class

nm

name of class

Returns

XSDElement

getDefaultVal()

Description

Get the value of 'default' attr in case of element, and the value of 'value' attr based on 'use' attribute

Syntax

public String getDefaultVal()

Returns

defaultVal

getEquivClassRef()

Description

Get the local name of the resolved equiv class

Syntax

public String getEquivClassRef()

Returns

equivRefLocalname

getFixedVal()

Description

Get the value of 'fixed' attr in case of element, and the value of 'value' attr based on 'use' attribute

Syntax

public java.lang.String getFixedVal()

Returns

defaultVal

getIdentities()

Description

Returns the set of identities

Syntax

public XSDIdentity getIdentities()

Returns

array of identities

getMaxOccurs()

Description

Get the maxOccurs

Syntax

public int getMaxOccurs()

Returns

maxOccurs

getMinOccurs()

Description

Get the minOccurs

Syntax

public int getMinOccurs()

Returns

minOccurs value

getName()

Description

Get the name of the node

Syntax

public String getName()

Returns

name

getRefLocalname()

Description

Get the local name of the resolved 'ref' attribute

Syntax

public String getRefLocalname()

Returns

refLocalname

getRefNamespace()

Description

Get the namespace of the resolved 'ref' attribute

Syntax

public String getRefNamespace()

Returns

refNamespace

getRefState()

Description

Get refState. The return value is one of the following: TYPE_UNRESOLVED, TYPE_RESOLVED, REF_UNRESOLVED, REF_RESOLVED

Syntax

public int getRefState()

Returns

refstate value

getSubstitutionGroup()

Description

Get the substitutionGroup

Syntax

public java.util.Vector getSubstitutionGroup()

getTargetNS()

Description

Get target namespace

Syntax

public java.lang.String getTargetNS()

getType()

Description

Get the node type

Syntax

public XSDNode getType()

Returns

nodeType, which is either simpleType or complexType

isAbstract()

Description

Declares is or is not abstract.

Syntax

public boolean isAbstract()

isNullable()

Description

Declares is or is not nullable.

Syntax

public boolean isNullable()

setMaxOccurs()

Description

Set the maxOccurs

Syntax

public void setMaxOccurs(int max)

Parameters

Table 7-20 Parameters of setMaxOccurs
Parameter Description

maxOccurs

value

setMinOccurs()

Description

Set the minOccurs

Syntax

public void setMinOccurs(int min)

Parameters

Table 7-21 Parameters of setMinOccurs
Parameter Description

minOccurs

value


XSDException


Description of XSDException

Indicates that an exception occurred during XMLSchema validation.


Syntax of XSDException

java.lang.Object
   |
   +---java.lang.Throwable
           |
           +---java.lang.Exception
                   |
                   +---oracle.xml.parser.schema.XSDException

public class XSDException 
extends Exception 

getMessage()

Description

Overrides getMessage in class Throwable, in order to construct error message from error id and error parameters. The options are described in Table 7-22:

Table 7-22 Versions of getMessage()  
Syntax Description

public String getMessage()

Constructs error message from error id and error parameters

public String getMessage(XMLError err)

Constructs localized error message based on the XMLError sent as parameter

Parameters

Table 7-23 Parameters of getMessage()
Parameter Description

err

XMLError class used to get the error message


XSDGroup Class


Description of XSDGroup

XSDGroup represents the model group for the XMLSchema. A model group may further contain model groups or element particles.


Syntax of XSDGroup

public class XSDGroup
 
oracle.xml.parser.schema.XSDGroup


Methods of XSDGroup

Table 7-24 Summary of Methods of XSDIdentity
Method Description

getMaxOccurs()

Get the maxOccurs

getMinOccurs()

Get the minOccurs

getNodeVector()

Get the particles of the group stored in nodeVector

getOrder()

Get the composite type - ALL, SEQUENCE, CHOICE

setMaxOccurs()

Set maxOccurs

setMinOccurs()

Set minOccurs

getMaxOccurs()

Description

Get the maxOccurs

Syntax

public int getMaxOccurs()

Returns

maxOccurs

getMinOccurs()

Description

Get the minOccurs

Syntax

public int getMinOccurs()

Returns

minOccurs

getNodeVector()

Description

Get the particles of the group stored in nodeVector

Syntax

public java.util.Vector getNodeVector()

Returns

nodeVector

getOrder()

Description

Get the composite type - ALL, SEQUENCE, or CHOICE

Syntax

public int getOrder()

Returns

order

setMaxOccurs()

Description

Set maxOccurs

Syntax

public void setMaxOccurs(int max)

Parameters

Table 7-25 Parameters of setMaxOccurs
Parameter Description

maxOccurs

value

setMinOccurs()

Description

Set the minOccurs

Syntax

public void setMinOccurs(int min)

Parameters

Table 7-26 Parameters of setMinOccurs
Parameter Description

minOccurs

value


XSDIdentity Class


Description of XSDIdentity

XSDElement presents identity parameters for the XSD for XMLSchema.


Syntax of XSDIdentity

public class XSDIdentity extends oracle.xml.parser.schema.XSDNode
 
oracle.xml.parser.schema.XSDNode
  |
  +--oracle.xml.parser.schema.XSDIdentity


Methods of XSDIdentity

Table 7-27 Summary of Methods of XSDIdentity
Method Description

getFields()

Get the fields

getNodeType()

Get the node type

getRefer()

Get the reference key

getSelector()

Get the selector

getFields()

Description

Get the fields

Syntax

public java.lang.String[] getFields()

Returns

fields

getNodeType()

Description

Get the node Type. Overrides XSDNode.getNodeType() in class XSDNode

Syntax

public int getNodeType()

Returns

nodeType

getRefer()

Description

Get the referenced key

Syntax

public java.lang.String getRefer()

Returns

referenced key

getSelector()

Description

Get the selector

Syntax

public java.lang.String getSelector()

Returns

selector


XSDNode Class


Description of XSDNode

Root class for most of XSD classes. Contains fields and methods corresponding to XMLSchema definition attributes.


Syntax of XSDNode

public class XSDNode
 
oracle.xml.parser.schema.XSDNode


Direct Subclasses of XSDNode

XMLSchema, XMLSchemaNode, XSDAttribute, XSDComplexType, XSDIdentity


Methods of XSDNode

Table 7-28 Summary of Methods of XSDNode  
Method Description

getName()

Get the name of the node

getNamespaceURI()

Get namespace URI

getNodeType()

Get the type of XSDNode.

getTargetNS()

Get target namespace

isNodeType()

Checks if the node is of the give type

getName()

Description

Get the name of the node

Syntax

public java.lang.String getName()

Returns

name

getNamespaceURI()

Description

Get namespace URI.

Syntax

public java.lang.String getNamespaceURI()

Returns

targetNS

getNodeType()

Description

Get the type of XSDNode.

Syntax

public int getNodeType()

Returns

nodeType

getTargetNS()

Description

Get target namespace

Syntax

public java.lang.String getTargetNS()

Returns

targetNS

isNodeType()

Description

Checks if the node is of the give type

Syntax

public boolean isNodeType(int type)

Parameters

Table 7-29 Parameters of isNodeType
Parameter Description

type

type of node that is being checked


XSDSimpleType Class


Description of XSDSimpleType

Implements XSDTypeContstants to derive a type.


Syntax of XSDSimpleType

public class XSDSimpleType implements oracle.xml.parser.schema.XSDTypeConstants
 
oracle.xml.parser.schema.XSDSimpleType


Implemented Interfaces of XSDSimpleType

XSDTypeConstants


Methods of XSDSimpleType

Table 7-30 Summary of Methods of XSDSimpleType  
Method Description

XSDSimpleType()

Class constructor

derivedFrom()

Derive a type from the given base type

getBase()

Gets base type.

getBasicType()

Gets the basic type from which this type was derived.

getBuiltInDatatypes()

Gets a built-in datatype

getFacets()

Get the facets

getMaxOccurs()

public int getMaxOccurs()

getMinOccurs()

Get the value of minOccurs

getVariety()

Get the variety of the type

isAbstract()

Declares Boolean for abstract, true or false.

setFacet()

Sets a facet for the datatype (Internal private API)

setMaxOccurs()

Set the value of maxOccurs

setMinOccurs()

Set the value of minOccurs

setSource()

Sets the base type of the datatype, or in case of aggregate types sets the type of the component of the aggregate type

validateValue()

Validates the string value with the facets defined for this type

XSDSimpleType()

Description

Class constructor. The options are described in Table 7-31:

Table 7-31 Versions of XSDSimpleType constructor
Syntax Description

public XSDSimpleType()

default constructor

public XSDSimpleType(int basic, String nm)

derived

derivedFrom()

Description

Derive a type from the given base type.

Syntax

public static XSDSimpleType derivedFrom(XSDSimpleType source, String nm, String 
var)

Parameters

Table 7-32 Parameters of derivedFrom
Parameter Description

source

XSDSimpleType The base type

nm

String The name of the new type

var

String The method of derivation

Throws

XSDException - if new type can not be created.

getBase()

Description

Specify the base type from which to derive this type.

Syntax

public XSDSimpleType getBase()

getBasicType()

Description

Gets the basic type from which this type was derived.

Syntax

public int getBasicType()

Returns

basicType

getBuiltInDatatypes()

Description

Gets a built-in datatype

Syntax

public static Hashtable getBuiltInDatatypes()

Parameters

Table 7-33 Parameters of getBuiltInDatatypes
Parameter Description

type

Name of the built-in type

Throws

XSDException if the type is not a valid name

getFacets()

Description

Get the facets for this datatype.

Syntax

public XSDConstrainingFacet getFacets()

Returns

facets

getMaxOccurs()

Description

public int getMaxOccurs()

Syntax

Get the value of maxOccurs

Returns

1

getMinOccurs()

Description

Get the value of minOccurs

Syntax

public int getMinOccurs()

Returns

1

getVariety()

Description

Get the variety of the type

Syntax

public java.lang.String getVariety()

Returns

variety

isAbstract()

Description

Declares Boolean for abstract, true or false.

Syntax

public boolean isAbstract()

setFacet()

Description

Sets a facet for the datatype (Internal private API)

Syntax

public void setFacet(String facetName, String value)

Parameters

Table 7-34 Parameters of setFacet
Parameter Description

facetName

name of the facet being set

value

value of the facet

Throws

XSDException - if the facet is invalid

setMaxOccurs()

Description

Set the value of maxOccurs

Syntax

public void setMaxOccurs(int max)

Parameters

Table 7-35 Parameters of setMaxOccurs
Parameter Description

max

number of maximum occurrences

setMinOccurs()

Description

Set the value of minOccurs.

Syntax

public void setMinOccurs(int min)

Parameters

Table 7-36 Parameters of setMinOccurs
Parameter Description

min

number of minimum occurrences

setSource()

Description

Sets the base type of the datatype, or for aggregate types, sets the type of the component of the aggregate type.

Syntax

public void setSource(XSDNode src)

Parameters

Table 7-37 Parameters of setSource
Parameter Description

src

XSDNode source

Throws

XSDException if the src is not a valid type

validateValue()

Description

Validates the string value with the facets defined for this type.

Syntax

public void validateValue(java.lang.String val)

Parameters

Table 7-38 Parameters of validateValue
Parameter Description

val

value to be validated

Throws

XSDException if the value is not valid


XSDTypeConstants Interface


Description of XSDTypeConstants

Implements the interface for XSDTypeConstants.


Syntax of XSDTypeConstants

public interface XSDTypeConstants

Implementing Classes of XSDTypeConstants

XSDDataValue, XSDConstrainingFacet, XSDSimpleType


Fields of XSDTypeConstants

Table 7-39 Fields of XSDTypeConstants  
Field Syntax

_atomic

public static final java.lang.String _atomic

_base64

public static final java.lang.String _base64

_collapse

public static final java.lang.String _collapse

_hex

public static final java.lang.String _hex

_preserve

public static final java.lang.String _preserve

_replace

public static final java.lang.String _replace

ANY_SIMPLE

public static final java.lang.String ANY_SIMPLE

ANY_URI

public static final java.lang.String ANY_URI

BASE64_BINARY

public static final java.lang.String BASE64_BINARY

BINARY

public static final java.lang.String BINARY

BOOLEAN

public static final java.lang.String BOOLEAN

BYTE

public static final java.lang.String BYTE

CDATA

public static final java.lang.String CDATA

CENTURY

public static final java.lang.String CENTURY

DATE

public static final java.lang.String DATE

DATE_TIME

public static final java.lang.String DATE_TIME

DECIMAL

public static final java.lang.String DECIMAL

DOUBLE

public static final java.lang.String DOUBLE

DURATION

public static final java.lang.String DURATION

ENCODING

public static final java.lang.String ENCODING

ENTITIES

public static final java.lang.String ENTITIES

ENTITY

public static final java.lang.String ENTITY

ENUMERATION

public static final java.lang.String ENUMERATION

FLOAT

public static final java.lang.String FLOAT

FRACTION_DIGITS

public static final java.lang.String FRACTION_DIGITS

GDAY

public static final java.lang.String GDAY

GMONTH

public static final java.lang.String GMONTH

GMONTH_DAY

public static final java.lang.String GMONTH_DAY

GYEAR

public static final java.lang.String GYEAR

GYEAR_MONTH

public static final java.lang.String GYEAR_MONTH

HEX_BINARY

public static final java.lang.String HEX_BINARY

iANY_SIMPLE

public static final int iANY_SIMPLE

iANY_URI

public static final int iANY_URI

iBASE64_BINARY

public static final int iBASE64_BINARY

iBOOLEAN

public static final int iBOOLEAN

ID

public static final java.lang.String ID

iDATE

public static final int iDATE

iDATE_TIME

public static final int iDATE_TIME

iDECIMAL

public static final int iDECIMAL

iDOUBLE

public static final int iDOUBLE

IDREF

public static final java.lang.String IDREF

IDREFS

public static final java.lang.String IDREFS

iDUMMY

public static final int iDUMMY

iDURATION

public static final int iDURATION

iENUMERATION

public static final int iENUMERATION

iFLOAT

public static final int iFLOAT

iFRACTION_DIGITS

public static final int iFRACTION_DIGITS

iGDAY

public static final int iGDAY

iGMONTH

public static final int iGMONTH

iGMONTH_DAY

public static final int iGMONTH_DAY

iGYEAR

public static final int iGYEAR

iGYEAR_MONTH

public static final int iGYEAR_MONTH

iHEX_BINARY

public static final int iHEX_BINARY

iLENGTH

public static final int iLENGTH

iMAXEXCLUSIVE

public static final int iMAXEXCLUSIVE

iMAXINCLUSIVE

public static final int iMAXINCLUSIVE

iMAXLENGTH

public static final int iMAXLENGTH

iMINEXCLUSIVE

public static final int iMINEXCLUSIVE

iMININCLUSIVE

public static final int iMININCLUSIVE

iMINLENGTH

public static final int iMINLENGTH

iNOTATION

public static final int iNOTATION

INT

public static final java.lang.String INT

INTEGER

public static final java.lang.String INTEGER

iPATTERN

public static final int iPATTERN

iQNAME

public static final int iQNAME

iSTRING

public static final int iSTRING

iTIME

public static final int iTIME

iTOTAL_DIGITS

public static final int iTOTAL_DIGITS

iWHITESPACE

public static final int iWHITESPACE

LANGUAGE

public static final java.lang.String LANGUAGE

LENGTH

public static final java.lang.String LENGTH

LONG

public static final java.lang.String LONG

MAXEXCLUSIVE

public static final java.lang.String MAXEXCLUSIVE

MAXINCLUSIVE

public static final java.lang.String MAXINCLUSIVE

MAXLENGTH

public static final java.lang.String MAXLENGTH

MINEXCLUSIVE

public static final java.lang.String MINEXCLUSIVE

MININCLUSIVE

public static final java.lang.String MININCLUSIVE

MININCLUSIVE

public static final java.lang.String MININCLUSIVE

MINLENGTH

public static final java.lang.String MINLENGTH

MONTH

public static final java.lang.String MONTH

N_STRING

public static final java.lang.String N_STRING

NAME

public static final java.lang.String NAME

NCNAME

public static final java.lang.String NCNAME

NEGATIVE_INTEGER

public static final java.lang.String NEGATIVE_INTEGER

nFacets

public static final int nFacets

NMTOKEN

public static final java.lang.String NMTOKEN

NMTOKENS

public static final java.lang.String NMTOKENS

NON_NEGATIVE_INTEGER

public static final java.lang.String NON_NEGATIVE_INTEGER

NON_POSITIVE_INTEGER

public static final java.lang.String NON_POSITIVE_INTEGER

PATTERN

public static final java.lang.String PATTERN

PERIOD

public static final java.lang.String PERIOD

POSITIVE_INTEGER

public static final java.lang.String POSITIVE_INTEGER

PRECISION

public static final java.lang.String PRECISION

QNAME

public static final java.lang.String QNAME

RECURRING_DATE

public static final java.lang.String RECURRING_DATE

RECURRING_DAY

public static final java.lang.String RECURRING_DAY

RECURRING_DURATION

public static final java.lang.String RECURRING_DURATION

SCALE

public static final java.lang.String SCALE

sFacets

public static final java.lang.String[] sFacets

SHORT

public static final java.lang.String SHORT

SNOTATION

public static final java.lang.String SNOTATION

STRING

public static final java.lang.String STRING

sTypes

public static final java.lang.String[] sTypes

TIME

public static final java.lang.String TIME

TIME_DURATION

public static final java.lang.String TIME_DURATION

TIME_INSTANT

public static final java.lang.String TIME_INSTANT

TIME_PERIOD

public static final java.lang.String TIME_PERIOD

TOKEN

public static final java.lang.String TOKEN

TOTAL_DIGITS

public static final java.lang.String TOTAL_DIGITS

UNSIGNED_BYTE

public static final java.lang.String UNSIGNED_BYTE

UNSIGNED_INT

public static final java.lang.String UNSIGNED_INT

UNSIGNED_LONG

public static final java.lang.String UNSIGNED_LONG

UNSIGNED_SHORT

public static final java.lang.String UNSIGNED_SHORT

URI_REFERENCE

public static final java.lang.String URI_REFERENCE

WHITESPACE

public static final java.lang.String WHITESPACE

YEAR

public static final java.lang.String YEAR


XSDValidator Class


Description of XSDValidator

XSDValidator validates an instance XML document against an XMLSchema.


Syntax of XSDValidator

public class XSDValidator
 
oracle.xml.parser.schema.XSDValidator


Methods of XSDValidator

Table 7-40 Summary of Methods of XSDValidator  
Method Description

XSDValidator(),

Class constructor

characters()

Propagate notification of character data inside an element.

endElement()

Receive notification of the end of an element.

setDocumentLocator()

Propagates Locator object for document events.

setError()

Sets an XMLError object as current err.

setXMLProperties()

Set XML Properties for runtime properties

setXMLProperty()

Set a property.

startElement()

Receive notification of a beginning of the element

XSDValidator()

Description

XSDValidator constructor.

Syntax

public  XSDValidator()

characters()

Description

Propagate notification of character data inside an element. See also org.xml.sax.DocumentHandler

Syntax

public void characters(char[] ch, int start, int length)

Parameters

Table 7-41 Parameters of endElement
Parameter Description

ch

The characters

start

The start position in the character array.

length

The number of characters to use from the character array.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endElement()

Description

Receive notification of the end of an element.

Syntax

public void endElement(String namespaceURI, String localName, String qName)

Parameters

Table 7-42 Parameters of endElement
Parameter Description

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed

localName

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName

The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setDocumentLocator()

Description

Propagates Locator object for document events.

See also org.xml.sax.DocumentHandler, org.xml.sax.Locator

Syntax

public void setDocumentLocator(org.xml.sax.Locator locator)

Parameters

Table 7-43 Parameters of setDocumentLocator
Parameter Description

locator

A locator for all SAX document events

setError()

Description

Sets an XMLError object as current err.

Syntax

public void setError(oracle.xml.parser.v2.XMLError he)

Parameters

Table 7-44 Parameters of setError
Parameter Description

he

XMLError object

Throws

SAXException - A SAXException could be thrown.

setXMLProperties()

Description

Set XML Properties for runtime properties

Syntax

public void setXMLProperties(XMLProperties xmlProp)

Parameters

Table 7-45 Parameters of setXMLProperties
Parameter Description

xmlProp

XMLProperties

value

value of the property

setXMLProperty()

Description

Set a property. The value of the property is returned if successfully set. A null is returned if the property is read-only and cannot be set or is not supported.

Syntax

public Object setXMLProperty(java.lang.String name, java.lang.Object value)

Parameters

Table 7-46 Parameters of setXMLProperty
Parameter Description

name

name of the property

value

value of the property

Returns

Object the set property

startElement()

Description

Receive notification of the beginning of an element.

See also: endElement(String, String, String), org.xml.sax.Attributes

Syntax

public void startElement(String namespaceURI, String localName, String qName, 
Attributes atts)

Parameters

Table 7-47 Parameters of startElement
Parameter Description

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed

localName

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName

The qualified name (with prefix), or the empty string if qualified names are not available.

atts

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Throws

org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.


Go to previous page Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback