Error when loading frmo XML file

2 posts, 1 answers
  1. Ed
    Ed avatar
    124 posts
    Member since:
    Jan 2008

    Posted 16 Jun 2009 Link to this post

    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="" xmlns:util="" xmlns:xsp-session="" xmlns:xsp-request="" xmlns:i18n="" version="1.2.2" ID="ZA4350"
    Title text goes here

    I load it using the following statement:

    RadTreeView rt = new RadTreeView(); 

    I am getting the following error:

    <codeBook xmlns=''> was not expected.

    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

  2. Answer
    Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 17 Jun 2009 Link to this post

    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.

    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.
Back to Top