locked
XML file failed to load RRS feed

  • Question

  • Hi, I am trying to load XML files using MSXML as follows:

    void CMyDlg::OnBnClickedTrainingFileButton()
    {
    	// TODO: Add your control notification handler code here
    
    	// Create an CFileDialog instance 
    	CFileDialog fileDlg( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, _T("GA Training Files (*.xml)|*.xml||"), this);
    	
    	// Initializes m_ofn structure
    	fileDlg.m_ofn.lpstrTitle = _T("Select GA Training File");
    	
    	// Call DoModal
    	if ( fileDlg.DoModal() == IDOK)
    	{
    		LoadResultXML(m_cstrTrainingFileName);
    	}
    }
    
    void CMyDlg::LoadResultXML(CString strXMLPathName)
    {
    
    	HRESULT hr = m_plDomDocument.CreateInstance(CLSID_DOMDocument);
    	
    	if (FAILED(hr))
    	{
    		_com_error er(hr);
    		AfxMessageBox(er.ErrorMessage());
    		EndDialog(1);
    	}
    
    	_bstr_t bstrXMLPath;
    	bstrXMLPath = strXMLPathName.AllocSysString();
    
    	if(m_plDomDocument ->load(bstrXMLPath) == VARIANT_TRUE) // success!
    	{
    		m_pDocRoot = m_plDomDocument->documentElement;
    		AfxMessageBox(_T("Document loaded successfully!"));
    	}else{
    		AfxMessageBox(_T("Document FAILED to load!"));
    	}
    
    }

    a sample xml file is like:

    <!-- abebooks.com_harry potter_title_VIPSResult_15_rec -->
    <?xml version="1.0"?>
    <!-- record 1 -->
    <LayoutNode groupInx="1" isInRecTopNodeGroup="true" order="39" ID="1-1-2-4-3-1" ObjectRectHeight="20" ObjectRectWidth="20" ObjectRectTop="409" ObjectRectLeft="176" BgColor="transparent" FontWeight="700" FontSize="12" DOMCldNum="3" LinkTextLen="109" TextLen="122" ContainP="0" ContainTable="false" IsImg="false" ContainImg="0" DoC="11" SourceIndex="299;300;301" FrameSourceIndex="0" SRC="<A href="/servlet/BookDetailsPL?bi=1257056972&amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter" cmImpressionSent="1">The Magical Worlds of Harry Potter: A Treasury of Myths, Legends and Fascinating Facts</A> <A href="/products/isbn/9780141314815/1257056972" cmImpressionSent="1">0141314818</A> <A href="/products/isbn/9780141314815/1257056972" cmImpressionSent="1">0-14-131481-8</A> " Content="The Magical Worlds of Harry Potter: A Treasury of Myths, Legends and Fascinating Facts 0141314818 0-14-131481-8 "/>
    <LayoutNode groupInx="1" isInRecTopNodeGroup="true" order="34" ID="1-1-2-4-1" ObjectRectHeight="195" ObjectRectWidth="13" ObjectRectTop="409" ObjectRectLeft="10" BgColor="#fff" FontWeight="700" FontSize="12" DOMCldNum="0" LinkTextLen="0" TextLen="2" ContainP="0" ContainTable="false" IsImg="false" ContainImg="0" DoC="11" SourceIndex="288" FrameSourceIndex="0" SRC=" <TD class=itemNumbr vAlign=top><B>1.</B> </TD> " Content="1. "/>
    <LayoutNode groupInx="1" isInRecTopNodeGroup="true" order="36" ID="1-1-2-4-2-1" ObjectRectHeight="140" ObjectRectWidth="140" ObjectRectTop="409" ObjectRectLeft="28" BgColor="#fff" FontWeight="0" FontSize="0" DOMCldNum="1" LinkTextLen="0" TextLen="0" ContainP="0" ContainTable="false" IsImg="true" ContainImg="1" DoC="11" SourceIndex="291" FrameSourceIndex="0" SRC=" <DIV class=imageContainer><A id=listing_1 class=thumbnail title="The Magical Worlds of Harry Potter: A: David Colbert" href="/servlet/BookDetailsPL?bi=1257056972&amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter" cmImpressionSent="1"><IMG src="http://isbn.abebooks.com/bwk/md/18/14/md0141314818.jpg" width=83 height=130></A></DIV> " Content=" "/>
    <LayoutNode groupInx="1" isInRecTopNodeGroup="true" order="50" ID="1-1-2-4-4-1" ObjectRectHeight="25" ObjectRectWidth="135" ObjectRectTop="411" ObjectRectLeft="786" BgColor="#fff" FontWeight="0" FontSize="0" DOMCldNum="1" LinkTextLen="0" TextLen="0" ContainP="0" ContainTable="false" IsImg="true" ContainImg="0" DoC="11" SourceIndex="324" FrameSourceIndex="0" SRC="<A id=add-to-basket-link-1 href="/servlet/ShopBasketPL?ac=a&amp;it=1&amp;ik=1257056972&amp;srimage=stock&amp;isbn13=9780141314815" cmImpressionSent="1"><IMG border=0 alt="Add Book to Shopping Basket" vspace=2 src="/images/servlets/shared/search/add-to-basket-button.gif"></A> " Content=" "/>
    <LayoutNode groupInx="2" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="295" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="12" LinkTextLen="0" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="28" ObjectRectTop="549" ObjectRectWidth="140" ObjectRectHeight="12" Content="Stock Image  " SRC=" &lt;DIV style=&quot;DISPLAY: block&quot; id=imagetype_1 class=photoType&gt;Stock Image &lt;/DIV&gt; " ID="1-1-2-4-2-2" order="37"/>
    <LayoutNode groupInx="3" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="303" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="13" LinkTextLen="0" DOMCldNum="1" FontSize="12" FontWeight="700" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="437" ObjectRectWidth="90" ObjectRectHeight="14" Content="David Colbert " SRC="&lt;B&gt;David Colbert&lt;/B&gt; " ID="1-1-2-4-3-2-1" order="41"/>
    <LayoutNode groupInx="3" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="327;328" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="12" LinkTextLen="0" DOMCldNum="2" FontSize="12" FontWeight="700" BgColor="transparent" ObjectRectLeft="786" ObjectRectTop="450" ObjectRectWidth="20" ObjectRectHeight="20" Content="Price: &#xA3; 0.65  " SRC="&lt;B&gt;Price:&lt;/B&gt; &lt;SPAN class=price&gt;&#xA3; 0.65&lt;/SPAN&gt;  " ID="1-1-2-4-4-2-1-1-1" order="54"/>
    <LayoutNode groupInx="4" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="306;307" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="61" LinkTextLen="21" DOMCldNum="2" FontSize="7.5" FontWeight="400" BgColor="transparent" ObjectRectLeft="250" ObjectRectTop="456" ObjectRectWidth="20" ObjectRectHeight="20" Content="The Orchard Bookshop. (Hayes., UK, United Kingdom)  " SRC="&lt;A href=&quot;/servlet/BookDetailsPL?bi=1257056972&amp;amp;tab=1&amp;amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter&quot; cmImpressionSent=&quot;1&quot;&gt;The Orchard Bookshop.&lt;/A&gt; &lt;SPAN class=scndInfo&gt;(Hayes., UK, United Kingdom)&lt;/SPAN&gt;  " ID="1-1-2-4-3-2-2-1" order="43"/>
    <LayoutNode groupInx="4" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="331" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="16" LinkTextLen="16" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="464" ObjectRectWidth="95" ObjectRectHeight="12" Content="Convert Currency " SRC="&lt;A href=&quot;/servlet/FrameBase?content=%2Fservlet%2FCEPL%3Fvp=0.65%26vc=%A3%26v=0.65%26s=%A3&quot; cmImpressionSent=&quot;1&quot;&gt;Convert Currency&lt;/A&gt; " ID="1-1-2-4-4-2-1-1-2" order="55"/>
    <LayoutNode groupInx="5" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="309" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="18" LinkTextLen="18" DOMCldNum="1" FontSize="12" FontWeight="400" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="496" ObjectRectWidth="114" ObjectRectHeight="14" Content="Bookseller Rating: " SRC="&lt;A href=&quot;javascript:openNewWindow('/servlet/FrameBase?content=%2Fservlet%2FViewSellerRatingsHelp',500, 550,'yes');&quot; cmImpressionSent=&quot;1&quot;&gt;Bookseller Rating:&lt;/A&gt; " ID="1-1-2-4-3-2-2-2" order="44"/>
    <LayoutNode groupInx="5" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="333;334" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="15" LinkTextLen="0" DOMCldNum="2" FontSize="12" FontWeight="700" BgColor="transparent" ObjectRectLeft="786" ObjectRectTop="486" ObjectRectWidth="20" ObjectRectHeight="20" Content="Shipping: &#xA3; 1.47  " SRC="&lt;B&gt;Shipping:&lt;/B&gt; &lt;SPAN class=price&gt;&#xA3; 1.47&lt;/SPAN&gt;  " ID="1-1-2-4-4-2-1-2-1" order="57"/>
    <LayoutNode groupInx="5" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="336" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="22" LinkTextLen="0" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="500" ObjectRectWidth="184" ObjectRectHeight="12" Content="Within United Kingdom  " SRC="&lt;SPAN class=scndInfo&gt;Within United Kingdom &lt;/SPAN&gt; " ID="1-1-2-4-4-2-1-2-2" order="58"/>
    <LayoutNode groupInx="6" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="313" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="21" LinkTextLen="0" DOMCldNum="1" FontSize="12" FontWeight="700" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="510" ObjectRectWidth="589" ObjectRectHeight="19" Content="Quantity Available: 1 " SRC=" &lt;DIV class=result-quantity&gt;&lt;B&gt;Quantity Available:&lt;/B&gt; 1&lt;/DIV&gt; " ID="1-1-2-4-3-2-3" order="45"/>
    <LayoutNode groupInx="6" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="338" DoC="9" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="27" LinkTextLen="27" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="512" ObjectRectWidth="159" ObjectRectHeight="12" Content="Destination, Rates &amp; Speeds " SRC="&lt;A href=&quot;/servlet/FrameBase?content=%2Fservlet%2FShipRates%3Fvid=676907&quot; cmImpressionSent=&quot;1&quot;&gt;Destination, Rates &amp;amp; Speeds&lt;/A&gt; " ID="1-1-2-4-4-2-2" order="59"/>
    <LayoutNode groupInx="7" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="316" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="150" LinkTextLen="0" DOMCldNum="1" FontSize="12" FontWeight="400" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="534" ObjectRectWidth="589" ObjectRectHeight="30" Content="Book Description: Puffin Books, 2001. Paperback. Book Condition: Very Good. edges rubbed &quot; Shipped from the UK &quot;. Bookseller Inventory # mon0000049723 " SRC=" &lt;P&gt;&lt;B&gt;Book Description:&lt;/B&gt; Puffin Books, 2001. Paperback. Book Condition: Very Good. edges rubbed &quot; Shipped from the UK &quot;. Bookseller Inventory # mon0000049723&lt;/P&gt; " ID="1-1-2-4-3-2-4-1" order="47"/>
    <LayoutNode groupInx="8" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="318" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="90" LinkTextLen="84" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="576" ObjectRectWidth="589" ObjectRectHeight="13" Content="Bookseller &amp; Payment Information | More Books from this Seller | Ask Bookseller a Question  " SRC=" &lt;P class=scndInfo&gt;&lt;A href=&quot;/servlet/BookDetailsPL?bi=1257056972&amp;amp;tab=1&amp;amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter&quot; cmImpressionSent=&quot;1&quot;&gt;Bookseller &amp;amp; Payment Information&lt;/A&gt; | &lt;A href=&quot;/The-Orchard-Bookshop-Hayes/676907/sf&quot; cmImpressionSent=&quot;1&quot;&gt;More Books from this Seller&lt;/A&gt; | &lt;A href=&quot;/servlet/AskBooksellerQuestion?reftype=B&amp;amp;refnum=1257056972&quot; cmImpressionSent=&quot;1&quot;&gt;Ask Bookseller a Question&lt;/A&gt; &lt;/P&gt; " ID="1-1-2-4-3-2-4-2" order="48"/>
    <!-- record 2 -->
    <LayoutNode groupInx="9" isInRecTopNodeGroup="true" FrameSourceIndex="0" SourceIndex="353;354;355" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="57" LinkTextLen="44" DOMCldNum="3" FontSize="12" FontWeight="700" BgColor="transparent" ObjectRectLeft="176" ObjectRectTop="610" ObjectRectWidth="20" ObjectRectHeight="20" Content="We Love Harry Potter! 031226481X 0-312-26481-X  " SRC="&lt;A href=&quot;/servlet/BookDetailsPL?bi=2359868197&amp;amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter&quot; cmImpressionSent=&quot;1&quot;&gt;We Love Harry Potter!&lt;/A&gt; &lt;A href=&quot;/products/isbn/9780312264819/2359868197&quot; cmImpressionSent=&quot;1&quot;&gt;031226481X&lt;/A&gt; &lt;A href=&quot;/products/isbn/9780312264819/2359868197&quot; cmImpressionSent=&quot;1&quot;&gt;0-312-26481-X&lt;/A&gt;  " ID="1-1-2-5-3-1-1" order="67"/>
    <LayoutNode groupInx="9" isInRecTopNodeGroup="true" FrameSourceIndex="0" SourceIndex="342" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="2" LinkTextLen="0" DOMCldNum="0" FontSize="12" FontWeight="700" BgColor="#fff" ObjectRectLeft="10" ObjectRectTop="610" ObjectRectWidth="13" ObjectRectHeight="197" Content="2.  " SRC=" &lt;TD class=itemNumbr vAlign=top&gt;&lt;B&gt;2.&lt;/B&gt; &lt;/TD&gt; " ID="1-1-2-5-1" order="61"/>
    <LayoutNode groupInx="9" isInRecTopNodeGroup="true" FrameSourceIndex="0" SourceIndex="345" DoC="11" ContainImg="1" IsImg="true" ContainTable="false" ContainP="0" TextLen="0" LinkTextLen="0" DOMCldNum="1" FontSize="0" FontWeight="0" BgColor="#fff" ObjectRectLeft="28" ObjectRectTop="610" ObjectRectWidth="140" ObjectRectHeight="140" Content=" " SRC=" &lt;DIV class=imageContainer&gt;&lt;A id=listing_2 class=thumbnail title=&quot;We Love Harry Potter!&quot; href=&quot;/servlet/BookDetailsPL?bi=2359868197&amp;amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter&quot; cmImpressionSent=&quot;1&quot;&gt;&lt;IMG src=&quot;http://isbn.abebooks.com/lbr/md/1x/31/md031226481x.jpg&quot; width=85 height=130&gt;&lt;/A&gt;&lt;/DIV&gt; " ID="1-1-2-5-2-1" order="63"/>
    <LayoutNode groupInx="9" isInRecTopNodeGroup="true" FrameSourceIndex="0" SourceIndex="360;361" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="62" LinkTextLen="15" DOMCldNum="2" FontSize="7.5" FontWeight="400" BgColor="transparent" ObjectRectLeft="250" ObjectRectTop="629" ObjectRectWidth="20" ObjectRectHeight="20" Content="WORLDWIDE BOOKS (County Durham, a., United Kingdom)  " SRC="&lt;A href=&quot;/servlet/BookDetailsPL?bi=2359868197&amp;amp;tab=1&amp;amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter&quot; cmImpressionSent=&quot;1&quot;&gt;WORLDWIDE BOOKS&lt;/A&gt; &lt;SPAN class=scndInfo&gt;(County Durham, a., United Kingdom)&lt;/SPAN&gt;  " ID="1-1-2-5-3-1-2-1" order="69"/>
    <LayoutNode groupInx="9" isInRecTopNodeGroup="true" FrameSourceIndex="0" SourceIndex="378" DoC="11" ContainImg="0" IsImg="true" ContainTable="false" ContainP="0" TextLen="0" LinkTextLen="0" DOMCldNum="1" FontSize="0" FontWeight="0" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="612" ObjectRectWidth="135" ObjectRectHeight="25" Content=" " SRC="&lt;A id=add-to-basket-link-2 href=&quot;/servlet/ShopBasketPL?ac=a&amp;amp;it=1&amp;amp;ik=2359868197&amp;amp;srimage=stock&amp;amp;isbn13=9780312264819&quot; cmImpressionSent=&quot;1&quot;&gt;&lt;IMG border=0 alt=&quot;Add Book to Shopping Basket&quot; vspace=2 src=&quot;/images/servlets/shared/search/add-to-basket-button.gif&quot;&gt;&lt;/A&gt; " ID="1-1-2-5-4-1" order="76"/>
    <LayoutNode groupInx="10" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="349" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="12" LinkTextLen="0" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="28" ObjectRectTop="750" ObjectRectWidth="140" ObjectRectHeight="12" Content="Stock Image  " SRC=" &lt;DIV style=&quot;DISPLAY: block&quot; id=imagetype_2 class=photoType&gt;Stock Image &lt;/DIV&gt; " ID="1-1-2-5-2-2" order="64"/>
    <LayoutNode groupInx="11" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="363" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="18" LinkTextLen="18" DOMCldNum="1" FontSize="12" FontWeight="400" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="669" ObjectRectWidth="114" ObjectRectHeight="14" Content="Bookseller Rating: " SRC="&lt;A href=&quot;javascript:openNewWindow('/servlet/FrameBase?content=%2Fservlet%2FViewSellerRatingsHelp',500, 550,'yes');&quot; cmImpressionSent=&quot;1&quot;&gt;Bookseller Rating:&lt;/A&gt; " ID="1-1-2-5-3-1-2-2" order="70"/>
    <LayoutNode groupInx="11" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="381;382" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="12" LinkTextLen="0" DOMCldNum="2" FontSize="12" FontWeight="700" BgColor="transparent" ObjectRectLeft="786" ObjectRectTop="651" ObjectRectWidth="20" ObjectRectHeight="20" Content="Price: &#xA3; 0.64  " SRC="&lt;B&gt;Price:&lt;/B&gt; &lt;SPAN class=price&gt;&#xA3; 0.64&lt;/SPAN&gt;  " ID="1-1-2-5-4-2-1-1-1" order="80"/>
    <LayoutNode groupInx="11" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="385" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="16" LinkTextLen="16" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="665" ObjectRectWidth="95" ObjectRectHeight="12" Content="Convert Currency " SRC="&lt;A href=&quot;/servlet/FrameBase?content=%2Fservlet%2FCEPL%3Fvp=0.64%26vc=%A3%26v=0.64%26s=%A3&quot; cmImpressionSent=&quot;1&quot;&gt;Convert Currency&lt;/A&gt; " ID="1-1-2-5-4-2-1-1-2" order="81"/>
    <LayoutNode groupInx="12" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="367" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="21" LinkTextLen="0" DOMCldNum="1" FontSize="12" FontWeight="700" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="683" ObjectRectWidth="589" ObjectRectHeight="19" Content="Quantity Available: 1 " SRC=" &lt;DIV class=result-quantity&gt;&lt;B&gt;Quantity Available:&lt;/B&gt; 1&lt;/DIV&gt; " ID="1-1-2-5-3-2" order="71"/>
    <LayoutNode groupInx="12" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="387;388" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="15" LinkTextLen="0" DOMCldNum="2" FontSize="12" FontWeight="700" BgColor="transparent" ObjectRectLeft="786" ObjectRectTop="687" ObjectRectWidth="20" ObjectRectHeight="20" Content="Shipping: &#xA3; 1.48  " SRC="&lt;B&gt;Shipping:&lt;/B&gt; &lt;SPAN class=price&gt;&#xA3; 1.48&lt;/SPAN&gt;  " ID="1-1-2-5-4-2-1-2-1" order="83"/>
    <LayoutNode groupInx="12" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="390" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="22" LinkTextLen="0" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="701" ObjectRectWidth="184" ObjectRectHeight="12" Content="Within United Kingdom  " SRC="&lt;SPAN class=scndInfo&gt;Within United Kingdom &lt;/SPAN&gt; " ID="1-1-2-5-4-2-1-2-2" order="84"/>
    <LayoutNode groupInx="13" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="370" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="336" LinkTextLen="0" DOMCldNum="1" FontSize="12" FontWeight="400" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="707" ObjectRectWidth="589" ObjectRectHeight="60" Content="Book Description: Saint Martin's Press Inc., 1999. Paperback. Book Condition: Good. Daily dispatch from UK warehouse - This book is in GOOD overall condition. It shows signs of having been read and has general light wear to the cover, spine and pages. Slight yellowing and curling to the page edges. Bookseller Inventory # mon0000827145 " SRC=" &lt;P&gt;&lt;B&gt;Book Description:&lt;/B&gt; Saint Martin's Press Inc., 1999. Paperback. Book Condition: Good. Daily dispatch from UK warehouse - This book is in GOOD overall condition. It shows signs of having been read and has general light wear to the cover, spine and pages. Slight yellowing and curling to the page edges. Bookseller Inventory # mon0000827145&lt;/P&gt; " ID="1-1-2-5-3-3-1" order="73"/>
    <LayoutNode groupInx="13" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="392" DoC="9" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="27" LinkTextLen="27" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="786" ObjectRectTop="713" ObjectRectWidth="159" ObjectRectHeight="12" Content="Destination, Rates &amp; Speeds " SRC="&lt;A href=&quot;/servlet/FrameBase?content=%2Fservlet%2FShipRates%3Fvid=52580588&quot; cmImpressionSent=&quot;1&quot;&gt;Destination, Rates &amp;amp; Speeds&lt;/A&gt; " ID="1-1-2-5-4-2-2" order="85"/>
    <LayoutNode groupInx="14" isInRecTopNodeGroup="false" FrameSourceIndex="0" SourceIndex="372" DoC="11" ContainImg="0" IsImg="false" ContainTable="false" ContainP="0" TextLen="90" LinkTextLen="84" DOMCldNum="1" FontSize="7.5" FontWeight="400" BgColor="#fff" ObjectRectLeft="176" ObjectRectTop="779" ObjectRectWidth="589" ObjectRectHeight="13" Content="Bookseller &amp; Payment Information | More Books from this Seller | Ask Bookseller a Question  " SRC=" &lt;P class=scndInfo&gt;&lt;A href=&quot;/servlet/BookDetailsPL?bi=2359868197&amp;amp;tab=1&amp;amp;searchurl=bt.x%3D44%26bt.y%3D10%26sts%3Dt%26tn%3Dharry%2Bpotter&quot; cmImpressionSent=&quot;1&quot;&gt;Bookseller &amp;amp; Payment Information&lt;/A&gt; | &lt;A href=&quot;/WORLDWIDE-BOOKS-County-Durham/52580588/sf&quot; cmImpressionSent=&quot;1&quot;&gt;More Books from this Seller&lt;/A&gt; | &lt;A href=&quot;/servlet/AskBooksellerQuestion?reftype=B&amp;amp;refnum=2359868197&quot; cmImpressionSent=&quot;1&quot;&gt;Ask Bookseller a Question&lt;/A&gt; &lt;/P&gt; " ID="1-1-2-5-3-3-2" order="74"/>
    

    but the code ended up failed to load the selected XML file, so I wonder is it because the format of my XML file is incorrect and how to solve the problem. The code can successfully load other XML files though.

    Friday, February 7, 2014 4:44 PM

Answers

  • An XML document must have exactly one root node. Also, you must escape > characters as &gt;, and double quotes as &quot;, inside XML attribute values. Your XML is ill-formed.

    Igor Tandetnik

    • Marked as answer by daiyueweng Friday, February 7, 2014 9:40 PM
    Friday, February 7, 2014 5:50 PM

All replies

  • I think the line

    <?xml version="1.0"?>
    must be the first line in the file.

    David Wilkinson | Visual C++ MVP

    Friday, February 7, 2014 5:41 PM
  • An XML document must have exactly one root node. Also, you must escape > characters as &gt;, and double quotes as &quot;, inside XML attribute values. Your XML is ill-formed.

    Igor Tandetnik

    • Marked as answer by daiyueweng Friday, February 7, 2014 9:40 PM
    Friday, February 7, 2014 5:50 PM