Revision 12439 trunk/libraries/libGPE/src/org/gvsig/xmlschema/utils/DOMObjectsFactory.java
DOMObjectsFactory.java | ||
---|---|---|
49 | 49 |
* |
50 | 50 |
* $Id$ |
51 | 51 |
* $Log$ |
52 |
* Revision 1.2 2007-06-29 12:19:14 jorpiell |
|
52 |
* Revision 1.3 2007-07-02 09:57:35 jorpiell |
|
53 |
* The generated xsd schemas have to be valid |
|
54 |
* |
|
55 |
* Revision 1.2 2007/06/29 12:19:14 jorpiell |
|
53 | 56 |
* The schema validation is made independently of the concrete writer |
54 | 57 |
* |
55 | 58 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
... | ... | |
150 | 153 |
} |
151 | 154 |
|
152 | 155 |
/** |
156 |
* Fill the element node attributes |
|
157 |
* @param schema |
|
158 |
* Schema that will be used to create the element |
|
159 |
* @param name |
|
160 |
* Element name |
|
161 |
* @param type |
|
162 |
* Element type |
|
163 |
* @param nillable |
|
164 |
* If the element is nillable |
|
165 |
* @param minOccurs |
|
166 |
* The min occurs |
|
167 |
* @param maxOccurs |
|
168 |
* The max occurs |
|
169 |
*/ |
|
170 |
public Element createElement(IXSSchema schema, String name, String type, String substitutionGroup){ |
|
171 |
Element element = schema.getDocument().createElement(addXSQname(SchemaTags.ELEMENT)); |
|
172 |
element.setAttribute(SchemaTags.NAME, name); |
|
173 |
if (type != null){ |
|
174 |
element.setAttribute(SchemaTags.TYPE, type); |
|
175 |
} |
|
176 |
if (substitutionGroup != null){ |
|
177 |
element.setAttribute(SchemaTags.SUBSTITUTIONGROUP, type); |
|
178 |
} |
|
179 |
return element; |
|
180 |
} |
|
181 |
|
|
182 |
/** |
|
153 | 183 |
* Creates a new ComplxType element |
154 | 184 |
* @param schema |
155 | 185 |
* Schema that will be used to create the element |
Also available in: Unified diff