Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 39
Registered: ‎04-23-2011
My Device: N/A
My Carrier: N/A

Using XML to store data for reading in HTML

Hello,

 

I am a beginner dev. Could someone please direct me to some resources? I want to achieve a few things with my new app.

 

In one part of the app, I want to create an HTML form to write data to an XML file. In another part of the app, I want to be able to read the XML file through HTML.

 

What code/language would I use to achieve this?

 

Also, how would I be able to make the XML file stored in the user's file system (for exporting and access after app is closed)

 

Thank you very much.

 

AwesomeDev

Developer
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil

Re: Using XML to store data for reading in HTML

[ Edited ]

The best language for this is Javascript, but I suggest you to use JSON instead of XML because it's a lot easier to work with.

 

There is a lot of resources on the internet about the things you're asking. This is the best tutorial to understand how to get the form data: Using JavaScript and Forms. About storing JSON here is a tutorial about how to build JSON files: Mastering JSON. For storing the JSON file I suggest you to use localStorage, here is a good source of information about how to store the JSONs in localStorage: Storing Objects in localStorage.

 

I highly suggest that you start with simple projects to master each of these parts, then start your main one combining all.

 

 

Don't forget to click the Like button if I was helpful. Smiley Happy

If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Using XML to store data for reading in HTML

But is storing in xml a viable alternative to sqlite?
Developer
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil

Re: Using XML to store data for reading in HTML

If you're comparing storing XML on localStorage and SQLite storage, SQLite is the best way to go since it's fully Javascript compatible.
If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter