XMLRecords - RecordListToXML questions

XMLRecords - RecordListToXML questions

  

Hello everyone,


I'm considering using XMLRecords to create an XML file from some database tables.

I would like to ask a couple of questions.

The first: RecordListToXML creates an XML file? If yes, can I choose where to save it? If no, what does it take to create a file?

The second: RecordListToXML can create hardcoded or more complicated XML nodes? Like the following:

Hardcoded: <App_Data App "MOD" Name "Type" Value "title" />


Complicated: <App_Data App "MOD" Name "Title" Language "en" Value "Title1" />


Thank you in advance,


Marios


Hi Mario,

It does not save the file, options for that could be:

1. Save as binary in an entity

2. Use download widget

3. Use FTP forge component

4. Use a cloud storage forge component

5. Save to file system using file system forge component

Regarding your structure, not sure, but your example doesn't look like proper XML to me.

You can generate repeating elements. You can generate elements with attributes.

Hope this answers your questions,

Regards,

Daniel

Hi Mario,

6. Save as text in an entity, to avoid conversion from binary to text when you want to convert it to record list

Nelson Inácio wrote:

Hi Mario,

6. Save as text in an entity, to avoid conversion from binary to text when you want to convert it to record list

The benefits to save as binary is that you are not limited to the max length of a text attribute which is limited i think to the maximum value of a long integer.

Daniël Kuhlmann wrote:

Nelson Inácio wrote:

Hi Mario,

6. Save as text in an entity, to avoid conversion from binary to text when you want to convert it to record list

The benefits to save as binary is that you are not limited to the max length of a text attribute which is limited i think to the maximum value of a long integer.

If you want to convert a very large XML file that outbounds the max lenght of a string, then there's problem when you need to convert that XML to a record list, because you need to convert it to text

Nelson Inácio wrote:

Daniël Kuhlmann wrote:

Nelson Inácio wrote:

Hi Mario,

6. Save as text in an entity, to avoid conversion from binary to text when you want to convert it to record list

The benefits to save as binary is that you are not limited to the max length of a text attribute which is limited i think to the maximum value of a long integer.

If you want to convert a very large XML file that outbounds the max lenght of a string, then there's problem when you need to convert that XML to a record list, because you need to convert it to text

Not sure what problem you run into, but we like to (for big XML files), generate the XML and zip it (high compression rate) and store the zip file as a binary. Then when needed we unzip the binary and process the XML file(s) in it.


Daniël Kuhlmann wrote:

Nelson Inácio wrote:

Daniël Kuhlmann wrote:

Nelson Inácio wrote:

Hi Mario,

6. Save as text in an entity, to avoid conversion from binary to text when you want to convert it to record list

The benefits to save as binary is that you are not limited to the max length of a text attribute which is limited i think to the maximum value of a long integer.

If you want to convert a very large XML file that outbounds the max lenght of a string, then there's problem when you need to convert that XML to a record list, because you need to convert it to text

Not sure what problem you run into, but we like to (for big XML files), generate the XML and zip it (high compression rate) and store the zip file as a binary. Then when needed we unzip the binary and process the XML file(s) in it.


That approach save database size but it takes more time to process. 3 steps, unzip, convert binary to text and convert the XML to record list.

Store as text increase database size but it takes less time to process. Only 1 step convert the XML to record list.

We always have to decide between save database size or a more efficient process. Both options are valid.

Solution

Marios Tofarides wrote:

Hello everyone,


I'm considering using XMLRecords to create an XML file from some database tables.

I would like to ask a couple of questions.

The first: RecordListToXML creates an XML file? If yes, can I choose where to save it? If no, what does it take to create a file?

The second: RecordListToXML can create hardcoded or more complicated XML nodes? Like the following:

Hardcoded: <App_Data App "MOD" Name "Type" Value "title" />


Complicated: <App_Data App "MOD" Name "Title" Language "en" Value "Title1" />


Thank you in advance,


Marios


Hi Marios,

After you convert from RecordList to xml(text), and for make as file, you can use 

1) "BinaryData API" and use action "TextToBinaryData",

2) Use encoding "utf-8"

3) Use download widget, and pass the binary data, and give proper filename with extension.


Hope this helps

Thanks,

Balu


Solution

I want to save this into a file. Saving it in a database is not an option. 

 Some more questions/errors: 

1. RecordListToXML Action has another three parameters: XMLConfig, DefaultConfig And AddRootNode which are not mandatory. How do I populate these? Especially XMLConfig, which, I suppose is the one with the most use?

This is the format of the XML created by "RecordToXML":

"<RecordList>
  <ADI>
    <Title>Center Stage (R-18)</Title>
    <TitleGreek>Center Stage (R-18)</TitleGreek>
    <Summary>What’s art without sacrifice? That’s what a dozen gifted ballet dancers, who have been admitted to the esteemed American Ballet Academy, are about to find out. From Nicholas Hytner, the acclaimed director of The Madness of King George comes Center Stage, a drama about a tight-knit group of dancers who must sacrifice personal pleasures and train religiously in preparation for a recital to determine which of them will be asked to join the very select and prestigious American Ballet Academy. The film features a talented ensemble of real-life professional dancers, including Amanda Schull, Zo? Saldana, Ethan Stiefel, Sascha Radetsky and Shakiem Evans, along with veteran actors Peter Gallagher (sex, lies and videotape), Debra Monk (NYPD Blue), Eion Bailey (Fight Club) and Donna Murphy (The Astronaut’s Wife).</Summary>
    <SummaryGreek>?? e??a? ? t???? ????? ??s?a; ??t? e??a? p?? p???e?ta?  ?a a?a?a?????? d?de?a ta?a?t???e?  µpa?a???e?, p?? ????? ???e? de?t?? st?? f?µ?sµ??? ?µe???????? ??ad?µ?a ?pa??t??.</SummaryGreek>
  </ADI>
</RecordList>"

3. The XML I want to create is not a single record list. It is data from multiple tables. Does XMLRecords support that? The XML file I want to create is attached



Thank you!


Marios  


Balu wrote:

Marios Tofarides wrote:

Hello everyone,


I'm considering using XMLRecords to create an XML file from some database tables.

I would like to ask a couple of questions.

The first: RecordListToXML creates an XML file? If yes, can I choose where to save it? If no, what does it take to create a file?

The second: RecordListToXML can create hardcoded or more complicated XML nodes? Like the following:

Hardcoded: <App_Data App "MOD" Name "Type" Value "title" />


Complicated: <App_Data App "MOD" Name "Title" Language "en" Value "Title1" />


Thank you in advance,


Marios


Hi Marios,

After you convert from RecordList to xml(text), and for make as file, you can use 

1) "BinaryData API" and use action "TextToBinaryData",

2) Use encoding "utf-8"

3) Use download widget, and pass the binary data, and give proper filename with extension.


Hope this helps

Thanks,

Balu


Balu,


The Download Tool, according to the documentation has 4 Mandatory properties

File Content - The content created from TextToBinaryData

File Name - obvious

Mime Type  - What do I use here? "application/octet-stream" or "text/html"?

Save To Disk - Yes


Thanks in advance


Marios

Hello everyone,

I have already generated and downloaded a simple XML file.

Since the XML file I attached earlier might be quite confusing, I am attaching a simpler version of the XML file I want to generate and I need your help to set up the structure of the file (XMLConfig?)

It is quite urgent :) 

Thanks in advance,


Marios

Guys,


I managed to create the XML file without having to use XML Records. The XML file is not that large, so I created the XML Text, and then used Balu's solution to download the file.


Thanks to everyone! :)


Marios