I've tried several different structures, but it always gives me this error: The current node (xml) does not match the record definition (PagSeguroTransaction).
Why does it complain about node "xml" if it doesn't exist in my input xml?
I'll send an example of the XML (attached) and how my structure is defined.
I've changed this structure several times, without success.
If you can help me by assembling the structure by the xml that I sent as an example, I would appreciate it.
Thanks
Hi You have two problems.1. Attribute name not match XML tag name because of Case-Sensitive. So you need define structure and attribute with same name of XML tag.2. Unnecessary Record (PagSeguroTransaction) used. XML Root element is transactionSearchResult, so you just need define a record list of transactionSearchResult. And you data will be loaded at first row of that record list.
After that, your data can be loaded successfully as following.
RegardsWei
Perfect! The problem was the case sensitive.
I'll explain why it gave an error before. I took the XML return from the API and converted it to JSON, then I created the structure with this JSON, thinking that it was created following what I sent, but the outsystems ignored the case sensitive and created the structure in its default, so the structure created did not was the same as the API return structure.
I hit the structure exactly the same as the input and it worked, so be careful with the case sensitive.
Thanks everyone for the replies!
Sorry, the xml tag is missing from the file, first line:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
I used XmlToRecordList(ToObject(TransacoesList))
Hello Clayton,
Reading the error you're getting, the XML declaration might be considered as a node by the component. Have you tried placing an element named "xml" at the top hierarchy of your Structure?
Do you mind sharing a module with your Structure? If you can't share your entire module that's okay, but if you can isolate the Structure in an .oml file it will make it easier to test and help.
Just remembered you can also give the IgnoreXMLDeclarationAndNS input a try - I believe setting it to True will cause the component to ignore the xml tag.
I hit the structure exactly the same as the input and it worked.
So be careful with the case sensitive.