2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.aai.schemagen.genxsd;
23 import com.google.common.base.Joiner;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.StringTokenizer;
28 import java.util.Vector;
30 import org.apache.commons.lang3.StringUtils;
31 import org.onap.aai.setup.SchemaVersion;
32 import org.w3c.dom.Attr;
33 import org.w3c.dom.DOMException;
34 import org.w3c.dom.Document;
35 import org.w3c.dom.Element;
36 import org.w3c.dom.NamedNodeMap;
37 import org.w3c.dom.Node;
38 import org.w3c.dom.NodeList;
39 import org.w3c.dom.TypeInfo;
40 import org.w3c.dom.UserDataHandler;
42 public class XSDElement implements Element {
43 Element xmlElementElement;
45 private static final int VALUE_NONE = 0;
46 private static final int VALUE_DESCRIPTION = 1;
47 private static final int VALUE_INDEXED_PROPS = 2;
48 private static final int VALUE_CONTAINER = 3;
49 private static final int VALUE_REQUIRES = 4;
50 private static final int VALUE_DSLSTARTNODE = 5;
52 public XSDElement(Element xmlElementElement, String maxOccurs) {
54 this.xmlElementElement = xmlElementElement;
55 this.maxOccurs = maxOccurs;
58 public XSDElement(Element xmlElementElement) {
60 this.xmlElementElement = xmlElementElement;
61 this.maxOccurs = null;
64 public String name() {
65 return this.getAttribute("name");
68 public Vector<String> getAddTypes(String version) {
69 String apiVersionFmt = "." + version + ".";
70 NamedNodeMap attributes = this.getAttributes();
71 Vector<String> addTypeV = new Vector<>(); // vector of 1
72 String addType = null;
74 for (int j = 0; j < attributes.getLength(); ++j) {
75 Attr attr = (Attr) attributes.item(j);
76 String attrName = attr.getNodeName();
78 String attrValue = attr.getNodeValue();
79 if ("type".equals(attrName)) {
80 if (attrValue.contains(apiVersionFmt)) {
81 addType = attrValue.substring(attrValue.lastIndexOf('.') + 1);
82 addTypeV.add(addType);
90 public String getRequiresProperty() {
91 String elementAlsoRequiresProperty = null;
92 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
94 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
95 Element xmlPropElement = (Element) xmlPropNodes.item(i);
96 if (!xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
97 .equals(this.xmlElementElement.getAttribute("name"))) {
100 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
102 for (int j = 0; j < childNodes.getLength(); ++j) {
103 Element childElement = (Element) childNodes.item(j);
105 int useValue = VALUE_NONE;
106 NamedNodeMap attributes = childElement.getAttributes();
107 for (int k = 0; k < attributes.getLength(); ++k) {
108 Attr attr = (Attr) attributes.item(k);
109 String attrName = attr.getNodeName();
110 String attrValue = attr.getNodeValue();
111 if (attrName == null || attrValue == null) {
114 if (attrName.equals("name") && attrValue.equals("requires")) {
115 useValue = VALUE_REQUIRES;
117 if (useValue == VALUE_REQUIRES && attrName.equals("value")) {
118 elementAlsoRequiresProperty = attrValue;
123 return elementAlsoRequiresProperty;
126 public String getPathDescriptionProperty() {
127 String pathDescriptionProperty = null;
128 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
130 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
131 Element xmlPropElement = (Element) xmlPropNodes.item(i);
132 if (!xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
133 .equals(this.xmlElementElement.getAttribute("name"))) {
136 // This stopped working, replaced with above - should figure out why...
137 // if ( !xmlPropElement.getParentNode().isSameNode(this.xmlElementElement))
139 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
141 for (int j = 0; j < childNodes.getLength(); ++j) {
142 Element childElement = (Element) childNodes.item(j);
144 int useValue = VALUE_NONE;
145 NamedNodeMap attributes = childElement.getAttributes();
146 for (int k = 0; k < attributes.getLength(); ++k) {
147 Attr attr = (Attr) attributes.item(k);
148 String attrName = attr.getNodeName();
149 String attrValue = attr.getNodeValue();
150 if (attrName == null || attrValue == null) {
153 if (attrName.equals("name") && attrValue.equals("description")) {
154 useValue = VALUE_DESCRIPTION;
156 if (useValue == VALUE_DESCRIPTION && attrName.equals("value")) {
157 pathDescriptionProperty = attrValue;
162 if (pathDescriptionProperty != null) {
163 // suppress non-printable characters in a description
164 String replaceDescription = pathDescriptionProperty.replaceAll("[^\\p{ASCII}]", "");
165 return replaceDescription;
167 return pathDescriptionProperty;
170 public Vector<String> getProps(int needValue) {
171 Vector<String> props = new Vector<String>();
172 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
174 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
175 Element xmlPropElement = (Element) xmlPropNodes.item(i);
176 if (!xmlPropElement.getParentNode().isSameNode(this.xmlElementElement)) {
179 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
180 for (int j = 0; j < childNodes.getLength(); ++j) {
181 Element childElement = (Element) childNodes.item(j);
183 int useValue = VALUE_NONE;
184 NamedNodeMap attributes = childElement.getAttributes();
185 for (int k = 0; k < attributes.getLength(); ++k) {
186 Attr attr = (Attr) attributes.item(k);
187 String attrName = attr.getNodeName();
188 String attrValue = attr.getNodeValue();
189 if (attrName == null || attrValue == null) {
192 if (needValue == VALUE_INDEXED_PROPS && attrValue.equals("indexedProps")) {
193 useValue = VALUE_INDEXED_PROPS;
194 } else if (needValue == VALUE_DSLSTARTNODE
195 && attrValue.equals("dslStartNodeProps")) {
196 useValue = VALUE_DSLSTARTNODE;
198 if (useValue != VALUE_NONE && attrName.equals("value")) {
199 props = getProps(attrValue);
207 private static Vector<String> getProps(String attrValue) {
208 if (attrValue == null) {
211 StringTokenizer st = new StringTokenizer(attrValue, ",");
212 if (st.countTokens() == 0) {
215 Vector<String> result = new Vector<String>();
216 while (st.hasMoreTokens()) {
217 result.add(st.nextToken());
222 public Vector<String> getIndexedProps() {
223 return getProps(VALUE_INDEXED_PROPS);
226 public Vector<String> getDslStartNodeProps() {
227 return getProps(VALUE_DSLSTARTNODE);
230 public String getContainerProperty() {
231 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
232 String container = null;
233 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
234 Element xmlPropElement = (Element) xmlPropNodes.item(i);
235 if (!xmlPropElement.getParentNode().isSameNode(this.xmlElementElement)) {
238 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
239 for (int j = 0; j < childNodes.getLength(); ++j) {
240 Element childElement = (Element) childNodes.item(j);
242 int useValue = VALUE_NONE;
243 NamedNodeMap attributes = childElement.getAttributes();
244 for (int k = 0; k < attributes.getLength(); ++k) {
245 Attr attr = (Attr) attributes.item(k);
246 String attrName = attr.getNodeName();
247 String attrValue = attr.getNodeValue();
248 if (attrName == null || attrValue == null) {
251 if (useValue == VALUE_CONTAINER && attrName.equals("value")) {
252 container = attrValue;
254 if (attrValue.equals("container")) {
255 useValue = VALUE_CONTAINER;
263 public String getQueryParamYAML() {
264 StringBuilder sbParameter = new StringBuilder();
265 sbParameter.append(" - name: ").append(this.getAttribute("name")).append("\n");
266 sbParameter.append((" in: query\n"));
267 if (this.getAttribute("description") != null
268 && this.getAttribute("description").length() > 0) {
269 sbParameter.append(" description: ").append(this.getAttribute("description"))
272 sbParameter.append((" description: n/a\n"));
274 sbParameter.append((" required: false\n"));
275 if (("java.lang.String").equals(this.getAttribute("type"))) {
276 sbParameter.append(" type: string\n");
278 if (("java.lang.Long").equals(this.getAttribute("type"))) {
279 sbParameter.append(" type: integer\n");
280 sbParameter.append(" format: int64\n");
282 if (("java.lang.Integer").equals(this.getAttribute("type"))) {
283 sbParameter.append(" type: integer\n");
284 sbParameter.append(" format: int32\n");
286 if (("java.lang.Float").equals(this.getAttribute("type"))) {
287 sbParameter.append(" type: number\n");
288 sbParameter.append(" format: float\n");
290 if (("java.lang.Double").equals(this.getAttribute("type"))) {
291 sbParameter.append(" type: number\n");
292 sbParameter.append(" format: double\n");
294 if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
295 sbParameter.append(" type: boolean\n");
297 return sbParameter.toString();
300 public String getPathParamYAML(String elementDescription) {
301 return getPathParamYAML(elementDescription, null);
304 public String getPathParamYAML(String elementDescription, String overrideName) {
305 // updated to allow caller to provide parameter name to use in API
306 StringBuilder sbParameter = new StringBuilder();
307 if (overrideName == null) {
308 overrideName = this.getAttribute("name");
310 sbParameter.append(" - name: ").append(overrideName).append("\n");
311 sbParameter.append((" in: path\n"));
312 if (elementDescription != null && elementDescription.length() > 0) {
313 sbParameter.append(" description: ").append(elementDescription).append("\n");
315 sbParameter.append((" required: true\n"));
316 if (("java.lang.String").equals(this.getAttribute("type"))) {
317 sbParameter.append(" type: string\n");
319 if (("java.lang.Long").equals(this.getAttribute("type"))) {
320 sbParameter.append(" type: integer\n");
321 sbParameter.append(" format: int64\n");
323 if (("java.lang.Integer").equals(this.getAttribute("type"))) {
324 sbParameter.append(" type: integer\n");
325 sbParameter.append(" format: int32\n");
327 if (("java.lang.Float").equals(this.getAttribute("type"))) {
328 sbParameter.append(" type: number\n");
329 sbParameter.append(" format: float\n");
331 if (("java.lang.Double").equals(this.getAttribute("type"))) {
332 sbParameter.append(" type: number\n");
333 sbParameter.append(" format: double\n");
335 if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
336 sbParameter.append(" type: boolean\n");
338 if (StringUtils.isNotBlank(this.getAttribute("name"))) {
339 sbParameter.append(" example: " + "__")
340 .append(this.getAttribute("name").toUpperCase()).append("__").append("\n");
342 return sbParameter.toString();
345 public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
346 StringBuilder sbElement = new StringBuilder();
347 String elementName = this.getAttribute("name");
348 String elementType = this.getAttribute("type");
349 String elementContainerType = this.getAttribute("container-type");
350 String elementIsRequired = this.getAttribute("required");
351 String addType = elementType.contains("." + v.toString() + ".")
352 ? elementType.substring(elementType.lastIndexOf('.') + 1)
355 if (addType != null) {
356 sbElement.append(" <xs:element ref=\"tns:")
357 .append(driver.getXmlRootElementName(addType)).append("\"");
359 sbElement.append(" <xs:element name=\"").append(elementName).append("\"");
361 if (elementType.equals("java.lang.String")) {
362 sbElement.append(" type=\"xs:string\"");
364 if (elementType.equals("java.lang.Long")) {
365 sbElement.append(" type=\"xs:unsignedInt\"");
367 if (elementType.equals("java.lang.Integer")) {
368 sbElement.append(" type=\"xs:int\"");
370 if (elementType.equals("java.lang.Float")) {
371 sbElement.append(" type=\"xs:float\"");
373 if (elementType.equals("java.lang.Double")) {
374 sbElement.append(" type=\"xs:double\"");
376 if (elementType.equals("java.lang.Boolean")) {
377 sbElement.append(" type=\"xs:boolean\"");
379 if (addType != null || elementType.startsWith("java.lang.")) {
380 sbElement.append(" minOccurs=\"0\"");
382 if (elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
383 sbElement.append(" maxOccurs=\"").append(maxOccurs).append("\"");
386 String annotation = new XSDElement(xmlElementElement, maxOccurs)
387 .getHTMLAnnotation("field", " ");
389 StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
390 sbElement.append(annotation);
391 sbElement.append(StringUtils.isNotEmpty(annotation)
392 ? " </xs:element>" + OxmFileProcessor.LINE_SEPARATOR
393 : "/>" + OxmFileProcessor.LINE_SEPARATOR);
395 sbElement.append("/>").append(OxmFileProcessor.LINE_SEPARATOR);
397 return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
398 // return sbElement.toString();
401 public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v,
402 boolean useAnnotation) {
404 NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
406 String xmlElementWrapper = null;
407 if (childNodes.getLength() > 0) {
408 Element childElement = (Element) childNodes.item(0);
410 xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
412 if (xmlElementWrapper == null) {
413 return unwrappedElement;
416 StringBuilder sbElement = new StringBuilder();
417 sbElement.append(" <xs:element name=\"").append(xmlElementWrapper).append("\"");
418 String elementType = xmlElementElement.getAttribute("type");
419 String elementIsRequired = this.getAttribute("required");
420 String addType = elementType.contains("." + v.toString() + ".")
421 ? elementType.substring(elementType.lastIndexOf('.') + 1)
424 if (elementIsRequired == null || !elementIsRequired.equals("true") || addType != null) {
425 sbElement.append(" minOccurs=\"0\"");
427 sbElement.append(">").append(OxmFileProcessor.LINE_SEPARATOR);
428 sbElement.append(" <xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
430 XSDElement javaTypeElement = new XSDElement((Element) this.getParentNode(), maxOccurs);
431 sbElement.append(javaTypeElement.getHTMLAnnotation("class", " "));
433 sbElement.append(" <xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
434 sbElement.append(" ");
435 sbElement.append(unwrappedElement);
436 sbElement.append(" </xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
437 sbElement.append(" </xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
438 sbElement.append(" </xs:element>").append(OxmFileProcessor.LINE_SEPARATOR);
439 return sbElement.toString();
442 public String getHTMLAnnotation(String target, String indentation) {
443 StringBuilder sb = new StringBuilder();
444 List<String> metadata = new ArrayList<>();
445 if ("true".equals(this.getAttribute("xml-key"))) {
446 metadata.add("isKey=true");
449 NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
450 Element xmlPropElement = null;
451 for (int i = 0; i < xmlPropTags.getLength(); ++i) {
452 xmlPropElement = (Element) xmlPropTags.item(i);
453 if (xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
454 .equals(this.xmlElementElement.getAttribute("name"))) {
458 if (xmlPropElement != null) {
459 NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
460 for (int i = 0; i < xmlProperties.getLength(); i++) {
461 Element item = (Element) xmlProperties.item(i);
462 String name = item.getAttribute("name");
463 String value = item.getAttribute("value");
464 if (name.equals("abstract")) {
466 } else if (name.equals("extends")) {
467 name = "extendsFrom";
469 metadata.add(name + "=\"" + value.replaceAll("&", "&") + "\"");
472 if (metadata.size() == 0) {
475 sb.append(indentation).append("<xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
476 sb.append(indentation).append(" <xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR)
477 .append(indentation).append(" <annox:annotate target=\"").append(target)
478 .append("\">@org.onap.aai.annotations.Metadata(").append(Joiner.on(",").join(metadata))
479 .append(")</annox:annotate>").append(OxmFileProcessor.LINE_SEPARATOR)
480 .append(indentation).append(" </xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR);
481 sb.append(indentation).append("</xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
482 return sb.toString();
485 public String getTypePropertyYAML(boolean isDslStartNode) {
486 StringBuilder sbProperties = new StringBuilder();
487 sbProperties.append(" ").append(this.getAttribute("name")).append(":\n");
488 sbProperties.append(" type: ");
490 if (("java.lang.String").equals(this.getAttribute("type"))) {
491 sbProperties.append("string\n");
492 } else if (("java.lang.Long").equals(this.getAttribute("type"))) {
493 sbProperties.append("integer\n");
494 sbProperties.append(" format: int64\n");
495 } else if (("java.lang.Integer").equals(this.getAttribute("type"))) {
496 sbProperties.append("integer\n");
497 sbProperties.append(" format: int32\n");
498 } else if (("java.lang.Float").equals(this.getAttribute("type"))) {
499 sbProperties.append("number\n");
500 sbProperties.append(" format: float\n");
501 } else if (("java.lang.Double").equals(this.getAttribute("type"))) {
502 sbProperties.append("number\n");
503 sbProperties.append(" format: double\n");
504 } else if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
505 sbProperties.append("boolean\n");
507 String attrDescription = this.getPathDescriptionProperty();
508 if (attrDescription != null && attrDescription.length() > 0) {
509 if (!isDslStartNode) {
510 sbProperties.append(" description: ").append(attrDescription).append("\n");
512 sbProperties.append(" description: |\n");
513 sbProperties.append(" ").append(attrDescription).append("\n");
515 " *This property can be used as a filter to find the start node for a dsl query\n");
518 if (isDslStartNode) {
519 sbProperties.append(" description: |\n");
520 sbProperties.append(" \n");
522 " *This property can be used as a filter to find the start node for a dsl query\n");
525 String elementAlsoRequiresProperty = this.getRequiresProperty();
526 if (StringUtils.isNotEmpty(elementAlsoRequiresProperty)) {
527 sbProperties.append(" also requires: ").append(elementAlsoRequiresProperty)
530 return sbProperties.toString();
533 public boolean isStandardType() {
534 switch (this.getAttribute("type")) {
535 case "java.lang.String":
536 case "java.lang.Long":
537 case "java.lang.Integer":
538 case "java.lang.Float":
539 case "java.lang.Double":
540 case "java.lang.Boolean":
547 public String getNodeName() {
548 return xmlElementElement.getNodeName();
552 public String getNodeValue() throws DOMException {
553 return xmlElementElement.getNodeValue();
557 public void setNodeValue(String nodeValue) throws DOMException {
558 xmlElementElement.setNodeValue(nodeValue);
562 public short getNodeType() {
563 return xmlElementElement.getNodeType();
567 public Node getParentNode() {
568 return xmlElementElement.getParentNode();
572 public NodeList getChildNodes() {
573 return xmlElementElement.getChildNodes();
577 public Node getFirstChild() {
578 return xmlElementElement.getFirstChild();
582 public Node getLastChild() {
583 return xmlElementElement.getLastChild();
587 public Node getPreviousSibling() {
588 return xmlElementElement.getPreviousSibling();
592 public Node getNextSibling() {
593 return xmlElementElement.getNextSibling();
597 public NamedNodeMap getAttributes() {
598 return xmlElementElement.getAttributes();
602 public Document getOwnerDocument() {
603 return xmlElementElement.getOwnerDocument();
607 public Node insertBefore(Node newChild, Node refChild) throws DOMException {
608 return xmlElementElement.insertBefore(newChild, refChild);
612 public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
613 return xmlElementElement.replaceChild(newChild, oldChild);
617 public Node removeChild(Node oldChild) throws DOMException {
618 return xmlElementElement.removeChild(oldChild);
622 public Node appendChild(Node newChild) throws DOMException {
623 return xmlElementElement.appendChild(newChild);
627 public boolean hasChildNodes() {
628 return xmlElementElement.hasChildNodes();
632 public Node cloneNode(boolean deep) {
633 return xmlElementElement.cloneNode(deep);
637 public void normalize() {
638 xmlElementElement.normalize();
642 public boolean isSupported(String feature, String version) {
643 return xmlElementElement.isSupported(feature, version);
647 public String getNamespaceURI() {
648 return xmlElementElement.getNamespaceURI();
652 public String getPrefix() {
653 return xmlElementElement.getPrefix();
657 public void setPrefix(String prefix) throws DOMException {
658 xmlElementElement.setPrefix(prefix);
662 public String getLocalName() {
664 return xmlElementElement.getLocalName();
668 public boolean hasAttributes() {
669 return xmlElementElement.hasAttributes();
673 public String getBaseURI() {
674 return xmlElementElement.getBaseURI();
678 public short compareDocumentPosition(Node other) throws DOMException {
679 return xmlElementElement.compareDocumentPosition(other);
683 public String getTextContent() throws DOMException {
684 return xmlElementElement.getTextContent();
688 public void setTextContent(String textContent) throws DOMException {
689 xmlElementElement.setTextContent(textContent);
693 public boolean isSameNode(Node other) {
694 return xmlElementElement.isSameNode(other);
698 public String lookupPrefix(String namespaceURI) {
699 return xmlElementElement.lookupPrefix(namespaceURI);
703 public boolean isDefaultNamespace(String namespaceURI) {
704 return xmlElementElement.isDefaultNamespace(namespaceURI);
708 public String lookupNamespaceURI(String prefix) {
709 return xmlElementElement.lookupNamespaceURI(prefix);
713 public boolean isEqualNode(Node arg) {
714 return xmlElementElement.isEqualNode(arg);
718 public Object getFeature(String feature, String version) {
719 return xmlElementElement.getFeature(feature, version);
723 public Object setUserData(String key, Object data, UserDataHandler handler) {
724 return xmlElementElement.setUserData(key, data, handler);
728 public Object getUserData(String key) {
729 return xmlElementElement.getUserData(key);
733 public String getTagName() {
734 return xmlElementElement.getTagName();
738 public String getAttribute(String name) {
739 return xmlElementElement.getAttribute(name);
743 public void setAttribute(String name, String value) throws DOMException {
744 xmlElementElement.setAttribute(name, value);
748 public void removeAttribute(String name) throws DOMException {
749 xmlElementElement.removeAttribute(name);
753 public Attr getAttributeNode(String name) {
754 return xmlElementElement.getAttributeNode(name);
758 public Attr setAttributeNode(Attr newAttr) throws DOMException {
759 return xmlElementElement.setAttributeNode(newAttr);
763 public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
764 return xmlElementElement.removeAttributeNode(oldAttr);
768 public NodeList getElementsByTagName(String name) {
769 return xmlElementElement.getElementsByTagName(name);
773 public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
774 return xmlElementElement.getAttributeNS(namespaceURI, localName);
778 public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
779 throws DOMException {
780 xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
784 public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
785 xmlElementElement.removeAttributeNS(namespaceURI, localName);
789 public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
790 return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
794 public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
795 return xmlElementElement.setAttributeNodeNS(newAttr);
799 public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
800 throws DOMException {
801 return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
805 public boolean hasAttribute(String name) {
806 return xmlElementElement.hasAttribute(name);
810 public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
811 return xmlElementElement.hasAttributeNS(namespaceURI, localName);
815 public TypeInfo getSchemaTypeInfo() {
816 return xmlElementElement.getSchemaTypeInfo();
820 public void setIdAttribute(String name, boolean isId) throws DOMException {
821 xmlElementElement.setIdAttribute(name, isId);
826 public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
827 throws DOMException {
828 xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
832 public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
833 xmlElementElement.setIdAttributeNode(idAttr, isId);