> From: Dane Foster [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 18, 2001 4:15 PM
> To: [EMAIL PROTECTED]
> Subject: Why createElementNS?
>
>
> If I want to create an element and it's attribute of a particular
> namespace,
> Why should id use:
>
> String namespaceURI = "http://someuri.something";;
> String elementName = "ns:someElement";
> String attName = "ns:someAttribute";
> String attValue = "someAttValue";
>
>
> Element e = createElementNS( namespaceURI, elementName );
> e.setAttributeNS( namespaceURI, attName, attValue );
>
> instead of
>
> Element e = createElement( elementName )
> e.setAttribute( attName, attValue );

In the latter case, you aren't really placing the element into the intended
namespace, and other users of the DOM probably wouldn't recognize the
element.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to