Return type:
Applies to:
INSERT-ATTRIBUTE ( attribute-name , attribute-value , namespaceURI )
The Unknown value (?) if the attribute doesn’t contain a namespaceThe STRICT attribute setting determines if the XML output for a SAX-writer object is well formed. However, regardless of the value of the STRICT attribute, this method fails if you do not call it following one of the methods listed in the previous paragraph.Namespace declarations appear as attributes in an XML document. You can declare a namespace by using the INSERT-ATTRIBUTE( ) method instead of using the SAX-writer object’s DECLARE-NAMESPACE( ) method. To do this, you must use the special prefix for namespaces, xmlns, with the name of the attribute, and the namespaceURI must be the value of the attribute.
swh:START-ELEMENT("prefix:name").swh:INSERT-ATTRIBUTE("xmlns:prefix", "target.url").swh:END-ELEMENT("prefix:name").
swh:START-ELEMENT("prefix:name").swh:DECLARE-NAMESPACE("target.url", "prefix").swh:END-ELEMENT("prefix:name").Namespaces declared using the INSERT-ATTRIBUTE( ) method in this way are considered valid namespaces and will be included in namespace checking during the XML write operation. If the xmlns prefix does not appear, then the attribute is inserted as a regular attribute and it is not handled with the namespace checking during the XML write operation.If you use namespaceURI, then the method resolves the prefix in the following order:
If the method call only contains name and that value contains a prefix, then the SAX-writer attempts to resolve the prefix to a namespace. If it fails to resolve the namespace and the STRICT attribute is TRUE, then the method fails.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |