On 2012-06-23 01:01, Daniel Gaspary wrote:
On Tue, Jun 19, 2012 at 10:11 AM, Torsten Bonde Christiansen
<t...@epidata.info> wrote:
DDIInstance := XMLDoc.CreateElementNS('ddi:instance:3_0', 'DDIInstance');
DDIInstance.Prefix := 'ns1'; // this gives me: <ns1:DDIInstance
xmlns:ns1="ddi:instance:3_0"> which is great.
// now I would like to expand with eg: xmlns:a="ddi:archive:3_0"
Attr := XMLDoc.CreateAttributeNS('ddi:archive:3_0', 'huh');
Attr.Prefix := 'a';
DDIInstance.SetAttributeNode(Attr); // but this gives: <ns1:DDIInstance
xmlns:ns1="ddi:instance:3_0" xmlns:a="ddi:archive:3_0" a:huh=""/>
How can i get the "xmlns:a="ddi:archive:3_0" without the additional
attribute AND maintain the namespace + prefix in later elements?
I believe that the solution(given by Sergei Gorelkin at [1]) is:
DDIInstance.SetAttributeNS('ddi:archive:3_0','xmlns:a','ddi:archive:3_0');
[1] http://bugs.freepascal.org/view.php?id=22299#c60652
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Great - thank you very much!
-Torsten.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal