[XML Records] Xml Records - How to use RecordToXml

Forge Component
(43)
Published on 2019-11-25 by Afonso Carvalho
43 votes
Published on 2019-11-25 by Afonso Carvalho
Hey,

I'm using the forge component "RecordToXml" and I am having difficulty using "xml config", I don't know how to customize the parameters and I couldn't find any documentation explaning this parameter. Is there a documentation, or do any of you know how to use it? 
I am using Outsystems 10.


Thank you in advance!


Roza Maria Zoellner Lopes wrote:

Hey,

I'm using the forge component "RecordToXml" and I am having difficulty using "xml config", I don't know how to customize the parameters and I couldn't find any documentation explaning this parameter. Is there a documentation, or do any of you know how to use it? 
I am using Outsystems 10.


Thank you in advance!


Hi,


You can try here: https://afonsobc.outsystemscloud.com/XMLRecordsDemo/


Any help, just tell.


Cheers


Thanks for the answer, I had already seen this documentation, but it does not explain how to use "xmlConfig"

Hi Roza,

Could you share a bit about what you're trying to build with the extension? Is there a property in the structure that you want to know more about?


Afonso Carvalho wrote:

Hi Roza,

Could you share a bit about what you're trying to build with the extension? Is there a property in the structure that you want to know more about?



I can't configure the xml to change attributes.

When you say change attributes, do you mean that you want to give aliases to your record attributes before you generate your XML?

Afonso Carvalho wrote:

When you say change attributes, do you mean that you want to give aliases to your record attributes before you generate your XML?


Yes. I need to generate an xml in the template below, but I can't customize the generated xml.

<?xml version="1.0" encoding="utf-16"?>
<MDFe xmlns="http://www.portalfiscal.inf.br/mdfe">
  <infMDFe Id="MDFe41200100000000000127580010000000011863183585" versao="3.00">
    <ide>
      <cUF>41</cUF>
      <tpAmb>2</tpAmb>    
      <infMunCarrega>
        <cMunCarrega>4100400</cMunCarrega>
        <xMunCarrega>Almirante Tamandare</xMunCarrega>
      </infMunCarrega>
      <infPercurso>
        <UFPer>SP</UFPer>
      </infPercurso>
      <dhIniViagem>2020-01-14T10:52:26-03:00</dhIniViagem>
    </ide>
    <emit>
      <CNPJ>55961131000127</CNPJ>
      <IE>43567898</IE>
      <enderEmit>
        <xLgr>Avenida Principal</xLgr>
        <nro>10</nro>
        <email>transportadora@transportadora.com.br</email>
      </enderEmit>
    </emit>


Doesn't look too complex - I don't see any recursive elements or weird attributes. What does your mapping Structure look like? Can you share a screenshot of it? 

You shouldn't need to set anything in the configuration inputs - what does your output XML look like if you just set empty structures as input parameters?

Afonso Carvalho wrote:

Doesn't look too complex - I don't see any recursive elements or weird attributes. What does your mapping Structure look like? Can you share a screenshot of it? 

You shouldn't need to set anything in the configuration inputs - what does your output XML look like if you just set empty structures as input parameters?


when generating xml I get a structure below, but didn't wany to have this "text" at the beginning of xml