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=========================================================
20 package org.onap.aai.util.genxsd;
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.StringTokenizer;
25 import java.util.Vector;
27 import org.apache.commons.lang3.StringUtils;
28 import org.onap.aai.setup.SchemaVersion;
29 import org.w3c.dom.Attr;
30 import org.w3c.dom.DOMException;
31 import org.w3c.dom.Document;
32 import org.w3c.dom.Element;
33 import org.w3c.dom.NamedNodeMap;
34 import org.w3c.dom.Node;
35 import org.w3c.dom.NodeList;
36 import org.w3c.dom.TypeInfo;
37 import org.w3c.dom.UserDataHandler;
39 import com.google.common.base.Joiner;
41 public class XSDElement implements Element {
42 Element xmlElementElement;
44 private static final int VALUE_NONE = 0;
45 private static final int VALUE_DESCRIPTION = 1;
46 private static final int VALUE_INDEXED_PROPS = 2;
47 private static final int VALUE_CONTAINER = 3;
48 private static final int VALUE_REQUIRES = 4;
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<String>(); // 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 ( attrName.equals("type")) {
78 if ( attrValue.contains(apiVersionFmt) ) {
79 addType = attrValue.substring(attrValue.lastIndexOf('.')+1);
80 if ( addTypeV == null )
81 addTypeV = new Vector<String>();
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().equals(this.xmlElementElement.getAttribute("name"))){
99 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
101 for ( int j = 0; j < childNodes.getLength(); ++j ) {
102 Element childElement = (Element)childNodes.item(j);
104 int useValue = VALUE_NONE;
105 NamedNodeMap attributes = childElement.getAttributes();
106 for ( int k = 0; k < attributes.getLength(); ++k ) {
107 Attr attr = (Attr) attributes.item(k);
108 String attrName = attr.getNodeName();
109 String attrValue = attr.getNodeValue();
110 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().equals(this.xmlElementElement.getAttribute("name"))){
133 // This stopped working, replaced with above - should figure out why...
134 // if ( !xmlPropElement.getParentNode().isSameNode(this.xmlElementElement))
136 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
138 for ( int j = 0; j < childNodes.getLength(); ++j ) {
139 Element childElement = (Element)childNodes.item(j);
141 int useValue = VALUE_NONE;
142 NamedNodeMap attributes = childElement.getAttributes();
143 for ( int k = 0; k < attributes.getLength(); ++k ) {
144 Attr attr = (Attr) attributes.item(k);
145 String attrName = attr.getNodeName();
146 String attrValue = attr.getNodeValue();
147 if ( attrName == null || attrValue == null )
149 if ( attrName.equals("name") && attrValue.equals("description")) {
150 useValue = VALUE_DESCRIPTION;
152 if ( useValue == VALUE_DESCRIPTION && attrName.equals("value")) {
153 pathDescriptionProperty = attrValue;
158 return pathDescriptionProperty;
160 public Vector<String> getIndexedProps() {
161 Vector<String> indexedProps = new Vector<String>();
162 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
164 for ( int i = 0; i < xmlPropNodes.getLength(); ++i ) {
165 Element xmlPropElement = (Element)xmlPropNodes.item(i);
166 if ( !xmlPropElement.getParentNode().isSameNode(this.xmlElementElement))
168 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
169 for ( int j = 0; j < childNodes.getLength(); ++j ) {
170 Element childElement = (Element)childNodes.item(j);
172 int useValue = VALUE_NONE;
173 NamedNodeMap attributes = childElement.getAttributes();
174 for ( int k = 0; k < attributes.getLength(); ++k ) {
175 Attr attr = (Attr) attributes.item(k);
176 String attrName = attr.getNodeName();
177 String attrValue = attr.getNodeValue();
178 if ( attrName == null || attrValue == null )
180 if ( attrValue.equals("indexedProps")) {
181 useValue = VALUE_INDEXED_PROPS;
183 if ( useValue == VALUE_INDEXED_PROPS && attrName.equals("value")) {
184 indexedProps = getIndexedProps( attrValue );
192 private static Vector<String> getIndexedProps( String attrValue )
194 if ( attrValue == null )
196 StringTokenizer st = new StringTokenizer( attrValue, ",");
197 if ( st.countTokens() == 0 )
199 Vector<String> result = new Vector<String>();
200 while ( st.hasMoreTokens()) {
201 result.add(st.nextToken());
206 public String getContainerProperty() {
207 NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
208 String container = null;
209 for ( int i = 0; i < xmlPropNodes.getLength(); ++i ) {
210 Element xmlPropElement = (Element)xmlPropNodes.item(i);
211 if ( !xmlPropElement.getParentNode().isSameNode(this.xmlElementElement))
213 NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
214 for ( int j = 0; j < childNodes.getLength(); ++j ) {
215 Element childElement = (Element)childNodes.item(j);
217 int useValue = VALUE_NONE;
218 NamedNodeMap attributes = childElement.getAttributes();
219 for ( int k = 0; k < attributes.getLength(); ++k ) {
220 Attr attr = (Attr) attributes.item(k);
221 String attrName = attr.getNodeName();
222 String attrValue = attr.getNodeValue();
223 if ( attrName == null || attrValue == null )
225 if ( useValue == VALUE_CONTAINER && attrName.equals("value")) {
226 container = attrValue;
228 if ( attrValue.equals("container")) {
229 useValue = VALUE_CONTAINER;
237 public String getQueryParamYAML() {
238 return getQueryParamYAML(null);
241 public String getQueryParamYAML(String elementDescription ) {
242 // when elementDescription is not null, return parameters with description and example
243 StringBuffer sbParameter = new StringBuffer();
244 sbParameter.append((" - name: " + this.getAttribute("name") + "\n"));
245 sbParameter.append((" in: query\n"));
246 String useDescription = elementDescription;
247 if ( elementDescription == null ) {
248 useDescription = this.getAttribute("description");
250 if ( useDescription != null && useDescription.length() > 0 ) {
251 sbParameter.append((" description: " + useDescription + "\n"));
253 sbParameter.append((" description:\n"));
255 sbParameter.append((" required: false\n"));
256 if ( ("java.lang.String").equals(this.getAttribute("type")))
257 sbParameter.append(" type: string\n");
258 if ( ("java.lang.Long").equals(this.getAttribute("type"))) {
259 sbParameter.append(" type: integer\n");
260 sbParameter.append(" format: int64\n");
262 if ( ("java.lang.Integer").equals(this.getAttribute("type"))) {
263 sbParameter.append(" type: integer\n");
264 sbParameter.append(" format: int32\n");
266 if ( ("java.lang.Boolean").equals(this.getAttribute("type"))) {
267 sbParameter.append(" type: boolean\n");
269 if ( elementDescription != null && StringUtils.isNotBlank(this.getAttribute("name"))) {
270 sbParameter.append(" example: "+"__"+this.getAttribute("name").toUpperCase()+"__"+"\n");
272 return sbParameter.toString();
275 public String getPathParamYAML(String elementDescription) {
276 return getPathParamYAMLRqd( elementDescription, true);
279 public String getPathParamYAMLRqd(String elementDescription, boolean isRqd) {
280 StringBuffer sbParameter = new StringBuffer();
281 sbParameter.append((" - name: " + this.getAttribute("name") + "\n"));
282 sbParameter.append((" in: path\n"));
283 if ( elementDescription != null && elementDescription.length() > 0 )
284 sbParameter.append((" description: " + elementDescription + "\n"));
286 sbParameter.append((" required: true\n"));
288 // used by Nodes API for query params
289 sbParameter.append((" required: false\n"));
291 if ( ("java.lang.String").equals(this.getAttribute("type")))
292 sbParameter.append(" type: string\n");
293 if ( ("java.lang.Long").equals(this.getAttribute("type"))) {
294 sbParameter.append(" type: integer\n");
295 sbParameter.append(" format: int64\n");
297 if ( ("java.lang.Integer").equals(this.getAttribute("type"))) {
298 sbParameter.append(" type: integer\n");
299 sbParameter.append(" format: int32\n");
301 if ( ("java.lang.Boolean").equals(this.getAttribute("type"))) {
302 sbParameter.append(" type: boolean\n");
304 if(StringUtils.isNotBlank(this.getAttribute("name"))) {
305 sbParameter.append(" example: "+"__"+this.getAttribute("name").toUpperCase()+"__"+"\n");
307 return sbParameter.toString();
310 public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
311 StringBuffer sbElement = new StringBuffer();
312 String elementName = this.getAttribute("name");
313 String elementType = this.getAttribute("type");
314 String elementContainerType = this.getAttribute("container-type");
315 String elementIsRequired = this.getAttribute("required");
316 String addType = elementType.contains("." + v.toString() + ".") ? elementType.substring(elementType.lastIndexOf('.')+1) : null;
318 if ( addType != null ) {
319 sbElement.append(" <xs:element ref=\"tns:" + driver.getXmlRootElementName(addType)+"\"");
321 sbElement.append(" <xs:element name=\"" + elementName +"\"");
323 if ( elementType.equals("java.lang.String"))
324 sbElement.append(" type=\"xs:string\"");
325 if ( elementType.equals("java.lang.Long"))
326 sbElement.append(" type=\"xs:unsignedInt\"");
327 if ( elementType.equals("java.lang.Integer"))
328 sbElement.append(" type=\"xs:int\"");
329 if ( elementType.equals("java.lang.Boolean"))
330 sbElement.append(" type=\"xs:boolean\"");
331 if ( addType != null || elementType.startsWith("java.lang.") ) {
332 sbElement.append(" minOccurs=\"0\"");
334 if ( elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
335 sbElement.append(" maxOccurs=\"" + maxOccurs + "\"");
338 String annotation = new XSDElement(xmlElementElement, maxOccurs).getHTMLAnnotation("field", " ");
339 sbElement.append(StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
340 sbElement.append(annotation);
341 sbElement.append(StringUtils.isNotEmpty(annotation) ? " </xs:element>" + OxmFileProcessor.LINE_SEPARATOR : "/>" + OxmFileProcessor.LINE_SEPARATOR );
343 sbElement.append("/>" + OxmFileProcessor.LINE_SEPARATOR);
345 return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
346 // return sbElement.toString();
349 public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v, boolean useAnnotation) {
351 NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
353 String xmlElementWrapper = null;
354 if ( childNodes.getLength() > 0 ) {
355 Element childElement = (Element)childNodes.item(0);
357 xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
359 if(xmlElementWrapper == null)
360 return unwrappedElement;
362 StringBuffer sbElement = new StringBuffer();
363 sbElement.append(" <xs:element name=\"" + xmlElementWrapper +"\"");
364 String elementType = xmlElementElement.getAttribute("type");
365 String elementIsRequired = this.getAttribute("required");
366 String addType = elementType.contains("." + v.toString() + ".") ? elementType.substring(elementType.lastIndexOf('.')+1) : null;
368 if ( elementIsRequired == null || !elementIsRequired.equals("true")||addType != null) {
369 sbElement.append(" minOccurs=\"0\"");
371 sbElement.append(">" + OxmFileProcessor.LINE_SEPARATOR);
372 sbElement.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
374 XSDElement javaTypeElement = new XSDElement((Element)this.getParentNode(), maxOccurs);
375 sbElement.append(javaTypeElement.getHTMLAnnotation("class", " "));
377 sbElement.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
378 sbElement.append(" ");
379 sbElement.append(unwrappedElement);
380 sbElement.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
381 sbElement.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
382 sbElement.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
383 return sbElement.toString();
386 public String getHTMLAnnotation(String target, String indentation) {
387 StringBuffer sb = new StringBuffer();
388 List<String> metadata = new ArrayList<>();
389 if("true".equals(this.getAttribute("xml-key")) ) {
390 metadata.add("isKey=true");
393 NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
394 Element xmlPropElement = null;
395 for ( int i = 0; i < xmlPropTags.getLength(); ++i ) {
396 xmlPropElement = (Element)xmlPropTags.item(i);
397 if (! xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue().equals(this.xmlElementElement.getAttribute("name")))
402 if(xmlPropElement != null) {
403 NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
404 for (int i = 0; i < xmlProperties.getLength(); i++) {
405 Element item = (Element)xmlProperties.item(i);
406 String name = item.getAttribute("name");
407 String value = item.getAttribute("value");
408 if (name.equals("abstract")) {
410 } else if (name.equals("extends")) {
411 name = "extendsFrom";
413 metadata.add(name + "=\"" + value.replaceAll("&", "&") + "\"");
416 if(metadata.size() == 0) {
419 sb.append(indentation +"<xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
421 indentation + " <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR +
422 indentation + " <annox:annotate target=\""+target+"\">@org.onap.aai.annotations.Metadata(" + Joiner.on(",").join(metadata) + ")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR +
423 indentation + " </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
424 sb.append(indentation +"</xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
425 return sb.toString();
428 public String getTypePropertyYAML() {
429 StringBuffer sbProperties = new StringBuffer();
430 sbProperties.append(" " + this.getAttribute("name") + ":\n");
431 sbProperties.append(" type: ");
433 if ( ("java.lang.String").equals(this.getAttribute("type")))
434 sbProperties.append("string\n");
435 else if ( ("java.lang.Long").equals(this.getAttribute("type"))) {
436 sbProperties.append("integer\n");
437 sbProperties.append(" format: int64\n");
439 else if ( ("java.lang.Integer").equals(this.getAttribute("type"))){
440 sbProperties.append("integer\n");
441 sbProperties.append(" format: int32\n");
443 else if ( ("java.lang.Boolean").equals(this.getAttribute("type")))
444 sbProperties.append("boolean\n");
445 String attrDescription = this.getPathDescriptionProperty();
446 if ( attrDescription != null && attrDescription.length() > 0 )
447 sbProperties.append(" description: " + attrDescription + "\n");
448 String elementAlsoRequiresProperty=this.getRequiresProperty();
449 if ( StringUtils.isNotEmpty(elementAlsoRequiresProperty) )
450 sbProperties.append(" also requires: " + elementAlsoRequiresProperty + "\n");
451 return sbProperties.toString();
454 public boolean isStandardType()
456 switch ( this.getAttribute("type") ) {
457 case "java.lang.String":
458 case "java.lang.Long":
459 case "java.lang.Integer":
460 case"java.lang.Boolean":
467 public String getNodeName() {
468 return xmlElementElement.getNodeName();
472 public String getNodeValue() throws DOMException {
473 return xmlElementElement.getNodeValue();
477 public void setNodeValue(String nodeValue) throws DOMException {
478 xmlElementElement.setNodeValue(nodeValue);
482 public short getNodeType() {
483 return xmlElementElement.getNodeType();
487 public Node getParentNode() {
488 return xmlElementElement.getParentNode();
492 public NodeList getChildNodes() {
493 return xmlElementElement.getChildNodes();
497 public Node getFirstChild() {
498 return xmlElementElement.getFirstChild();
502 public Node getLastChild() {
503 return xmlElementElement.getLastChild();
507 public Node getPreviousSibling() {
508 return xmlElementElement.getPreviousSibling();
512 public Node getNextSibling() {
513 return xmlElementElement.getNextSibling();
517 public NamedNodeMap getAttributes() {
518 return xmlElementElement.getAttributes();
522 public Document getOwnerDocument() {
523 return xmlElementElement.getOwnerDocument();
527 public Node insertBefore(Node newChild, Node refChild) throws DOMException {
528 return xmlElementElement.insertBefore(newChild, refChild);
532 public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
533 return xmlElementElement.replaceChild(newChild, oldChild);
537 public Node removeChild(Node oldChild) throws DOMException {
538 return xmlElementElement.removeChild(oldChild);
542 public Node appendChild(Node newChild) throws DOMException {
543 return xmlElementElement.appendChild(newChild);
547 public boolean hasChildNodes() {
548 return xmlElementElement.hasChildNodes();
552 public Node cloneNode(boolean deep) {
553 return xmlElementElement.cloneNode(deep);
557 public void normalize() {
558 xmlElementElement.normalize();
562 public boolean isSupported(String feature, String version) {
563 return xmlElementElement.isSupported(feature, version);
567 public String getNamespaceURI() {
568 return xmlElementElement.getNamespaceURI();
572 public String getPrefix() {
573 return xmlElementElement.getPrefix();
577 public void setPrefix(String prefix) throws DOMException {
578 xmlElementElement.setPrefix(prefix);
582 public String getLocalName() {
584 return xmlElementElement.getLocalName();
588 public boolean hasAttributes() {
589 return xmlElementElement.hasAttributes();
593 public String getBaseURI() {
594 return xmlElementElement.getBaseURI();
598 public short compareDocumentPosition(Node other) throws DOMException {
599 return xmlElementElement.compareDocumentPosition(other);
603 public String getTextContent() throws DOMException {
604 return xmlElementElement.getTextContent();
608 public void setTextContent(String textContent) throws DOMException {
609 xmlElementElement.setTextContent(textContent);
613 public boolean isSameNode(Node other) {
614 return xmlElementElement.isSameNode(other);
618 public String lookupPrefix(String namespaceURI) {
619 return xmlElementElement.lookupPrefix(namespaceURI);
623 public boolean isDefaultNamespace(String namespaceURI) {
624 return xmlElementElement.isDefaultNamespace(namespaceURI);
628 public String lookupNamespaceURI(String prefix) {
629 return xmlElementElement.lookupNamespaceURI(prefix);
633 public boolean isEqualNode(Node arg) {
634 return xmlElementElement.isEqualNode(arg);
638 public Object getFeature(String feature, String version) {
639 return xmlElementElement.getFeature(feature, version);
643 public Object setUserData(String key, Object data, UserDataHandler handler) {
644 return xmlElementElement.setUserData(key, data, handler);
648 public Object getUserData(String key) {
649 return xmlElementElement.getUserData(key);
653 public String getTagName() {
654 return xmlElementElement.getTagName();
658 public String getAttribute(String name) {
659 return xmlElementElement.getAttribute(name);
663 public void setAttribute(String name, String value) throws DOMException {
664 xmlElementElement.setAttribute(name, value);
668 public void removeAttribute(String name) throws DOMException {
669 xmlElementElement.removeAttribute(name);
673 public Attr getAttributeNode(String name) {
674 return xmlElementElement.getAttributeNode(name);
678 public Attr setAttributeNode(Attr newAttr) throws DOMException {
679 return xmlElementElement.setAttributeNode(newAttr);
683 public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
684 return xmlElementElement.removeAttributeNode(oldAttr);
688 public NodeList getElementsByTagName(String name) {
689 return xmlElementElement.getElementsByTagName(name);
693 public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
694 return xmlElementElement.getAttributeNS(namespaceURI, localName);
698 public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException {
699 xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
704 public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
705 xmlElementElement.removeAttributeNS(namespaceURI, localName);
709 public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
710 return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
714 public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
715 return xmlElementElement.setAttributeNodeNS(newAttr);
719 public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException {
720 return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
724 public boolean hasAttribute(String name) {
725 return xmlElementElement.hasAttribute(name);
729 public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
730 return xmlElementElement.hasAttributeNS(namespaceURI, localName);
734 public TypeInfo getSchemaTypeInfo() {
735 return xmlElementElement.getSchemaTypeInfo();
739 public void setIdAttribute(String name, boolean isId) throws DOMException {
740 xmlElementElement.setIdAttribute(name, isId);
745 public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
746 xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
750 public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
751 xmlElementElement.setIdAttributeNode(idAttr, isId);