Newer
Older
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
<s1 title="Sample: SEnumVal">
Tinny Ng
committed
<p>SEnumVal shows how to enumerate the markup decls in a Schema Grammar.</p>
<s3 title="Running SEnumVal">
<p>This program parses the specified XML file, then shows how to
Tinny Ng
committed
enumerate the contents of the Schema Grammar. </p>
<source>
Usage:
SEnumVal <XML file>
This program parses a file, then shows how to enumerate the
contents of the Schema Grammar. Essentially, shows how one can
access the Schema information stored in internal data structures.
</source>
<p>Here is a sample output from SEnumVal</p>
<source>cd &XercesCInstallDir;-linux/samples/data
SEnumVal personal-schema.xml
Name: personnel
Model Type: Children
Create Reason: Declared
ContentType: OneOrMore
Content Model: (person)+
ComplexType:
TypeName: ,C0
ContentType: OneOrMore
--------------------------------------------
Name: person
Model Type: Children
Create Reason: Declared
ContentType: Sequence
Content Model: (name,email*,url*,link?)
ComplexType:
TypeName: ,C1
ContentType: Sequence
Attributes:
Name: salary
Type: CDATA
Default Type: #IMPLIED
Base Datatype: Decimal
Facets:
fractionDigits=0
Tinny Ng
committed
Name: id
Type: ID
Default Type: #REQUIRED
Base Datatype: ID
Tinny Ng
committed
Name: contr
Type: CDATA
Default Type: #DEFAULT
Value: false
Base Datatype: string
Tinny Ng
committed
Name: note
Type: CDATA
Default Type: #IMPLIED
Base Datatype: string
Tinny Ng
committed
--------------------------------------------
Name: name
Model Type: Children
Create Reason: Declared
ContentType: All
Content Model: All(family,given)
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
ComplexType:
TypeName: ,C3
ContentType: All
--------------------------------------------
Name: family
Model Type: Simple
Create Reason: Declared
Base Datatype: string
--------------------------------------------
Name: given
Model Type: Simple
Create Reason: Declared
Base Datatype: string
--------------------------------------------
Name: email
Model Type: Simple
Create Reason: Declared
Base Datatype: string
--------------------------------------------
Name: url
Model Type: Empty
Create Reason: Declared
Content Model: EMPTY
ComplexType:
TypeName: ,C4
Attributes:
Name: href
Type: CDATA
Default Type: #DEFAULT
Value: http://
Base Datatype: string
Tinny Ng
committed
--------------------------------------------
Name: link
Model Type: Empty
Create Reason: Declared
Content Model: EMPTY
ComplexType:
TypeName: ,C5
Attributes:
Name: subordinates
Type: IDREFS
Default Type: #IMPLIED
Base Datatype: List
Tinny Ng
committed
Name: manager
Type: IDREF
Default Type: #IMPLIED
Base Datatype: IDREF
Tinny Ng
committed