NAME

XML::Rewrite::Schema - transform schemas

INHERITANCE

XML::Rewrite::Schema
  is a XML::Rewrite
  is a XML::Compile::Cache
  is a XML::Compile::Schema
  is a XML::Compile

SYNOPSIS

my $rewriter = XML::Rewriter::Schema->new(...);
my ($type, $data) = $rewriter->process($file);
my $doc = $rewriter->buildDOM($type => $data);

DESCRIPTION

Implements additional transformations, available for SCHEMA (version 2001) specific extension.

Feel invited to contribute ideas of useful features.

Extends "DESCRIPTION" in XML::Rewrite.

METHODS

Extends "METHODS" in XML::Rewrite.

Constructors

Extends "Constructors" in XML::Rewrite.

XML::Rewrite::Schema->new( [SCHEMA], OPTIONS )
-Option               --Defined in          --Default
 allow_undeclared       XML::Compile::Cache   <true>
 any_element            XML::Compile::Cache   'ATTEMPT'
 attribute_form                               <undef>
 blanks_before          XML::Rewrite          'NONE'
 block_namespace        XML::Compile::Schema  []
 change                 XML::Rewrite          'TRANSFORM'
 comments               XML::Rewrite          'KEEP'
 defaults_writer        XML::Rewrite          'IGNORE'
 element_form                                 <undef>
 expand_includes                              <false>
 hook                   XML::Compile::Schema  undef
 hooks                  XML::Compile::Schema  []
 ignore_unused_tags     XML::Compile::Schema  <false>
 key_rewrite            XML::Compile::Schema  []
 opts_readers           XML::Compile::Cache   []
 opts_rw                XML::Compile::Cache   []
 opts_writers           XML::Compile::Cache   []
 output_compression     XML::Rewrite          <undef>
 output_encoding        XML::Rewrite          <undef>
 output_standalone      XML::Rewrite          <undef>
 output_version         XML::Rewrite          <undef>
 parser_options         XML::Compile          <many>
 prefixes               XML::Compile::Cache   <smart>
 remove_annotation                            <false>
 remove_elements        XML::Rewrite          []
 remove_id_constraints                        <false>
 schema_dirs            XML::Compile          undef
 target_namespace                             <undef>
 typemap                XML::Compile::Cache   {}
 use_default_namespace  XML::Rewrite          <false>
 xsi_type               XML::Compile::Cache   {}
allow_undeclared => BOOLEAN
any_element => CODE|'TAKE_ALL'|'SKIP_ALL'|'ATTEMPT'|'SLOPPY'
attribute_form => 'qualified'|'unqualified'
blanks_before => 'ALL'|'CONTAINERS'|'NONE'
block_namespace => NAMESPACE|TYPE|HASH|CODE|ARRAY
change => 'REPAIR'|'TRANSFORM'
comments => 'REMOVE'|'KEEP'
defaults_writer => 'EXTEND'|'IGNORE'|'MINIMAL'
element_form => 'qualified'|'unqualified'
expand_includes => BOOLEAN

Include all the "include" files recursively, and merge their content with the main schema.

hook => $hook|ARRAY
hooks => ARRAY
ignore_unused_tags => BOOLEAN|REGEXP
key_rewrite => HASH|CODE|ARRAY
opts_readers => HASH|ARRAY-of-PAIRS
opts_rw => HASH|ARRAY-of-PAIRS
opts_writers => HASH|ARRAY-of-PAIRS
output_compression => -1, 0-8
output_encoding => CHARSET
output_standalone => BOOLEAN|'yes'|'no'
output_version => STRING
parser_options => HASH|ARRAY
prefixes => HASH|ARRAY-of-PAIRS
remove_annotation => BOOLEAN
remove_elements => ARRAY
remove_id_constraints => BOOLEAN

Remove the identity constraints (key, keyref, and unique elements) from the schema.

schema_dirs => $directory|ARRAY-OF-directories
target_namespace => URI
typemap => HASH|ARRAY
use_default_namespace => BOOLEAN
xsi_type => HASH|ARRAY

Accessors

Extends "Accessors" in XML::Rewrite.

$obj->addHook($hook|LIST|undef)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addHooks( $hook, [$hook, ...] )

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addKeyRewrite($predef|CODE|HASH, ...)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addSchemaDirs(@directories|$filename)
XML::Rewrite::Schema->addSchemaDirs(@directories|$filename)

Inherited, see "Accessors" in XML::Compile

$obj->addSchemas($xml, %options)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addTypemap(PAIR)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addTypemaps(PAIRS)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addXsiType( [HASH|ARRAY|LIST] )

Inherited, see "Accessors" in XML::Compile::Cache

$obj->allowUndeclared( [BOOLEAN] )

Inherited, see "Accessors" in XML::Compile::Cache

$obj->anyElement('ATTEMPT'|'SLOPPY'|'SKIP_ALL'|'TAKE_ALL'|CODE)

Inherited, see "Accessors" in XML::Compile::Cache

$obj->blockNamespace($ns|$type|HASH|CODE|ARRAY)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->hooks( [<'READER'|'WRITER'>] )

Inherited, see "Accessors" in XML::Compile::Schema

$obj->typemap( [HASH|ARRAY|PAIRS] )

Inherited, see "Accessors" in XML::Compile::Cache

$obj->useSchema( $schema, [$schema, ...] )

Inherited, see "Accessors" in XML::Compile::Schema

Prefix management

Extends "Prefix management" in XML::Rewrite.

$obj->addNicePrefix(BASE, NAMESPACE)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->addPrefixes( [PAIRS|ARRAY|HASH] )

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->learnPrefixes($node)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefix($prefix)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefixFor($uri)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefixed( $type|<$ns,$local> )

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefixes( [$params] )

Inherited, see "Prefix management" in XML::Compile::Cache

Compilers

Extends "Compilers" in XML::Rewrite.

$obj->addCompileOptions( ['READERS'|'WRITERS'|'RW'], %options )

Inherited, see "Compilers" in XML::Compile::Cache

$obj->compile( <'READER'|'WRITER'>, $type, %options )

Inherited, see "Compilers" in XML::Compile::Schema

$obj->compileAll( ['READERS'|'WRITERS'|'RW', [$ns]] )

Inherited, see "Compilers" in XML::Compile::Cache

$obj->compileType( <'READER'|'WRITER'>, $type, %options )

Inherited, see "Compilers" in XML::Compile::Schema

$obj->dataToXML($node|REF-XML|XML-STRING|$filename|$fh|$known)
XML::Rewrite::Schema->dataToXML($node|REF-XML|XML-STRING|$filename|$fh|$known)

Inherited, see "Compilers" in XML::Compile

$obj->initParser(%options)
XML::Rewrite::Schema->initParser(%options)

Inherited, see "Compilers" in XML::Compile

$obj->reader($type|$name, %options)

Inherited, see "Compilers" in XML::Compile::Cache

$obj->template( <'XML'|'PERL'|'TREE'>, $element, %options )

Inherited, see "Compilers" in XML::Compile::Schema

$obj->writer($type|$name)

Inherited, see "Compilers" in XML::Compile::Cache

Administration

Extends "Administration" in XML::Rewrite.

$obj->declare( <'READER'|'WRITER'|'RW'>, <$type|ARRAY>, %options )

Inherited, see "Administration" in XML::Compile::Cache

$obj->doesExtend($exttype, $basetype)

Inherited, see "Administration" in XML::Compile::Schema

$obj->elements()

Inherited, see "Administration" in XML::Compile::Schema

$obj->findName($name)

Inherited, see "Administration" in XML::Compile::Cache

$obj->findSchemaFile($filename)
XML::Rewrite::Schema->findSchemaFile($filename)

Inherited, see "Administration" in XML::Compile

$obj->importDefinitions($xmldata, %options)

Inherited, see "Administration" in XML::Compile::Schema

$obj->knownNamespace($ns|PAIRS)
XML::Rewrite::Schema->knownNamespace($ns|PAIRS)

Inherited, see "Administration" in XML::Compile

$obj->namespaces()

Inherited, see "Administration" in XML::Compile::Schema

$obj->printIndex( [$fh], %options )

Inherited, see "Administration" in XML::Compile::Cache

$obj->types()

Inherited, see "Administration" in XML::Compile::Schema

$obj->walkTree($node, CODE)

Inherited, see "Administration" in XML::Compile

Processing

Extends "Processing" in XML::Rewrite.

$obj->buildDOM(TYPE, DATA, OPTIONS)

Inherited, see "Processing" in XML::Rewrite

$obj->process(XMLDATA, OPTIONS)

Inherited, see "Processing" in XML::Rewrite

$obj->repairXML(TYPE, XML, DETAILS)

Inherited, see "Processing" in XML::Rewrite

$obj->transformData(TYPE, DATA, DETAILS)

Inherited, see "Processing" in XML::Rewrite

DETAILS

Extends "DETAILS" in XML::Rewrite.

DESCRIPTIONS

Extends "DESCRIPTIONS" in XML::Rewrite.

SEE ALSO

This module is part of XML-Rewrite distribution version 0.11, built on May 11, 2018. Website: http://perl.overmeer.net/CPAN/

LICENSE

Copyrights 2008-2018 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/