Skip to Content
0

Generate xml structure from data in single source field

Sep 26, 2017 at 11:56 AM

86

avatar image
Former Member

Hello Gurus,

I have a scenario wherein the entire xml payload is part of single source field. This xml payload needs to be mapped to an IDoc. I tried using XSLT but some of the segments are not generated in target xml.

Could you please suggest which is a better approach, XSLT or Java ?

PFB the sample input and output required. the xml payload is part of content field. this needs to be mapped to relevant target structure.

http://abc.com/diverza/invoice"> < content> http://www.sat.gob.mx/sitio_internet/cfd/tipoDatos/tdCFDI" xmlns:ns=" http://www.buzonfiscal.com/ns/addenda/bf/3" xmlns:cfdi=" http://www.sat.gob.mx/cfd/3" xmlns:catCFDI=" http://www.sat.gob.mx/sitio_internet/cfd/catalogos" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd" Version="3.3" Serie="FA" Folio="4422075317" Fecha="2017-05-11T12:11:30" Sello="VRdry/8flb43GUj305R/Y8j98Ibk6IM=" FormaPago="01" NoCertificado="20001000000200001428" Certificado="w55uNfsD" CondicionesDePago="Prepaid" SubTotal="2921.55" Descuento="0.00" Moneda="MXN" Total="3389.00" TipoDeComprobante="I" MetodoPago="PUE" LugarExpedicion="01210"> http://www.sat.gob.mx/TimbreFiscalDigital" xsi:schemaLocation=" http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/sitio_internet/cfd/TimbreFiscalDigital/TimbreFiscalDigitalv11.xsd" Version="1.1" UUID="5858078d-2-4c9d490aff03" RfcProvCertif="DIA000002LZ2" FechaTimbrado="2017-05-11T12:11:30" SelloCFD="VRdgGy/zFfR/Y8Hl0ShY8Ibk6IM=" NoCertificadoSAT="20001000000300022323" SelloSAT="NAM+fE/6Hcxwggy/gmZ6Tr7vV/pUAzOjdCQoaOVg=="/> </content> </record> </ns1:MT_DIVERZA_InvoiceResp>

Thanks,

Pankaj

10 |10000 characters needed characters left characters exceeded

Hello Pankaj,

The XML is not valid, certain nodes are missing. you have blanks in NS declarations, right before "http" for example "xmlns:ns=" http://...."

Once these are fixed I would say with a Java map you could make an XML structure within the <content> tags. You could for example replace all blanks with tags. But as long as you have blanks in namespace declarations this will not work.

Best regards, Peter

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Sep 28, 2017 at 06:57 PM
0

Hi Peter,

Thanks for your comments. This is the response we receive in a field and have no control, However, this is now handled by XSLT mapping wherein the xml in content payload is the output xml.

Thanks,

Pankaj

Share
10 |10000 characters needed characters left characters exceeded