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((" required: false\n"));
273 if (("java.lang.String").equals(this.getAttribute("type"))) {
274 sbParameter.append(" type: string\n");
276 if (("java.lang.Long").equals(this.getAttribute("type"))) {
277 sbParameter.append(" type: integer\n");
278 sbParameter.append(" format: int64\n");
280 if (("java.lang.Integer").equals(this.getAttribute("type"))) {
281 sbParameter.append(" type: integer\n");
282 sbParameter.append(" format: int32\n");
284 if (("java.lang.Float").equals(this.getAttribute("type"))) {
285 sbParameter.append(" type: number\n");
286 sbParameter.append(" format: float\n");
288 if (("java.lang.Double").equals(this.getAttribute("type"))) {
289 sbParameter.append(" type: number\n");
290 sbParameter.append(" format: double\n");
292 if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
293 sbParameter.append(" type: boolean\n");
295 return sbParameter.toString();
298 public String getPathParamYAML(String elementDescription) {
299 return getPathParamYAML(elementDescription, null);
302 public String getPathParamYAML(String elementDescription, String overrideName) {
303 // updated to allow caller to provide parameter name to use in API
304 StringBuilder sbParameter = new StringBuilder();
305 if (overrideName == null) {
306 overrideName = this.getAttribute("name");
308 sbParameter.append(" - name: ").append(overrideName).append("\n");
309 sbParameter.append((" in: path\n"));
310 if (elementDescription != null && elementDescription.length() > 0) {
311 sbParameter.append(" description: ").append(elementDescription).append("\n");
313 sbParameter.append((" required: true\n"));
314 if (("java.lang.String").equals(this.getAttribute("type"))) {
315 sbParameter.append(" type: string\n");
317 if (("java.lang.Long").equals(this.getAttribute("type"))) {
318 sbParameter.append(" type: integer\n");
319 sbParameter.append(" format: int64\n");
321 if (("java.lang.Integer").equals(this.getAttribute("type"))) {
322 sbParameter.append(" type: integer\n");
323 sbParameter.append(" format: int32\n");
325 if (("java.lang.Float").equals(this.getAttribute("type"))) {
326 sbParameter.append(" type: number\n");
327 sbParameter.append(" format: float\n");
329 if (("java.lang.Double").equals(this.getAttribute("type"))) {
330 sbParameter.append(" type: number\n");
331 sbParameter.append(" format: double\n");
333 if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
334 sbParameter.append(" type: boolean\n");
336 return sbParameter.toString();
339 public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
340 StringBuilder sbElement = new StringBuilder();
341 String elementName = this.getAttribute("name");
342 String elementType = this.getAttribute("type");
343 String elementContainerType = this.getAttribute("container-type");
344 String elementIsRequired = this.getAttribute("required");
345 String addType = elementType.contains("." + v.toString() + ".")
346 ? elementType.substring(elementType.lastIndexOf('.') + 1)
349 if (addType != null) {
350 sbElement.append(" <xs:element ref=\"tns:")
351 .append(driver.getXmlRootElementName(addType)).append("\"");
353 sbElement.append(" <xs:element name=\"").append(elementName).append("\"");
355 if (elementType.equals("java.lang.String")) {
356 sbElement.append(" type=\"xs:string\"");
358 if (elementType.equals("java.lang.Long")) {
359 sbElement.append(" type=\"xs:unsignedInt\"");
361 if (elementType.equals("java.lang.Integer")) {
362 sbElement.append(" type=\"xs:int\"");
364 if (elementType.equals("java.lang.Float")) {
365 sbElement.append(" type=\"xs:float\"");
367 if (elementType.equals("java.lang.Double")) {
368 sbElement.append(" type=\"xs:double\"");
370 if (elementType.equals("java.lang.Boolean")) {
371 sbElement.append(" type=\"xs:boolean\"");
373 if (addType != null || elementType.startsWith("java.lang.")) {
374 sbElement.append(" minOccurs=\"0\"");
376 if (elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
377 sbElement.append(" maxOccurs=\"").append(maxOccurs).append("\"");
380 String annotation = new XSDElement(xmlElementElement, maxOccurs)
381 .getHTMLAnnotation("field", " ");
383 StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
384 sbElement.append(annotation);
385 sbElement.append(StringUtils.isNotEmpty(annotation)
386 ? " </xs:element>" + OxmFileProcessor.LINE_SEPARATOR
387 : "/>" + OxmFileProcessor.LINE_SEPARATOR);
389 sbElement.append("/>").append(OxmFileProcessor.LINE_SEPARATOR);
391 return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
392 // return sbElement.toString();
395 public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v,
396 boolean useAnnotation) {
398 NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
400 String xmlElementWrapper = null;
401 if (childNodes.getLength() > 0) {
402 Element childElement = (Element) childNodes.item(0);
404 xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
406 if (xmlElementWrapper == null) {
407 return unwrappedElement;
410 StringBuilder sbElement = new StringBuilder();
411 sbElement.append(" <xs:element name=\"").append(xmlElementWrapper).append("\"");
412 String elementType = xmlElementElement.getAttribute("type");
413 String elementIsRequired = this.getAttribute("required");
414 String addType = elementType.contains("." + v.toString() + ".")
415 ? elementType.substring(elementType.lastIndexOf('.') + 1)
418 if (elementIsRequired == null || !elementIsRequired.equals("true") || addType != null) {
419 sbElement.append(" minOccurs=\"0\"");
421 sbElement.append(">").append(OxmFileProcessor.LINE_SEPARATOR);
422 sbElement.append(" <xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
424 XSDElement javaTypeElement = new XSDElement((Element) this.getParentNode(), maxOccurs);
425 sbElement.append(javaTypeElement.getHTMLAnnotation("class", " "));
427 sbElement.append(" <xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
428 sbElement.append(" ");
429 sbElement.append(unwrappedElement);
430 sbElement.append(" </xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
431 sbElement.append(" </xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
432 sbElement.append(" </xs:element>").append(OxmFileProcessor.LINE_SEPARATOR);
433 return sbElement.toString();
436 public String getHTMLAnnotation(String target, String indentation) {
437 StringBuilder sb = new StringBuilder();
438 List<String> metadata = new ArrayList<>();
439 if ("true".equals(this.getAttribute("xml-key"))) {
440 metadata.add("isKey=true");
443 NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
444 Element xmlPropElement = null;
445 for (int i = 0; i < xmlPropTags.getLength(); ++i) {
446 xmlPropElement = (Element) xmlPropTags.item(i);
447 if (xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
448 .equals(this.xmlElementElement.getAttribute("name"))) {
452 if (xmlPropElement != null) {
453 NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
454 for (int i = 0; i < xmlProperties.getLength(); i++) {
455 Element item = (Element) xmlProperties.item(i);
456 String name = item.getAttribute("name");
457 String value = item.getAttribute("value");
458 if (name.equals("abstract")) {
460 } else if (name.equals("extends")) {
461 name = "extendsFrom";
463 metadata.add(name + "=\"" + value.replaceAll("&", "&") + "\"");
466 if (metadata.size() == 0) {
469 sb.append(indentation).append("<xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
470 sb.append(indentation).append(" <xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR)
471 .append(indentation).append(" <annox:annotate target=\"").append(target)
472 .append("\">@org.onap.aai.annotations.Metadata(").append(Joiner.on(",").join(metadata))
473 .append(")</annox:annotate>").append(OxmFileProcessor.LINE_SEPARATOR)
474 .append(indentation).append(" </xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR);
475 sb.append(indentation).append("</xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
476 return sb.toString();
479 public String getTypePropertyYAML(boolean isDslStartNode) {
480 StringBuilder sbProperties = new StringBuilder();
481 sbProperties.append(" ").append(this.getAttribute("name")).append(":\n");
482 sbProperties.append(" type: ");
484 if (("java.lang.String").equals(this.getAttribute("type"))) {
485 sbProperties.append("string\n");
486 } else if (("java.lang.Long").equals(this.getAttribute("type"))) {
487 sbProperties.append("integer\n");
488 sbProperties.append(" format: int64\n");
489 } else if (("java.lang.Integer").equals(this.getAttribute("type"))) {
490 sbProperties.append("integer\n");
491 sbProperties.append(" format: int32\n");
492 } else if (("java.lang.Float").equals(this.getAttribute("type"))) {
493 sbProperties.append("number\n");
494 sbProperties.append(" format: float\n");
495 } else if (("java.lang.Double").equals(this.getAttribute("type"))) {
496 sbProperties.append("number\n");
497 sbProperties.append(" format: double\n");
498 } else if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
499 sbProperties.append("boolean\n");
501 String attrDescription = this.getPathDescriptionProperty();
502 if (attrDescription != null && attrDescription.length() > 0) {
503 if (!isDslStartNode) {
504 sbProperties.append(" description: ").append(attrDescription).append("\n");
506 sbProperties.append(" description: |\n");
507 sbProperties.append(" ").append(attrDescription).append("\n");
509 " *This property can be used as a filter to find the start node for a dsl query\n");
512 if (isDslStartNode) {
513 sbProperties.append(" description: |\n");
514 sbProperties.append(" \n");
516 " *This property can be used as a filter to find the start node for a dsl query\n");
519 return sbProperties.toString();
522 public boolean isStandardType() {
523 switch (this.getAttribute("type")) {
524 case "java.lang.String":
525 case "java.lang.Long":
526 case "java.lang.Integer":
527 case "java.lang.Float":
528 case "java.lang.Double":
529 case "java.lang.Boolean":
536 public String getNodeName() {
537 return xmlElementElement.getNodeName();
541 public String getNodeValue() throws DOMException {
542 return xmlElementElement.getNodeValue();
546 public void setNodeValue(String nodeValue) throws DOMException {
547 xmlElementElement.setNodeValue(nodeValue);
551 public short getNodeType() {
552 return xmlElementElement.getNodeType();
556 public Node getParentNode() {
557 return xmlElementElement.getParentNode();
561 public NodeList getChildNodes() {
562 return xmlElementElement.getChildNodes();
566 public Node getFirstChild() {
567 return xmlElementElement.getFirstChild();
571 public Node getLastChild() {
572 return xmlElementElement.getLastChild();
576 public Node getPreviousSibling() {
577 return xmlElementElement.getPreviousSibling();
581 public Node getNextSibling() {
582 return xmlElementElement.getNextSibling();
586 public NamedNodeMap getAttributes() {
587 return xmlElementElement.getAttributes();
591 public Document getOwnerDocument() {
592 return xmlElementElement.getOwnerDocument();
596 public Node insertBefore(Node newChild, Node refChild) throws DOMException {
597 return xmlElementElement.insertBefore(newChild, refChild);
601 public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
602 return xmlElementElement.replaceChild(newChild, oldChild);
606 public Node removeChild(Node oldChild) throws DOMException {
607 return xmlElementElement.removeChild(oldChild);
611 public Node appendChild(Node newChild) throws DOMException {
612 return xmlElementElement.appendChild(newChild);
616 public boolean hasChildNodes() {
617 return xmlElementElement.hasChildNodes();
621 public Node cloneNode(boolean deep) {
622 return xmlElementElement.cloneNode(deep);
626 public void normalize() {
627 xmlElementElement.normalize();
631 public boolean isSupported(String feature, String version) {
632 return xmlElementElement.isSupported(feature, version);
636 public String getNamespaceURI() {
637 return xmlElementElement.getNamespaceURI();
641 public String getPrefix() {
642 return xmlElementElement.getPrefix();
646 public void setPrefix(String prefix) throws DOMException {
647 xmlElementElement.setPrefix(prefix);
651 public String getLocalName() {
653 return xmlElementElement.getLocalName();
657 public boolean hasAttributes() {
658 return xmlElementElement.hasAttributes();
662 public String getBaseURI() {
663 return xmlElementElement.getBaseURI();
667 public short compareDocumentPosition(Node other) throws DOMException {
668 return xmlElementElement.compareDocumentPosition(other);
672 public String getTextContent() throws DOMException {
673 return xmlElementElement.getTextContent();
677 public void setTextContent(String textContent) throws DOMException {
678 xmlElementElement.setTextContent(textContent);
682 public boolean isSameNode(Node other) {
683 return xmlElementElement.isSameNode(other);
687 public String lookupPrefix(String namespaceURI) {
688 return xmlElementElement.lookupPrefix(namespaceURI);
692 public boolean isDefaultNamespace(String namespaceURI) {
693 return xmlElementElement.isDefaultNamespace(namespaceURI);
697 public String lookupNamespaceURI(String prefix) {
698 return xmlElementElement.lookupNamespaceURI(prefix);
702 public boolean isEqualNode(Node arg) {
703 return xmlElementElement.isEqualNode(arg);
707 public Object getFeature(String feature, String version) {
708 return xmlElementElement.getFeature(feature, version);
712 public Object setUserData(String key, Object data, UserDataHandler handler) {
713 return xmlElementElement.setUserData(key, data, handler);
717 public Object getUserData(String key) {
718 return xmlElementElement.getUserData(key);
722 public String getTagName() {
723 return xmlElementElement.getTagName();
727 public String getAttribute(String name) {
728 return xmlElementElement.getAttribute(name);
732 public void setAttribute(String name, String value) throws DOMException {
733 xmlElementElement.setAttribute(name, value);
737 public void removeAttribute(String name) throws DOMException {
738 xmlElementElement.removeAttribute(name);
742 public Attr getAttributeNode(String name) {
743 return xmlElementElement.getAttributeNode(name);
747 public Attr setAttributeNode(Attr newAttr) throws DOMException {
748 return xmlElementElement.setAttributeNode(newAttr);
752 public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
753 return xmlElementElement.removeAttributeNode(oldAttr);
757 public NodeList getElementsByTagName(String name) {
758 return xmlElementElement.getElementsByTagName(name);
762 public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
763 return xmlElementElement.getAttributeNS(namespaceURI, localName);
767 public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
768 throws DOMException {
769 xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
773 public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
774 xmlElementElement.removeAttributeNS(namespaceURI, localName);
778 public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
779 return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
783 public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
784 return xmlElementElement.setAttributeNodeNS(newAttr);
788 public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
789 throws DOMException {
790 return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
794 public boolean hasAttribute(String name) {
795 return xmlElementElement.hasAttribute(name);
799 public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
800 return xmlElementElement.hasAttributeNS(namespaceURI, localName);
804 public TypeInfo getSchemaTypeInfo() {
805 return xmlElementElement.getSchemaTypeInfo();
809 public void setIdAttribute(String name, boolean isId) throws DOMException {
810 xmlElementElement.setIdAttribute(name, isId);
815 public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
816 throws DOMException {
817 xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
821 public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
822 xmlElementElement.setIdAttributeNode(idAttr, isId);