Rinchi::XMLSchema - Module for creating XML Schema objects from XSD files.
use Rinchi::XMLSchema; $document = Rinchi::XMLSchema->parse($file);
This module parses XML Schema files and produces Perl objects representing them. There is also the capability to compare objects to see if they are the same (not necessarily equal). The intent of this module is to allow the comparison of various schemas to find common constructs between them. A module I intend to release later will allow the production of UML from schema files. Note: Imports and includes are not performed as at this time that would be contrary to the purpose of the module.
None by default.
Create an object of the appropriate class, based on the local name of the element being represented.
Local Name Class; all Rinchi::XMLSchema::All; annotation Rinchi::XMLSchema::Annotation; any Rinchi::XMLSchema::Any; anyAttribute Rinchi::XMLSchema::AnyAttribute; appinfo Rinchi::XMLSchema::Appinfo; attribute Rinchi::XMLSchema::Attribute; attributeGroup Rinchi::XMLSchema::AttributeGroup; choice Rinchi::XMLSchema::Choice; complexContent Rinchi::XMLSchema::ComplexContent; complexType Rinchi::XMLSchema::ComplexType; documentation Rinchi::XMLSchema::Documentation; element Rinchi::XMLSchema::Element; enumeration Rinchi::XMLSchema::Enumeration; extension Rinchi::XMLSchema::Extension; field Rinchi::XMLSchema::Field; fractionDigits Rinchi::XMLSchema::FractionDigits; group Rinchi::XMLSchema::Group; import Rinchi::XMLSchema::Import; include Rinchi::XMLSchema::Include; key Rinchi::XMLSchema::Key; keyref Rinchi::XMLSchema::Keyref; length Rinchi::XMLSchema::Length; list Rinchi::XMLSchema::List; maxExclusive Rinchi::XMLSchema::MaxExclusive; maxInclusive Rinchi::XMLSchema::MaxInclusive; maxLength Rinchi::XMLSchema::MaxLength; minExclusive Rinchi::XMLSchema::MinExclusive; minInclusive Rinchi::XMLSchema::MinInclusive; minLength Rinchi::XMLSchema::MinLength; notation Rinchi::XMLSchema::Notation; pattern Rinchi::XMLSchema::Pattern; redefine Rinchi::XMLSchema::Redefine; restriction Rinchi::XMLSchema::Restriction; schema Rinchi::XMLSchema::Schema; selector Rinchi::XMLSchema::Selector; sequence Rinchi::XMLSchema::Sequence; simpleContent Rinchi::XMLSchema::SimpleContent; simpleType Rinchi::XMLSchema::SimpleType; totalDigits Rinchi::XMLSchema::TotalDigits; union Rinchi::XMLSchema::Union; unique Rinchi::XMLSchema::Unique; whiteSpace Rinchi::XMLSchema::WhiteSpace;
Calls XML::Parser->parsefile with the given path and the Rinchi::XMLSchema handlers. Objects are created for the namespaces with available handlers, arrays with the tags and attributes. A tree of the objects and arrays is returned, with children accessible as @{$Object->{'_content_'}}.
Open FILE for reading, then call parse with the open handle. The file is closed no matter how parse returns. Returns what parse returns.
Returns a hash reference containing the following key-value pairs:
Start Hash reference to SAX Start event handlers End Hash reference to SAX End event handlers Namespace Namespace URI
Adds the namespace and handlers to the list of routines called by the parser to create objects of the specified classes. For example:
use Rinchi::XMLSchema::HFP; my $nsdef = Rinchi::HFP->namespace_def(); $nsdef->{'Prefix'} = 'hfp'; Rinchi::XMLSchema->add_namespace($nsdef); my $Document = Rinchi::XMLSchema->parsefile('datatypes.xsd');
This will cause Rinchi::HFP subclassed objects from the namespace 'http://www.w3.org/2001/XMLSchema-hasFacetAndProperty' to be created as well as those from the XMLSchema namespace.
Compares self to other returning 1 if they are the same, 0 otherwise;
Rinchi::XMLSchema::All is used for creating XML Schema All objects.
id = ID maxOccurs = 1 : 1 minOccurs = (0 | 1) : 1 {any attributes with non-schema namespace ...}> Content: (annotation?, element*)
Create a new Rinchi::XMLSchema::All object.
Set or get value of the 'id' attribute.
Set or get value of the 'maxOccurs' attribute.
Set or get value of the 'minOccurs' attribute.
Rinchi::XMLSchema::Annotation is used for creating XML Schema Annotation objects.
id = ID {any attributes with non-schema namespace ...}> Content: (appinfo | documentation)*
Create a new Rinchi::XMLSchema::Annotation object.
Rinchi::XMLSchema::Any is used for creating XML Schema Any objects.
id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any processContents = (lax | skip | strict) : strict {any attributes with non-schema namespace ...}> Content: (annotation?)
Create a new Rinchi::XMLSchema::Any object.
Set or get value of the 'namespace' attribute.
Set or get value of the 'processContents' attribute.
Rinchi::XMLSchema::AnyAttribute is used for creating XML Schema AnyAttribute objects.
Create a new Rinchi::XMLSchema::AnyAttribute object.
Rinchi::XMLSchema::Appinfo is used for creating XML Schema Appinfo objects.
source = anyURI {any attributes with non-schema namespace ...}> Content: ({any})*
Create a new Rinchi::XMLSchema::Appinfo object.
Set or get value of the 'source' attribute.
Rinchi::XMLSchema::Attribute is used for creating XML Schema Attribute objects.
default = string fixed = string form = (qualified | unqualified) id = ID name = NCName ref = QName type = QName use = (optional | prohibited | required) : optional {any attributes with non-schema namespace ...}> Content: (annotation?, simpleType?)
Create a new Rinchi::XMLSchema::Attribute object.
Set or get value of the 'default' attribute.
Set or get value of the 'fixed' attribute.
Set or get value of the 'form' attribute.
Set or get value of the 'name' attribute.
Set or get value of the 'ref' attribute.
Set or get value of the 'type' attribute.
Set or get value of the 'use' attribute.
Rinchi::XMLSchema::AttributeGroup is used for creating XML Schema AttributeGroup objects.
id = ID name = NCName ref = QName {any attributes with non-schema namespace ...}> Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
Create a new Rinchi::XMLSchema::AttributeGroup object.
Rinchi::XMLSchema::Choice is used for creating XML Schema Choice objects.
id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 {any attributes with non-schema namespace ...}> Content: (annotation?, (element | group | choice | sequence | any)*)
Create a new Rinchi::XMLSchema::Choice object.
Rinchi::XMLSchema::ComplexContent is used for creating XML Schema ComplexContent objects.
Create a new Rinchi::XMLSchema::ComplexContent object.
Set or get value of the 'mixed' attribute.
Rinchi::XMLSchema::ComplexType is used for creating XML Schema ComplexType objects.
abstract = boolean : false block = (#all | List of (extension | restriction)) final = (#all | List of (extension | restriction)) id = ID mixed = boolean : false name = NCName {any attributes with non-schema namespace ...}> Content: (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))))
Create a new Rinchi::XMLSchema::ComplexType object.
Set or get value of the 'abstract' attribute.
Set or get value of the 'block' attribute.
Set or get value of the 'final' attribute.
Rinchi::XMLSchema::Documentation is used for creating XML Schema Documentation objects.
source = anyURI xml:lang = language {any attributes with non-schema namespace ...}> Content: ({any})*
Create a new Rinchi::XMLSchema::Documentation object.
Set or get value of the 'xml:lang' attribute.
Rinchi::XMLSchema::Element is used for creating XML Schema Element objects.
abstract = boolean : false block = (#all | List of (extension | restriction | substitution)) default = string final = (#all | List of (extension | restriction)) fixed = string form = (qualified | unqualified) id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 name = NCName nillable = boolean : false ref = QName substitutionGroup = QName type = QName {any attributes with non-schema namespace ...}> Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
Create a new Rinchi::XMLSchema::Element object.
Set or get value of the 'nillable' attribute.
Set or get value of the 'substitutionGroup' attribute.
Rinchi::XMLSchema::Enumeration is used for creating XML Schema Enumeration objects.
Create a new Rinchi::XMLSchema::Enumeration object.
Set or get value of the 'value' attribute.
Rinchi::XMLSchema::Extension is used for creating XML Schema Extension objects.
Create a new Rinchi::XMLSchema::Extension object.
Set or get value of the 'base' attribute.
Rinchi::XMLSchema::Field is used for creating XML Schema Field objects.
id = ID xpath = a subset of XPath expression, see below {any attributes with non-schema namespace ...}> Content: (annotation?)
Create a new Rinchi::XMLSchema::Field object.
Set or get value of the 'xpath' attribute.
Rinchi::XMLSchema::FractionDigits is used for creating XML Schema FractionDigits objects.
Create a new Rinchi::XMLSchema::FractionDigits object.
Rinchi::XMLSchema::Group is used for creating XML Schema Group objects.
id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 name = NCName ref = QName {any attributes with non-schema namespace ...}> Content: (annotation?, (all | choice | sequence)?)
Create a new Rinchi::XMLSchema::Group object.
Rinchi::XMLSchema::Import is used for creating XML Schema Import objects.
id = ID namespace = anyURI schemaLocation = anyURI {any attributes with non-schema namespace . . .}> Content: (annotation?)
Create a new Rinchi::XMLSchema::Import object.
Set or get value of the 'schemaLocation' attribute.
Rinchi::XMLSchema::Include is used for creating XML Schema Include objects.
id = ID schemaLocation = anyURI {any attributes with non-schema namespace . . .}> Content: (annotation?)
Create a new Rinchi::XMLSchema::Include object.
Rinchi::XMLSchema::Key is used for creating XML Schema Key objects.
id = ID name = NCName {any attributes with non-schema namespace ...}> Content: (annotation?, (selector, field+))
Create a new Rinchi::XMLSchema::Key object.
Rinchi::XMLSchema::Keyref is used for creating XML Schema Keyref objects.
id = ID name = NCName refer = QName {any attributes with non-schema namespace ...}> Content: (annotation?, (selector, field+))
Create a new Rinchi::XMLSchema::Keyref object.
Set or get value of the 'refer' attribute.
Rinchi::XMLSchema::Length is used for creating XML Schema Length objects.
Create a new Rinchi::XMLSchema::Length object.
Rinchi::XMLSchema::List is used for creating XML Schema List objects.
id = ID itemType = QName {any attributes with non-schema namespace ...}> Content: (annotation?, simpleType?)
Create a new Rinchi::XMLSchema::List object.
Set or get value of the 'itemType' attribute.
Rinchi::XMLSchema::MaxExclusive is used for creating XML Schema MaxExclusive objects.
Create a new Rinchi::XMLSchema::MaxExclusive object.
Rinchi::XMLSchema::MaxInclusive is used for creating XML Schema MaxInclusive objects.
Create a new Rinchi::XMLSchema::MaxInclusive object.
Rinchi::XMLSchema::MaxLength is used for creating XML Schema MaxLength objects.
Create a new Rinchi::XMLSchema::MaxLength object.
Rinchi::XMLSchema::MinExclusive is used for creating XML Schema MinExclusive objects.
Create a new Rinchi::XMLSchema::MinExclusive object.
Rinchi::XMLSchema::MinInclusive is used for creating XML Schema MinInclusive objects.
Create a new Rinchi::XMLSchema::MinInclusive object.
Rinchi::XMLSchema::MinLength is used for creating XML Schema MinLength objects.
Create a new Rinchi::XMLSchema::MinLength object.
Rinchi::XMLSchema::Notation is used for creating XML Schema Notation objects.
id = ID name = NCName public = token system = anyURI {any attributes with non-schema namespace ...}> Content: (annotation?)
Create a new Rinchi::XMLSchema::Notation object.
Set or get value of the 'public' attribute.
Set or get value of the 'system' attribute.
Rinchi::XMLSchema::Pattern is used for creating XML Schema Pattern objects.
Create a new Rinchi::XMLSchema::Pattern object.
Rinchi::XMLSchema::Redefine is used for creating XML Schema Redefine objects.
id = ID schemaLocation = anyURI {any attributes with non-schema namespace . . .}> Content: (annotation | (simpleType | complexType | group | attributeGroup))*
Create a new Rinchi::XMLSchema::Redefine object.
Rinchi::XMLSchema::Restriction is used for creating XML Schema Restriction objects.
base = QName id = ID {any attributes with non-schema namespace ...}> Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*))
Create a new Rinchi::XMLSchema::Restriction object.
Rinchi::XMLSchema::Schema is used for creating XML Schema Schema objects.
attributeFormDefault = (qualified | unqualified) : unqualified blockDefault = (#all | List of (extension | restriction | substitution)) : '' elementFormDefault = (qualified | unqualified) : unqualified finalDefault = (#all | List of (extension | restriction | list | union)) : '' id = ID targetNamespace = anyURI version = token xml:lang = language {any attributes with non-schema namespace . . .}> Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*)
Create a new Rinchi::XMLSchema::Schema object.
Set or get value of the 'attributeFormDefault' attribute.
Set or get value of the 'blockDefault' attribute.
Set or get value of the 'elementFormDefault' attribute.
Set or get value of the 'finalDefault' attribute.
Set or get value of the 'targetNamespace' attribute.
Set or get value of the 'version' attribute.
Set or get value of the 'xmlns' attribute.
Set or get value of the 'xmlns:xs' attribute.
Get the top-level element objects.
Get the top-level attribute objects.
Get the top-level type objects.
Get the top-level groups objects.
Get the top-level attributeGroups objects.
Get the top-level notation objects.
Get the top-level identityConstraint objects.
Rinchi::XMLSchema::Selector is used for creating XML Schema Selector objects.
Create a new Rinchi::XMLSchema::Selector object.
Rinchi::XMLSchema::Sequence is used for creating XML Schema Sequence objects.
Create a new Rinchi::XMLSchema::Sequence object.
Rinchi::XMLSchema::SimpleContent is used for creating XML Schema SimpleContent objects.
Create a new Rinchi::XMLSchema::SimpleContent object.
Rinchi::XMLSchema::SimpleType is used for creating XML Schema SimpleType objects.
final = (#all | List of (list | union | restriction)) id = ID name = NCName {any attributes with non-schema namespace ...}> Content: (annotation?, (restriction | list | union))
Create a new Rinchi::XMLSchema::SimpleType object.
Rinchi::XMLSchema::TotalDigits is used for creating XML Schema TotalDigits objects.
Create a new Rinchi::XMLSchema::TotalDigits object.
Rinchi::XMLSchema::Union is used for creating XML Schema Union objects.
id = ID memberTypes = List of QName {any attributes with non-schema namespace ...}> Content: (annotation?, simpleType*)
Create a new Rinchi::XMLSchema::Union object.
Set or get value of the 'memberTypes' attribute.
Rinchi::XMLSchema::Unique is used for creating XML Schema Unique objects.
Create a new Rinchi::XMLSchema::Unique object.
Rinchi::XMLSchema::WhiteSpace is used for creating XML Schema WhiteSpace objects.
Create a new Rinchi::XMLSchema::WhiteSpace object.
Brian M. Ames, <bmames.net>
XML::Parser.
Copyright 2008 Brian M. Ames. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
86 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Rinchi::XMLSchema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rinchi::XMLSchema
CPAN shell
perl -MCPAN -e shell install Rinchi::XMLSchema
For more information on module installation, please visit the detailed CPAN module installation guide.