![large xml file viewer large xml file viewer](https://cdn.windowsreport.com/wp-content/uploads/2020/04/Adobe-Dreamweaver-CTA-210x160.png)
While you may not often have to deal with an XML file in this way, if you do, I hope this article shows that your file can easily be turned into something much more usable. It takes a few seconds to load into a browser, but once it's loaded, navigation is fast. In the output you will see values from the Name and Make attributes of the CarInfo element as shown below: The Tabular.xml file is 8.4MB, quite large for a plaintext file. In our case the CarInfo element has two attributes Name, and Make, therefore we retrieve both.Īs a final step, we execute the sp_xml_removedocument stored procedure to remove the XML document from the memory. Next, inside the WITH clause, we need to define the name and type of the attributes that you want returned. The mode value of 1 returns the attributes only. The OPENXML function takes three parameters: the handle to the XML document, the path of the node for which we want to retrieve the attributes or elements and the mode. Next, we use the OPENXML function to read the contents of the XML document. It takes the handle and the document variable as parameters and creates an association between them. The sp_xml_preparedocument performs this task. To read the attributes and elements of the XML document, we need to attach the handle with the XML document.
![large xml file viewer large xml file viewer](https://www.softwaretestinghelp.com/wp-content/qa/uploads/2020/09/XML-File.png)
![large xml file viewer large xml file viewer](https://res.cloudinary.com/developingdaily/image/upload/v1612884734/amjkglnewefamlqqs8wi.png)
Next, we create a handle for the XML document. At this point in time, the XML document is loaded into the memory. Next using the SELECT statement we print the contents of the XML file. In the script above we declare an XML type variable The variable stores the result returned by the OPENROWSET function which retrieves XML data in binary format.