490 } else { |
490 } else { |
491 newElement = target.addChildElement(this.localName, this.prefix, this.namespaceUri); |
491 newElement = target.addChildElement(this.localName, this.prefix, this.namespaceUri); |
492 } |
492 } |
493 // add namespace declarations |
493 // add namespace declarations |
494 for (NamespaceDeclaration namespace : this.namespaceDeclarations) { |
494 for (NamespaceDeclaration namespace : this.namespaceDeclarations) { |
495 target.addNamespaceDeclaration(namespace.prefix, namespace.namespaceUri); |
495 newElement.addNamespaceDeclaration(namespace.prefix, namespace.namespaceUri); |
496 } |
496 } |
497 // add attribute declarations |
497 // add attribute declarations |
498 for (AttributeDeclaration attribute : this.attributeDeclarations) { |
498 for (AttributeDeclaration attribute : this.attributeDeclarations) { |
499 addAttibuteToElement(newElement, |
499 addAttibuteToElement(newElement, |
500 attribute.prefix, attribute.namespaceUri, attribute.localName, attribute.value); |
500 attribute.prefix, attribute.namespaceUri, attribute.localName, attribute.value); |