|
Hopefully somebody can tell me what I’m doing wrong … I’ve never used an XML file before, so I’m obviously misunderstanding something ...
This XML file :
="1.0"="utf-8"
<Folders>
<TemplatesFolder>E:\Newsletter Templates (Email)\</TemplatesFolder>
<NewsLetterFolder>E:\Newsletters\</NewsLetterFolder>
</Folders>
Read by this code :
Do While (myXml.Read())
If myXml.IsStartElement() Then
If myXml.Name = "TemplatesFolder" Then
myXml.Read()
myTempFolder = myXml.Value
End If
If myXml.Name = "NewsLetterFolder" Then
myXml.Read()
myNlFolder = myXml.Value
End If
End If
Loop
Gives this error:
There are multiple root elements. Line 3, position 2.
|
|
|
|
|
Just a guess: The backslash/left-angle-bracket combination may be confusing the parser. The backslash character is sometimes used to "escape" the following character. If this is happening, it may not be recognizing the left-angle bracket or the end tag.
Maybe put the folder names in double quotes.
|
|
|
|
|
There is nothing wrong with the XML (presuming that your ascii looking text really is ascii text.)
You posted code that shows how you are attempting to parse the xml tree.
But how are you creating the tree in the first place?
|
|
|
|
|
Google XPath and SelectSingleNode... the code you have is about the worst possible way to deal with XML.
|
|
|
|