Ver Mensaje Individual
  #1  
Antiguo 14-02-2007
mia mia is offline
Registrado
 
Registrado: jul 2005
Posts: 6
Reputación: 0
mia Va por buen camino
Question Attributos fantasmas en nodos XML

Hola a tod@s,
(working with BDS 2006 Upg1, XPProf SP2, P4 1GBRAM.)

Tengo problemas con un documento XML que estoy contruyendo.
Hasta ahora nunca habia tenido problemas, pero ahora me esta apareciendo algo un poco raro.
Al ponerle el atributo mslns en el nodo principal del documento, a la que añado más nodos a ese nodo, automaticamente a los nuevos nodos le inserta ese artibuto, aunque en blanco.

Código:
----------------------------------------------------------
Código Delphi [-]
  xmlDoc := TXMLDocument.Create(tblConfig.Owner);
  try
    xmlDoc.Version = '1.0';
    xmlDoc.Active := TRUE;
    xmlElement := xmlDoc.CreateNode('FunctionCallRequest ');
    xmlElement.SetAttribute('xmlns:xsd','String1');
    xmlElement.SetAttribute('xmlns:xsi','String2');
    xmlElement.SetAttribute('xmlns','String3');
    xmlDoc.DocumentElement := xmlElement;
    xmlNode := xmlElement.AddChild('TimeStamp');
    ...
----------------------------------------------------
The result:
-----------------------------------------------------
<FunctionCallRequest xmlns:xsd="String1" xmlns:xsi="String2" xmlns="String3">
<Timestamp xmlns="">
....
---------------------------------------------------
<Timestamp xmlns=""> es el problema, ya que debería ser <TimeStamp>

¿Alguien sabe a que puede ser debido esto?
Muchas gracias.

Última edición por roman fecha: 11-05-2007 a las 19:02:33.
Responder Con Cita