![]() |
XML-Attribute kopieren - mit Prefix ?
Hallo!
Ich habe zwei Knoten 'NewValue' und 'Value'. Value hat ein Attribut 'xsi:type="xxxx"' und dieses Attribut soll in den 'NewValue' Knoten rein. Fein. Also schreibe ich
Delphi-Quellcode:
und erhalte
Procedure _CopyAttributes(aSrc, aDst: IXMLNode);
Begin aDst.Attributes['xsi:type'] := aSrc.Attributes['xsi:type']; End;
XML-Code:
:shock: (Hinter dem NewValue fehlt das 'xsi'). Auch irgendwie klar. Leider ist 'Prefix' read-only, sodaß ich nicht einfach den Prefix mit kopieren kann.
<A1W>
<Value xsi:type="xsd:float">95.88</Value> <NewValue type="xsd:float">95.8800</NewValue> </A1W> Wie schaffe ich es, das das Attribut des 'NewValue' genauso heißt, wie vom 'Value'? Danke für Hinweise. |
Re: XML-Attribute kopieren - mit Prefix ?
Hallo alzaimar,
du musst in deinem Beispiel den NameSpace xmlns:xsi deklarieren - dann funktioniert es so wie du denkst. Gute Nacht |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:49 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz