In this article, we are going to learn how to read XML file in WinJS project.
As we know, WinJS applications are built using HTML/JS/CSS. And for a complete application, we will need async operations like SQL database operations, web-service calls, and other native XML read-write, File read-write which cannot be done directly in WinJS applications. So we have to use Windows Runtime Component to access native C# methods as discussed in my previous article: WinJS application with Windows Runtime Component to access Native C# Code. In this article, I will show you how to read XML file using Windows Runtime Component and display its content in HTML page. Step 1 Firstly, create a WinJS project. Step 2 We need to do the following things as discussed in my previous article.
Step 3 Let us add an xml file in solution explorer folder. Right click on project and add a new item and select xml file. XML file content
Complete html code snippet for default.html is,
Learn Basics of XML