#!/usr/bin/perl
# Test schemas unqualified schemas without target-namespace
use warnings;
use strict;
use lib 'lib','t';
use TestTools;
use XML::Compile::Schema;
use XML::Compile::Tester;
use Test::More tests => 27;
set_compile_defaults
elements_qualified => 'NONE';
# elementFormDefault just to add confusion.
my $schema = XML::Compile::Schema->new( <<__SCHEMA);
__SCHEMA
ok(defined $schema);
is(join("\n", join "\n", $schema->types)."\n", "ct1\n");
is(join("\n", join "\n", $schema->elements)."\n", <<__ELEMS__);
test1
test2
test4
__ELEMS__
test_rw($schema, "{}test1" => <<__XML, 10);
10
__XML
test_rw($schema, "{}test2" => <<__XML, {c1_a => 11});
11
__XML
my %t4 = (c1_a => 14, a1_a => 15, c4_a => 16, a4_a => 17);
test_rw($schema, "{}test4" => <<__XML, \%t4);
14
16
__XML