I have an XML file as shown below:
<itemnumbers>
<item>
<itemno>123</itemno>
<desc>Desc about 123</desc>
</item>
<item>
<itemno>456</itemno>
<desc/>
</item>
...
</itemnumbers>
I would like to use the HTML5 localStorage to store the data (and retrieve for quicker access) since the XML data does not change regularly.
I am planning to convert it into JSON first and then store it in the localStorage. Should I do that in the code or have the data upfront in the .JSON file instead of the .xml file?
How do I parse the data later? Currently I am using jQuery code to parse...something like:
$(this).find("itemno").each(function()
{
$(this).text();
$(this).next().text()
}
Would the above code work after the JSON conversion?
I would like suggestions on the best way to approach this.