See METHODS in XML::Compile
See Constructors in XML::Compile
Read a GML structure from a data source, which can be anything acceptable by dataToXML(): a XML::LibXML::Element, XML as string or ref-string, filename, filehandle or known namespace.
Returned is the product (the type of the root node) and the parsed data-structure. The EOP version used for decoding is autodetected, unless specified.
See examples/read_gml.pl
my ($type, $data) = Geo::GML->from('data.xml');
Option | Defined in | Default |
---|---|---|
allow_undeclared | <true> | |
any_element | XML::Compile::Cache |
|
block_namespace | XML::Compile::Schema | [] |
hook | XML::Compile::Schema |
|
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 | <some> |
opts_writers | XML::Compile::Cache | [] |
parser_options | XML::Compile | <many> |
prefixes | undef | |
schema_dirs | XML::Compile |
|
typemap | XML::Compile::Cache | {} |
version | <required> | |
xsi_type | XML::Compile::Cache | {} |
Returns 'READER', 'WRITER', or 'RW'.
GML version, for instance '3.2.1'.
See Prefix management in XML::Compile::Cache
See Compilers in XML::Compile::Cache
See XML::Compile::Schema::template(). This will create an example of the data-structure based on GML. All %options are passed to the template generator, the only reason to have this method, is to avoid the need to collect all the GML XML files yourself.
Option | Defined in | Default |
---|---|---|
abstract_types | XML::Compile::Schema | 'ERROR' |
attributes_qualified | XML::Compile::Schema | <undef> |
elements_qualified | XML::Compile::Schema | <undef> |
include_namespaces | XML::Compile::Schema | <true> |
indent | XML::Compile::Schema | " " |
key_rewrite | XML::Compile::Schema | [] |
show_comments | XML::Compile::Schema |
|
skip_header | XML::Compile::Schema | <false> |
use Geo::GML; use Geo::GML::Util qw/NS_GML_321/; use XML::Compile::Util qw/pack_type/; my $gml = Geo::GML->new(version => NS_GML_321); # to simplify the output, reducing often available large blocks my @types = qw/gml:MetaDataPropertyType gml:StringOrRefType gml:ReferenceType/; my %hook = (type => \@collapse_types, replace => 'COLLAPSE'); # generate the data-structure my $type = 'gml:RectifiedGridCoverage'; # any element name print $gml->template(PERL => $type, hook => \%hook);
List all the elements which can be produced with the schema. By default, this only shows the elements and excludes the abstract elements from the list. The selected $fh is the default to print to.
Option | Defined in | Default |
---|---|---|
show_declared | XML::Compile::Cache | <true> |