Forum Discussion

kkdavid's avatar
kkdavid
Occasional Contributor
14 years ago

Parsing XML without a root node

I have a xml file that has no root node, it looks like this



<?xml version="1.0" encoding="utf-8"?>

<process>

    <type>2</type>

    <idle_time>10</idle_time>

</process>

<input>

    <infolder>C:\Re-Rite6\InPath</infolder>

</input>

<conversion>

    <filename>%f %d %w %t</filename>

</conversion>







I've been trying to parse/read the xml using the below code but to no avail since i think it cant read a xml file without a root tag



Set Doc = Sys.OleObject("Msxml2.DOMDocument")

Doc.async = False

Doc.validateOnParse = False



Doc.loadXML("C:\Documents and Settings\All Users\Application Data\\configuration\InPath1.fpr")

 --> seems that load fails due to the format of xml file





can anyone knows how can i get around with this? Can't edit the xml file because this is a config file for one of the projects that i am testing

1 Reply