This is a migrated thread and some comments may be shown as answers.

Error when loading frmo XML file

1 Answer 77 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 16 Jun 2009, 09:11 PM
Hi all,

I have the following XML file as a data-source for the RadTreeView:

<?xml version="1.0" encoding="UTF-8"?> 
 
<codeBook xmlns:xsp="http://apache.org/xsp" xmlns:util="http://apache.org/xsp/util/2.0" xmlns:xsp-session="http://apache.org/xsp/session/2.0" xmlns:xsp-request="http://apache.org/xsp/request/2.0" xmlns:i18n="http://apache.org/cocoon/i18n/2.0" version="1.2.2" ID="ZA4350"
<docDscr> 
<citation> 
<titlStmt> 
<titl> 
Title text goes here
</titl> 
</titlStmt> 
</citation> 
</docDscr> 
</codeBook> 
 

I load it using the following statement:

RadTreeView rt = new RadTreeView(); 
rt.LoadContentFile("file.xml"); 
 

I am getting the following error:

<codeBook xmlns=''> was not expected.


Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: <codeBook xmlns=''> was not expected.


I have read similar posts in these forums but don't see an answer to my problem.  I can't alter the data to add an xmlns attribute to each element.

Any ideas?

Ed Graham




1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 17 Jun 2009, 07:12 AM
Hello Ed,

The LoadContentFile method expects the XML to be in RadTreeView specific format. Your xml file is not compatible hence the error. I am afraid you need to parse the XML and create RadTreeNode objects on the fly.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Ed
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or