Subject: | XML::Compile - schema2example should generate vaild XML |
schema2example should generate XML file which can be validated in. with
xml2yaml command.
This patch resolves this problem:
* adds xmlns:xsi (used by xsi:type attributes)
* generates correct XML comments (must not contain "--" string inside)
=== modified file 'lib/XML/Compile/Schema.pm'
--- lib/XML/Compile/Schema.pm 2011-11-22 13:29:28 +0000
+++ lib/XML/Compile/Schema.pm 2011-11-22 13:49:49 +0000
@@ -336,8 +336,8 @@
, !$args{use_default_namespace}
);
- $table->{&SCHEMA2001} ||= {prefix => 'xs', uri => SCHEMA2001,
used => 0};
- $table->{&SCHEMA2001i} ||= {prefix => 'xsi', uri => SCHEMA2001i,
used => 0};
+ $table->{&SCHEMA2001} ||= {prefix => 'xs', uri => SCHEMA2001,
used => 1};
+ $table->{&SCHEMA2001i} ||= {prefix => 'xsi', uri => SCHEMA2001i,
used => 1};
my $transl = XML::Compile::Translate->new
( 'TEMPLATE'
=== modified file 'lib/XML/Compile/Translate/Template.pm'
--- lib/XML/Compile/Translate/Template.pm 2011-11-22 13:29:28
+0000
+++ lib/XML/Compile/Translate/Template.pm 2011-11-22 13:33:02
+0000
@@ -808,9 +808,9 @@
my $header = $doc->createComment( <<_HEADER . ' ' );
BE WARNED: in most cases, the example below cannot be used without
- -- interpretation. The comments will guide you.
- -- Produced by $pkg version $VERSION
- -- on $now
+ interpretation. The comments will guide you.
+ Produced by $pkg version $VERSION
+ on $now
_HEADER
unless($args{skip_header})