On Mon, 2004-09-13 at 18:42, Raul Benito wrote:
> rootElement.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","NS1:schemaLocation","urn:frog
> http://xml.rcpt.to/mikolaj/default");
> rootElement.setAttributeNS(XMLNS_URI,"xmlns:NS1","http://www.w3.org/2001/XMLSchema-instance");
> I think your problems will be vanished.
You are, of course, absolutely right.
For the benefit of any future searching of the list archives, the
sequence to get this right appears to be:
a = doc.createElement(localNamespace, prefix + ":" + tag);
a.setAttributeNS(xmlnsNamespace, "xmlns:" + prefix, localNamespace);
a.setAttributeNS(xmlnsNamespace, "xmlns:xsi", xmlschemaNamespace);
a.setAttributeNS(xmlschemaNamespace, "xsi:schemaLocation",
"localNamespace path-to-schema");
I hope to one day understand why it takes four lines to achieve a
construct that seems so fundamental.
m.
PS: ...and I see that my original post has now made it through. My
thanks to the moderators.