Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi IXMLNodeList中的命名空间_Delphi_Delphi Xe2 - Fatal编程技术网

Delphi IXMLNodeList中的命名空间

Delphi IXMLNodeList中的命名空间,delphi,delphi-xe2,Delphi,Delphi Xe2,我需要为节点添加前缀,但在接口中定义的IXMLNodeList中也添加了名称空间,并且需要在所有节点上添加前缀 if Length(cds_Partes.FieldByName('Nota').AsString) > 0 then Nota.Add( cds_Partes.FieldByName('Nota').AsString); OtrosCargos .Add.Codigo := 'V6'; OtrosCargos.Items[0].Monto := cd

我需要为节点添加前缀,但在接口中定义的IXMLNodeList中也添加了名称空间,并且需要在所有节点上添加前缀

  if Length(cds_Partes.FieldByName('Nota').AsString) > 0 then
     Nota.Add( cds_Partes.FieldByName('Nota').AsString);
   OtrosCargos .Add.Codigo := 'V6';
   OtrosCargos.Items[0].Monto :=  cds_Traslado.FieldByName('Importe').AsString;
接口

 function Get_Proyecto: IXMLFactura_proyecto;
 function Get_Nota: IXMLNotasList;
 function Get_CargosCreditos: IXMLFactura_cargosCreditosList;
 function Get_OtrosCargos: IXMLFactura_otrosCargosList;
 .........

function Getfactura(Doc: IXMLDocument): IXMLFactura;
 begin
  Result := Doc.GetDocBinding('PPY:factura', TXMLFactura, TargetNamespace) as    IXMLFactura;
end;

function Loadfactura(const FileName: string): IXMLFactura;
begin
 Result := LoadXMLDocument(FileName).GetDocBinding('PPY:factura', TXMLFactura,  TargetNamespace) as IXMLFactura;
end;

function Newfactura: IXMLFactura;
 begin
  Result := NewXMLDocument.GetDocBinding('PPY:factura', TXMLFactura, TargetNamespace) as IXMLFactura;
end;    
结果

 <PPY:destino codigo="8476" nombre="PLANTA DE MOTORES 4 CILINDROS - SALTILLO"/>

 <nota xmlns="http://www.dfdchryslerdemexico.com.mx/Addenda  /PPY">Addenda de  Prueba</nota>

 <otrosCargos xmlns="http://www.dfdchryslerdemexico.com.mx/Addenda/PPY" codigo="V6" monto="1373.93"/>

普鲁巴补遗
前缀存在于目标节点中,而不是节点NOTA和OTROSCARGOS中

在什么位置添加名称空间


非常

将该单元中的TargetNamespace变量更改为您的命名空间。。。