I'm trying to create an XML Document with multiple Namespaces.

With the code below[1] a get as result the following XML:

<svg xmlns="http://www.w3.org/2000/svg"; />

How can I set a second Namespace, should I use SetAttribute or
SetAttributeNS ? :

root.setattribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');

?

Can anybody give me an example when setAttributeNS is useful ?

Is there a way to, after setting a namespace prefix, make all
attributes and elements to be added using it ?

Thanks


[1]
var
   Doc: TXMLDocument;
   root, node: TDOMElement;
begin
     Doc:=TXMLDocument.Create;

     root:=Doc.CreateElementNS('http://www.w3.org/2000/svg', 'svg');
     Doc.AppendChild(root);
...
end;
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to