Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
João Inácio
14
Views
5
Comments
Serialization_XmlToRecordList
Question
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="https://www.w3.org/2001/XMLSchema-instance">
< S_WARRANT_ISSUE_BATCH >
<MessageNumber>22</MessageNumber>
< /S_WARRANT_ISSUE_BATCH >
</DBExport>
xml_testes.oml
Fernando Sousa
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.
João Inácio
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?
Fernando Sousa
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.
João Inácio
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="https://www.w3.org/2001/XMLSchema-instance">
< S_WARRANT_ISSUE_BATCH >
<MessageNumber>22</MessageNumber>
< /S_WARRANT_ISSUE_BATCH >
</DBExport>
Tiago Simões
Staff
Hi João,
Take a look into this new component
XML Records
that might help you on that.
Cheers,
Tiago Simões
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...