File: digester-rules.dtd

package info (click to toggle)
libcommons-digester-java 1.8.1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,224 kB
  • sloc: java: 12,455; xml: 2,027; makefile: 2
file content (184 lines) | stat: -rw-r--r-- 6,653 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0" encoding="UTF-8" ?>
<!--
   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.
-->
<!--
        "Digester" component of the Commons Subproject
        DTD for the definition of Digester rules in XML.
        $Id: digester-rules.dtd 730319 2008-12-31 06:16:52Z rahul $
-->

<!-- This document type defines an XML format for defining Digester rules.
     Digester is a framework for pattern-matching-based parsing of XML into
     Java objects. See http://commons.apache.org/digester/.  -->

<!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule |
                   call-param-rule | object-param-rule |
                   factory-create-rule | object-create-rule |
                   set-properties-rule | set-property-rule | set-top-rule |
                   set-next-rule" >

<!-- digester-rules is the root element. -->
<!ELEMENT digester-rules (pattern | include | bean-property-setter-rule | call-method-rule | call-param-rule |  object-param-rule | factory-create-rule | object-create-rule | set-properties-rule | set-property-rule | set-top-rule | set-next-rule )*>


<!-- <pattern> defines a matching pattern, or part of a matching pattern. Any
     rule nested in a pattern element prepends its parent's to its pattern.
     Patterns may be recursively nested.
     Example:
       <pattern value="foo">
          <pattern value="bar">
            <object-create-rule pattern="baz" classname="Fubar" />
          </pattern>
       </pattern>

     The above sample fragment defines an ObjectCreateRule associated
     with the pattern "foo/bar/baz".

  Note that the use of pattern elements is optional; an alternative is for
  each rule element to contain a 'pattern' attribute.   -->
<!ELEMENT pattern (pattern | include | bean-property-setter-rule | call-method-rule | call-param-rule |
                   factory-create-rule | object-create-rule |
                   set-properties-rule | set-property-rule | set-top-rule |
                   set-next-rule )*>
<!ATTLIST pattern
    value CDATA #REQUIRED>


<!--
  <include> allows one set of digester rules to be included inside
  another. The 'path' attribute contains the URI of the document to
  include. Inclusion behaves as if the included rules document is
  'macro-expanded' within the outer document.
  Programmatically initialized rules can be included as well, via the
  'class' attribute. The 'class' attribute should contain the name
  of a class that implements
  org.apache.commons.digester.xmlrules.DigesterRulesSource.
-->
<!ELEMENT include EMPTY>
<!ATTLIST include
    path  CDATA #IMPLIED
    class CDATA #IMPLIED>


<!-- Each 'rule' element below corresponds to a concrete subclass
     of org.apache.framework.digester.Rule.
     Each 'rule' element has an optional 'pattern' attribute, which
     defines the pattern for that rule instance. If the rule element
     is nested inside one or more <pattern> elements, those patterns
     will be prepended to the pattern specified in the rule's 'pattern'
     attribute. -->

<!-- Bean Property Setter Rule -->
<!ELEMENT bean-property-setter-rule EMPTY>
<!ATTLIST bean-property-setter-rule
    pattern      CDATA #IMPLIED
    propertyname CDATA #IMPLIED>

<!-- CallMethodRule -->
<!ELEMENT call-method-rule EMPTY>
<!ATTLIST call-method-rule
    pattern    CDATA #IMPLIED
    methodname CDATA #REQUIRED
    paramcount CDATA #IMPLIED
    paramtypes CDATA #IMPLIED>

<!-- 
    CallParamRule 
    attrname - set param from attribute value (cannot be combined with from-stack)
    from-stack - set param from stack (cannot be combined with attrname)
    -->
<!ELEMENT call-param-rule EMPTY>
<!ATTLIST call-param-rule
    pattern  CDATA #IMPLIED
    paramnumber CDATA #REQUIRED
    attrname CDATA #IMPLIED
    from-stack CDATA #IMPLIED>
    
<!--
    ObjectParamRule
    attrname  
           - an arbitrary Object defined programatically, assigned if the 
             element pattern AND specified attribute name are matched
    param 
           - an arbitrary Object defined programatically, assigned when the 
             element pattern associated with the Rule is matched
    type 
           - class name for object
    value 
           - initial value for the object
    -->
<!ELEMENT object-param-rule EMPTY>
<!ATTLIST object-param-rule
    pattern  CDATA #IMPLIED
    paramnumber CDATA #REQUIRED
    param CDATA #REQUIRED
    attrname CDATA #IMPLIED
    type CDATA #REQUIRED
    value CDATA #IMPLIED>

<!-- 
    FactoryCreateRule 
    
    ignore-exceptions - if this attribute is (ignore case) 'true' then any exceptions
                        thrown by the object create rule will be ignore.
                        This will allow processing to continue.
    -->
<!ELEMENT factory-create-rule EMPTY>
<!ATTLIST factory-create-rule
    pattern   CDATA #IMPLIED
    classname CDATA #REQUIRED
    attrname  CDATA #IMPLIED
    ignore-exceptions  CDATA #IMPLIED> 

<!-- ObjectCreateRule -->
<!ELEMENT object-create-rule EMPTY>
<!ATTLIST object-create-rule
    pattern   CDATA #IMPLIED
    classname CDATA #REQUIRED
    attrname  CDATA #IMPLIED>

<!-- SetPropertiesRule -->
<!ELEMENT set-properties-rule (alias)*>
<!ATTLIST set-properties-rule
    pattern   CDATA #IMPLIED>

<!-- An alias is a custom attribute->property name mapping -->
<!ELEMENT alias EMPTY>
<!ATTLIST alias
 attr-name CDATA #REQUIRED
 prop-name CDATA #IMPLIED>

<!-- SetPropertyRule -->
<!ELEMENT set-property-rule EMPTY>
<!ATTLIST set-property-rule
    pattern   CDATA #IMPLIED
    name      CDATA #IMPLIED
    value     CDATA #IMPLIED>

<!-- SetTopRule -->
<!ELEMENT set-top-rule EMPTY>
<!ATTLIST set-top-rule
    pattern    CDATA #IMPLIED
    methodname CDATA #REQUIRED
    paramtype  CDATA #IMPLIED>

<!-- SetNextRule -->
<!ELEMENT set-next-rule EMPTY>
<!ATTLIST set-next-rule
    pattern    CDATA #IMPLIED
    methodname CDATA #REQUIRED
    paramtype  CDATA #IMPLIED>