Can I use xml in angular2 nativescript code?


#1

I want to use graph in my angular2 application. For that I find out some examples. But all the examples are in the xml. Can not determine how I can use those with my application. Can anyone help me out with this?


#2

Hi Dinesh,

First of all, what graphing package are you using? I ask because I may have the requirement to do the same thing in my app.

Second, NativeScript has a built-in XML parser that is based on SAX. You can find additional information about it here: https://docs.nativescript.org/cookbook/xml-parser. [I just wrote a service that makes use of the XML parser to convert XML to an Object. It’s pretty crude but works for our purposes.] Hopefully you can get an idea for how to use the XML parser from the cookbook page.

I hope this helps,

Steve