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="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




  2. Answer
    Atanas Korchev
    Admin
    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.

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