Delphi IXMLNodeList中的命名空间
我需要为节点添加前缀,但在接口中定义的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
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变量更改为您的命名空间。。。