comparison Lib/IMPL/DOM/Schema.pm @ 16:75d55f4ee263

Окончательная концепция описания схем и построения DOM документов
author Sergey
date Tue, 08 Sep 2009 17:29:07 +0400
parents 16795016e70b
children 7f88e01b58f8
comparison
equal deleted inserted replaced
15:16795016e70b 16:75d55f4ee263
10 10
11 BEGIN { 11 BEGIN {
12 private _direct property _TypesMap => prop_all; 12 private _direct property _TypesMap => prop_all;
13 } 13 }
14 14
15 sub ResoveType {
16 $_[0]->{$_TypesMap}->{$_[1]};
17 }
18
19 sub MetaSchema {
20 my $schema = new IMPL::DOM::Schema(nodeName => 'schema');
21
22 $schema->appendRange(
23 IMPL::DOM::Schema::ComplexNode->new(nodeName => 'schema')->appendRange(
24 IMPL::DOM::Schema::NodeSet->new()->appendRange(
25 IMPL::DOM::Schema::Node->new(nodeName => 'ComplexNode', type => 'ComplexNode', minOccur => 0, maxOccur=>'unbounded'),
26 IMPL::DOM::Schema::Node->new(nodeName => 'ComplexType', type => 'ComplexType', minOccur => 0, maxOccur=>'unbounded'),
27 IMPL::DOM::Schema::Node->new(nodeName => 'SimpleNode', type => 'SimpleNode', minOccur => 0, maxOccur=>'unbounded'),
28 IMPL::DOM::Schema::Node->new(nodeName => 'SimpleType', type => 'SimpleType', minOccur => 0, maxOccur=>'unbounded'),
29 IMPL::DOM::Schema::SimpleNode->new(nodeName => 'Node', minOccur => 0, maxOccur=>'unbounded'),
30 IMPL::DOM::Schema::SimpleNode->new(nodeName => 'Include', minOccur => 0, maxOccur=>'unbounded')
31 )
32 ),
33 IMPL::DOM::Schema::ComplexType->new(type => 'NodeSet', native => 'IMPL::DOM::Schema::NodeSet')->appendRange(
34 IMPL::DOM::Schema::NodeSet->new()->appendRange(
35 IMPL::DOM::Schema::Node->new(nodeName => 'ComplexNode', type => 'ComplexNode', minOccur => 0, maxOccur=>'unbounded'),
36 IMPL::DOM::Schema::Node->new(nodeName => 'SimpleNode', type => 'SimpleNode', minOccur => 0, maxOccur=>'unbounded'),
37 IMPL::DOM::Schema::SimpleNode->new(nodeName => 'Node', minOccur => 0, maxOccur=>'unbounded'),
38 )
39 )
40 )
41 }
42
15 1; 43 1;
44
45 __END__
46
47 =pod
48
49 =head1 META SCHEMA
50
51 ,
52
53 <schema>
54 <ComplexNode nodeName="schema">
55 <NodeSet>
56 <Node minOcuur="0" maxOccur="unbounded" nodeName="ComplexNode" type="ComplexNode"/>
57 <Node minOcuur="0" maxOccur="unbounded" nodeName="SimpleNode" type="SimpleNode"/>
58 <Node minOcuur="0" maxOccur="unbounded" nodeName="ComplexType" type="ComplexType"/>
59 <Node minOcuur="0" maxOccur="unbounded" nodeName="SimpleType" type="SimpleType"/>
60 <SimpleNode minOcuur="0" maxOccur="unbounded" nodeName="Node"/>
61 <SimpleNode minOcuur="0" maxOccur="unbounded" nodeName="Include"/>
62 </NodeSet>
63 </ComplexNode>
64
65 <ComplexType type="NodeContainer">
66 <NodeSet>
67 <Node minOcuur="0" maxOccur="unbounded" nodeName="ComplexNode" type="ComplexNode"/>
68 <Node minOcuur="0" maxOccur="unbounded" nodeName="SimpleNode" type="SimpleNode"/>
69 <SimpleNode minOcuur="0" maxOccur="unbounded" nodeName="Node"/>
70 </NodeSet>
71 </ComplexType>
72
73
74 <ComplexType type="ComplexType">
75 <NodeList>
76 <Node nodeName="NodeSet" type="NodeContainer" minOcuur=0/>
77 <Node nodeName="NodeList" type="NodeContainer" minOccur=0/>
78 <AnyNode minOccur="0" maxOccur="unbounded"/>
79 </NodeList>
80 </ComplexType>
81
82 <ComplexType type="ComplexNode">
83 <NodeList>
84 <Node nodeName="NodeSet" type="NodeContainer" minOcuur=0/>
85 <Node nodeName="NodeList" type="NodeContainer" minOccur=0/>
86 <AnyNode minOccur="0" maxOccur="unbounded"/>
87 </NodeList>
88 </ComplexType>
89
90 <ComplexType type="SimpleNode">
91 <NodeSet>
92 <AnyNode minOccur=0 maxOccur="unbounded"/>
93 </NodeSet>
94 </ComplexType>
95
96 <ComplexType type="SimpleType">
97 <NodeSet>
98 <AnyNode minOccur=0 maxOccur="unbounded"/>
99 </NodeSet>
100 </ComplexType>
101
102 </schema>
103
104 =cut