Serialization_XmlToRecordList

Serialization_XmlToRecordList

  

Hi guys,

I'm trying to insert a XML file in my DB. Using Serialization_XmlToRecordList but since i'm a novice in XML I'm having some difficulties using this action.
This action has two arguments one to insert the "XML" text, and the other "RecordList" an ?object?. i've tried to use ToObject(my_recordList_structure_variable) but no success:(. Can any one help me with this ?


Attached to this post, is a too easy example for you "XML masters". Modify at your own will, so i can take such example.

PS: This code is from other post, but i will use it for this test, because is simple.
 <?xml version="1.0" encoding="UTF-8"?>
<DBExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  < S_WARRANT_ISSUE_BATCH >
    <MessageNumber>22</MessageNumber>
 < /S_WARRANT_ISSUE_BATCH >
</DBExport>

Hi João,

Unfortunatly, I believe that the XML extension available in the AgileNetwork only supports entity serialization (entity records), not structures... I think that you can serialize any type of record (entity or structure) into XML, but only entity records will be convertet back from XML.

hi Fernando. I can create an entity based on my xml file if need (to work), besides having a structure, will i achieve my main goal?

main goal  -   Recieving XML file and save data in DB.
How is this done?

Anyone has one good example so a can learn with it?

Sorry, perhaps I misunderstood your question. If you just want to upload an XML file and store it in the database, either in binary or plain-text format, you don't need to use the XML extension. Check out this (plain-text) and this (binary) posts.

If after uploading the XML file you want to parse it and store each node in specific fields in a table, maybe the best way is to use the XML extension and access each XML node using XPath, filling a record and then insert it in the database.

I want to parse and store it.

I thought that action "Serialization_XmlToRecordList" could return a record list with the same record definition as the xml file. But if  i've to access to
XML node and then  fill a record and then insert it in the database, is more complex.

Can you put my example (attached file) to work? It would be a good example to start.

XML FILE
<?xml version="1.0" encoding="UTF-8"?>
<DBExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  < S_WARRANT_ISSUE_BATCH >
    <MessageNumber>22</MessageNumber>
 < /S_WARRANT_ISSUE_BATCH >
</DBExport>
Hi João,

Take a look into this new component XML Records that might help you on that.

Cheers,
Tiago Simões