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;
24 import java.util.ArrayList;
25 import java.util.List;
26 import java.util.StringTokenizer;
27 import java.util.Vector;
28 import org.apache.commons.lang3.StringUtils;
29 import org.onap.aai.setup.SchemaVersion;
30 import org.w3c.dom.Attr;
31 import org.w3c.dom.DOMException;
32 import org.w3c.dom.Document;
33 import org.w3c.dom.Element;
34 import org.w3c.dom.NamedNodeMap;
35 import org.w3c.dom.Node;
36 import org.w3c.dom.NodeList;
37 import org.w3c.dom.TypeInfo;
38 import org.w3c.dom.UserDataHandler;
40 public class XSDElement implements Element {
41 Element xmlElementElement;
43 private static final int VALUE_NONE = 0;
44 private static final int VALUE_DESCRIPTION = 1;
45 private static final int VALUE_INDEXED_PROPS = 2;
46 private static final int VALUE_CONTAINER = 3;
47 private static final int VALUE_REQUIRES = 4;
48 private static final int VALUE_DSLSTARTNODE = 5;
50 public XSDElement(Element xmlElementElement, String maxOccurs) {
52 this.xmlElementElement = xmlElementElement;
53 this.maxOccurs = maxOccurs;
56 public XSDElement(Element xmlElementElement) {
58 this.xmlElementElement = xmlElementElement;
59 this.maxOccurs = null;
62 public String name() {
63 return this.getAttribute("name");
66 public Vector<String> getAddTypes(String version) {
67 String apiVersionFmt = "." + version + ".";
68 NamedNodeMap attributes = this.getAttributes();
69 Vector<String> addTypeV = new Vector<>(); // vector of 1
70 String addType = null;
72 for (int j = 0; j < attributes.getLength(); ++j) {
73 Attr attr = (Attr) attributes.item(j);
74 String attrName = attr.getNodeName();
76 String attrValue = attr.getNodeValue();
77 if ("type".equals(attrName)) {
78 if (attrValue.contains(apiVersionFmt)) {
79 addType = attrValue.substring(attrValue.lastIndexOf('.') + 1);
80 addTypeV.add(addType);
88 public String getRequiresProperty() {
89 String elementAlsoRequiresProperty = null;
90 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
92 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
93 Element xmlPropElement = (Element) xmlPropNodes.item(i);
94 if (!xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
95 .equals(this.xmlElementElement.getAttribute("name"))) {
98 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
100 for (int j = 0; j < childNodes.getLength(); ++j) {
101 Element childElement = (Element) childNodes.item(j);
103 int useValue = VALUE_NONE;
104 NamedNodeMap attributes = childElement.getAttributes();
105 for (int k = 0; k < attributes.getLength(); ++k) {
106 Attr attr = (Attr) attributes.item(k);
107 String attrName = attr.getNodeName();
108 String attrValue = attr.getNodeValue();
109 if (attrName == null || attrValue == null) {
112 if (attrName.equals("name") && attrValue.equals("requires")) {
113 useValue = VALUE_REQUIRES;
115 if (useValue == VALUE_REQUIRES && attrName.equals("value")) {
116 elementAlsoRequiresProperty = attrValue;
121 return elementAlsoRequiresProperty;
124 public String getPathDescriptionProperty() {
125 String pathDescriptionProperty = null;
126 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
128 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
129 Element xmlPropElement = (Element) xmlPropNodes.item(i);
130 if (!xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
131 .equals(this.xmlElementElement.getAttribute("name"))) {
134 // This stopped working, replaced with above - should figure out why...
135 // if ( !xmlPropElement.getParentNode().isSameNode(this.xmlElementElement))
137 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
139 for (int j = 0; j < childNodes.getLength(); ++j) {
140 Element childElement = (Element) childNodes.item(j);
142 int useValue = VALUE_NONE;
143 NamedNodeMap attributes = childElement.getAttributes();
144 for (int k = 0; k < attributes.getLength(); ++k) {
145 Attr attr = (Attr) attributes.item(k);
146 String attrName = attr.getNodeName();
147 String attrValue = attr.getNodeValue();
148 if (attrName == null || attrValue == null) {
151 if (attrName.equals("name") && attrValue.equals("description")) {
152 useValue = VALUE_DESCRIPTION;
154 if (useValue == VALUE_DESCRIPTION && attrName.equals("value")) {
155 pathDescriptionProperty = attrValue;
160 if (pathDescriptionProperty != null) {
161 //suppress non-printable characters in a description
162 String replaceDescription = pathDescriptionProperty.replaceAll("[^\\p{ASCII}]", "");
163 return replaceDescription;
165 return pathDescriptionProperty;
168 public Vector<String> getProps(int needValue) {
169 Vector<String> props = new Vector<String>();
170 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
172 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
173 Element xmlPropElement = (Element) xmlPropNodes.item(i);
174 if (!xmlPropElement.getParentNode().isSameNode(this.xmlElementElement)) {
177 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
178 for (int j = 0; j < childNodes.getLength(); ++j) {
179 Element childElement = (Element) childNodes.item(j);
181 int useValue = VALUE_NONE;
182 NamedNodeMap attributes = childElement.getAttributes();
183 for (int k = 0; k < attributes.getLength(); ++k) {
184 Attr attr = (Attr) attributes.item(k);
185 String attrName = attr.getNodeName();
186 String attrValue = attr.getNodeValue();
187 if (attrName == null || attrValue == null) {
190 if (needValue == VALUE_INDEXED_PROPS && attrValue.equals("indexedProps")) {
191 useValue = VALUE_INDEXED_PROPS;
192 } else if (needValue == VALUE_DSLSTARTNODE &&
193 attrValue.equals("dslStartNodeProps")) {
194 useValue = VALUE_DSLSTARTNODE;
196 if (useValue != VALUE_NONE && attrName.equals("value")) {
197 props = getProps(attrValue);
205 private static Vector<String> getProps(String attrValue) {
206 if (attrValue == null) {
209 StringTokenizer st = new StringTokenizer(attrValue, ",");
210 if (st.countTokens() == 0) {
213 Vector<String> result = new Vector<String>();
214 while (st.hasMoreTokens()) {
215 result.add(st.nextToken());
220 public Vector<String> getIndexedProps() {
221 return getProps(VALUE_INDEXED_PROPS);
224 public Vector<String> getDslStartNodeProps() {
225 return getProps(VALUE_DSLSTARTNODE);
228 public String getContainerProperty() {
229 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
230 String container = null;
231 for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
232 Element xmlPropElement = (Element) xmlPropNodes.item(i);
233 if (!xmlPropElement.getParentNode().isSameNode(this.xmlElementElement)) {
236 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
237 for (int j = 0; j < childNodes.getLength(); ++j) {
238 Element childElement = (Element) childNodes.item(j);
240 int useValue = VALUE_NONE;
241 NamedNodeMap attributes = childElement.getAttributes();
242 for (int k = 0; k < attributes.getLength(); ++k) {
243 Attr attr = (Attr) attributes.item(k);
244 String attrName = attr.getNodeName();
245 String attrValue = attr.getNodeValue();
246 if (attrName == null || attrValue == null) {
249 if (useValue == VALUE_CONTAINER && attrName.equals("value")) {
250 container = attrValue;
252 if (attrValue.equals("container")) {
253 useValue = VALUE_CONTAINER;
261 public String getQueryParamYAML() {
262 StringBuilder sbParameter = new StringBuilder();
263 sbParameter.append(" - name: ").append(this.getAttribute("name")).append("\n");
264 sbParameter.append((" in: query\n"));
265 if (this.getAttribute("description") != null &&
266 this.getAttribute("description").length() > 0) {
267 sbParameter.append(" description: ").append(this.getAttribute("description"))
270 sbParameter.append((" description: n/a\n"));
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.Boolean").equals(this.getAttribute("type"))) {
285 sbParameter.append(" type: boolean\n");
287 return sbParameter.toString();
290 public String getPathParamYAML(String elementDescription) {
291 return getPathParamYAML(elementDescription, null);
294 public String getPathParamYAML(String elementDescription, String overrideName) {
295 // updated to allow caller to provide parameter name to use in API
296 StringBuilder sbParameter = new StringBuilder();
297 if (overrideName == null) {
298 overrideName = this.getAttribute("name");
300 sbParameter.append(" - name: ").append(overrideName).append("\n");
301 sbParameter.append((" in: path\n"));
302 if (elementDescription != null && elementDescription.length() > 0) {
303 sbParameter.append(" description: ").append(elementDescription).append("\n");
305 sbParameter.append((" required: true\n"));
306 if (("java.lang.String").equals(this.getAttribute("type"))) {
307 sbParameter.append(" type: string\n");
309 if (("java.lang.Long").equals(this.getAttribute("type"))) {
310 sbParameter.append(" type: integer\n");
311 sbParameter.append(" format: int64\n");
313 if (("java.lang.Integer").equals(this.getAttribute("type"))) {
314 sbParameter.append(" type: integer\n");
315 sbParameter.append(" format: int32\n");
317 if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
318 sbParameter.append(" type: boolean\n");
320 if (StringUtils.isNotBlank(this.getAttribute("name"))) {
321 sbParameter.append(" example: " + "__")
322 .append(this.getAttribute("name").toUpperCase()).append("__").append("\n");
324 return sbParameter.toString();
327 public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
328 StringBuilder sbElement = new StringBuilder();
329 String elementName = this.getAttribute("name");
330 String elementType = this.getAttribute("type");
331 String elementContainerType = this.getAttribute("container-type");
332 String elementIsRequired = this.getAttribute("required");
333 String addType = elementType.contains("." + v.toString() + ".") ?
334 elementType.substring(elementType.lastIndexOf('.') + 1) : null;
336 if (addType != null) {
337 sbElement.append(" <xs:element ref=\"tns:")
338 .append(driver.getXmlRootElementName(addType)).append("\"");
340 sbElement.append(" <xs:element name=\"").append(elementName).append("\"");
342 if (elementType.equals("java.lang.String")) {
343 sbElement.append(" type=\"xs:string\"");
345 if (elementType.equals("java.lang.Long")) {
346 sbElement.append(" type=\"xs:unsignedInt\"");
348 if (elementType.equals("java.lang.Integer")) {
349 sbElement.append(" type=\"xs:int\"");
351 if (elementType.equals("java.lang.Boolean")) {
352 sbElement.append(" type=\"xs:boolean\"");
354 if (addType != null || elementType.startsWith("java.lang.")) {
355 sbElement.append(" minOccurs=\"0\"");
357 if (elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
358 sbElement.append(" maxOccurs=\"").append(maxOccurs).append("\"");
361 String annotation = new XSDElement(xmlElementElement, maxOccurs)
362 .getHTMLAnnotation("field", " ");
364 StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
365 sbElement.append(annotation);
366 sbElement.append(StringUtils.isNotEmpty(annotation) ?
367 " </xs:element>" + OxmFileProcessor.LINE_SEPARATOR :
368 "/>" + OxmFileProcessor.LINE_SEPARATOR);
370 sbElement.append("/>").append(OxmFileProcessor.LINE_SEPARATOR);
372 return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
373 // return sbElement.toString();
376 public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v,
377 boolean useAnnotation) {
379 NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
381 String xmlElementWrapper = null;
382 if (childNodes.getLength() > 0) {
383 Element childElement = (Element) childNodes.item(0);
385 xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
387 if (xmlElementWrapper == null) {
388 return unwrappedElement;
391 StringBuilder sbElement = new StringBuilder();
392 sbElement.append(" <xs:element name=\"").append(xmlElementWrapper).append("\"");
393 String elementType = xmlElementElement.getAttribute("type");
394 String elementIsRequired = this.getAttribute("required");
395 String addType = elementType.contains("." + v.toString() + ".") ?
396 elementType.substring(elementType.lastIndexOf('.') + 1) : null;
398 if (elementIsRequired == null || !elementIsRequired.equals("true") || addType != null) {
399 sbElement.append(" minOccurs=\"0\"");
401 sbElement.append(">").append(OxmFileProcessor.LINE_SEPARATOR);
402 sbElement.append(" <xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
404 XSDElement javaTypeElement = new XSDElement((Element) this.getParentNode(), maxOccurs);
405 sbElement.append(javaTypeElement.getHTMLAnnotation("class", " "));
407 sbElement.append(" <xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
408 sbElement.append(" ");
409 sbElement.append(unwrappedElement);
410 sbElement.append(" </xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
411 sbElement.append(" </xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
412 sbElement.append(" </xs:element>").append(OxmFileProcessor.LINE_SEPARATOR);
413 return sbElement.toString();
416 public String getHTMLAnnotation(String target, String indentation) {
417 StringBuilder sb = new StringBuilder();
418 List<String> metadata = new ArrayList<>();
419 if ("true".equals(this.getAttribute("xml-key"))) {
420 metadata.add("isKey=true");
423 NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
424 Element xmlPropElement = null;
425 for (int i = 0; i < xmlPropTags.getLength(); ++i) {
426 xmlPropElement = (Element) xmlPropTags.item(i);
427 if (xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
428 .equals(this.xmlElementElement.getAttribute("name"))) {
432 if (xmlPropElement != null) {
433 NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
434 for (int i = 0; i < xmlProperties.getLength(); i++) {
435 Element item = (Element) xmlProperties.item(i);
436 String name = item.getAttribute("name");
437 String value = item.getAttribute("value");
438 if (name.equals("abstract")) {
440 } else if (name.equals("extends")) {
441 name = "extendsFrom";
443 metadata.add(name + "=\"" + value.replaceAll("&", "&") + "\"");
446 if (metadata.size() == 0) {
449 sb.append(indentation).append("<xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
450 sb.append(indentation).append(" <xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR)
451 .append(indentation).append(" <annox:annotate target=\"").append(target)
452 .append("\">@org.onap.aai.annotations.Metadata(").append(Joiner.on(",").join(metadata))
453 .append(")</annox:annotate>").append(OxmFileProcessor.LINE_SEPARATOR)
454 .append(indentation).append(" </xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR);
455 sb.append(indentation).append("</xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
456 return sb.toString();
459 public String getTypePropertyYAML(boolean isDslStartNode) {
460 StringBuilder sbProperties = new StringBuilder();
461 sbProperties.append(" ").append(this.getAttribute("name")).append(":\n");
462 sbProperties.append(" type: ");
464 if (("java.lang.String").equals(this.getAttribute("type"))) {
465 sbProperties.append("string\n");
466 } else if (("java.lang.Long").equals(this.getAttribute("type"))) {
467 sbProperties.append("integer\n");
468 sbProperties.append(" format: int64\n");
469 } else if (("java.lang.Integer").equals(this.getAttribute("type"))) {
470 sbProperties.append("integer\n");
471 sbProperties.append(" format: int32\n");
472 } else if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
473 sbProperties.append("boolean\n");
475 String attrDescription = this.getPathDescriptionProperty();
476 if (attrDescription != null && attrDescription.length() > 0) {
477 if (!isDslStartNode) {
478 sbProperties.append(" description: ").append(attrDescription).append("\n");
480 sbProperties.append(" description: |\n");
481 sbProperties.append(" ").append(attrDescription).append("\n");
483 " *This property can be used as a filter to find the start node for a dsl query\n");
486 if (isDslStartNode) {
487 sbProperties.append(" description: |\n");
488 sbProperties.append(" \n");
490 " *This property can be used as a filter to find the start node for a dsl query\n");
493 String elementAlsoRequiresProperty = this.getRequiresProperty();
494 if (StringUtils.isNotEmpty(elementAlsoRequiresProperty)) {
495 sbProperties.append(" also requires: ").append(elementAlsoRequiresProperty)
498 return sbProperties.toString();
501 public boolean isStandardType() {
502 switch (this.getAttribute("type")) {
503 case "java.lang.String":
504 case "java.lang.Long":
505 case "java.lang.Integer":
506 case "java.lang.Boolean":
513 public String getNodeName() {
514 return xmlElementElement.getNodeName();
518 public String getNodeValue() throws DOMException {
519 return xmlElementElement.getNodeValue();
523 public void setNodeValue(String nodeValue) throws DOMException {
524 xmlElementElement.setNodeValue(nodeValue);
528 public short getNodeType() {
529 return xmlElementElement.getNodeType();
533 public Node getParentNode() {
534 return xmlElementElement.getParentNode();
538 public NodeList getChildNodes() {
539 return xmlElementElement.getChildNodes();
543 public Node getFirstChild() {
544 return xmlElementElement.getFirstChild();
548 public Node getLastChild() {
549 return xmlElementElement.getLastChild();
553 public Node getPreviousSibling() {
554 return xmlElementElement.getPreviousSibling();
558 public Node getNextSibling() {
559 return xmlElementElement.getNextSibling();
563 public NamedNodeMap getAttributes() {
564 return xmlElementElement.getAttributes();
568 public Document getOwnerDocument() {
569 return xmlElementElement.getOwnerDocument();
573 public Node insertBefore(Node newChild, Node refChild) throws DOMException {
574 return xmlElementElement.insertBefore(newChild, refChild);
578 public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
579 return xmlElementElement.replaceChild(newChild, oldChild);
583 public Node removeChild(Node oldChild) throws DOMException {
584 return xmlElementElement.removeChild(oldChild);
588 public Node appendChild(Node newChild) throws DOMException {
589 return xmlElementElement.appendChild(newChild);
593 public boolean hasChildNodes() {
594 return xmlElementElement.hasChildNodes();
598 public Node cloneNode(boolean deep) {
599 return xmlElementElement.cloneNode(deep);
603 public void normalize() {
604 xmlElementElement.normalize();
608 public boolean isSupported(String feature, String version) {
609 return xmlElementElement.isSupported(feature, version);
613 public String getNamespaceURI() {
614 return xmlElementElement.getNamespaceURI();
618 public String getPrefix() {
619 return xmlElementElement.getPrefix();
623 public void setPrefix(String prefix) throws DOMException {
624 xmlElementElement.setPrefix(prefix);
628 public String getLocalName() {
630 return xmlElementElement.getLocalName();
634 public boolean hasAttributes() {
635 return xmlElementElement.hasAttributes();
639 public String getBaseURI() {
640 return xmlElementElement.getBaseURI();
644 public short compareDocumentPosition(Node other) throws DOMException {
645 return xmlElementElement.compareDocumentPosition(other);
649 public String getTextContent() throws DOMException {
650 return xmlElementElement.getTextContent();
654 public void setTextContent(String textContent) throws DOMException {
655 xmlElementElement.setTextContent(textContent);
659 public boolean isSameNode(Node other) {
660 return xmlElementElement.isSameNode(other);
664 public String lookupPrefix(String namespaceURI) {
665 return xmlElementElement.lookupPrefix(namespaceURI);
669 public boolean isDefaultNamespace(String namespaceURI) {
670 return xmlElementElement.isDefaultNamespace(namespaceURI);
674 public String lookupNamespaceURI(String prefix) {
675 return xmlElementElement.lookupNamespaceURI(prefix);
679 public boolean isEqualNode(Node arg) {
680 return xmlElementElement.isEqualNode(arg);
684 public Object getFeature(String feature, String version) {
685 return xmlElementElement.getFeature(feature, version);
689 public Object setUserData(String key, Object data, UserDataHandler handler) {
690 return xmlElementElement.setUserData(key, data, handler);
694 public Object getUserData(String key) {
695 return xmlElementElement.getUserData(key);
699 public String getTagName() {
700 return xmlElementElement.getTagName();
704 public String getAttribute(String name) {
705 return xmlElementElement.getAttribute(name);
709 public void setAttribute(String name, String value) throws DOMException {
710 xmlElementElement.setAttribute(name, value);
714 public void removeAttribute(String name) throws DOMException {
715 xmlElementElement.removeAttribute(name);
719 public Attr getAttributeNode(String name) {
720 return xmlElementElement.getAttributeNode(name);
724 public Attr setAttributeNode(Attr newAttr) throws DOMException {
725 return xmlElementElement.setAttributeNode(newAttr);
729 public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
730 return xmlElementElement.removeAttributeNode(oldAttr);
734 public NodeList getElementsByTagName(String name) {
735 return xmlElementElement.getElementsByTagName(name);
739 public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
740 return xmlElementElement.getAttributeNS(namespaceURI, localName);
744 public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
745 throws DOMException {
746 xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
750 public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
751 xmlElementElement.removeAttributeNS(namespaceURI, localName);
755 public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
756 return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
760 public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
761 return xmlElementElement.setAttributeNodeNS(newAttr);
765 public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
766 throws DOMException {
767 return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
771 public boolean hasAttribute(String name) {
772 return xmlElementElement.hasAttribute(name);
776 public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
777 return xmlElementElement.hasAttributeNS(namespaceURI, localName);
781 public TypeInfo getSchemaTypeInfo() {
782 return xmlElementElement.getSchemaTypeInfo();
786 public void setIdAttribute(String name, boolean isId) throws DOMException {
787 xmlElementElement.setIdAttribute(name, isId);
792 public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
793 throws DOMException {
794 xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
798 public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
799 xmlElementElement.setIdAttributeNode(idAttr, isId);