Title: [Plugin: OptionTree] Problem with importing xml file
Last modified: August 19, 2016

---

# [Plugin: OptionTree] Problem with importing xml file

 *  Resolved [OllieMcCarthy](https://wordpress.org/support/users/olliemccarthy/)
 * (@olliemccarthy)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-with-importing-xml-file/)
 * Hi Derek,
 * I’d like to start off by thanking you for taking the time to create such a great
   plugin. I’m a couple of days away from finishing my latest theme and I have been
   very impressed with how easy it is to use.
 * So anyway the problem I have is when I was testing the xml import function. I
   get an error for some reason.
 *     ```
       Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 2: parser error : XML declaration allowed only at the start of the document in D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php on line 841
   
       Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <?xml version="1.0"?> in D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php on line 841
   
       Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php on line 841
   
       Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php:841 Stack trace: #0 D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php(841): SimpleXMLElement->__construct('?<?xml version=...') #1 D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php(266): OT_Admin->option_tree_import_xml() #2 [internal function]: OT_Admin->option_tree_admin('') #3 D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-includes\plugin.php(395): call_user_func_array(Array, Array) #4 D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-admin\menu.php(328): do_action('admin_menu', '') #5 D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-admin\admin.php(93): require('D:\Domains\olli...') #6 {main} thrown in D:\Domains\olliemccarthy.com\wwwroot\themes\novocane\wp-content\plugins\option-tree\classes\class.admin.php on line 841
       ```
   
 * Initially I thought it was because I was using it on localhost but when I tried
   importing the options into one of my other online WP installations I get the 
   same error.
 * Any thoughts on what’s going on? I’m not strong in PHP hence the reason I’m using
   your plugin so any help would be greatly appreciated.
 * Ollie

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-with-importing-xml-file/#post-1770244)
 * Did you resolve this, it’s make as such? What version of PHP are you using?
 *  Thread Starter [OllieMcCarthy](https://wordpress.org/support/users/olliemccarthy/)
 * (@olliemccarthy)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-with-importing-xml-file/#post-1770246)
 * I got it working. I think it could be a bug in windows 7. The file is downloaded
   as a .txt file. When I rename it to .xml one empty line is added to the start
   of the file. I went in and deleted the empty line and it worked as planned.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: OptionTree] Problem with importing xml file’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/option-tree_363534.svg)
 * [OptionTree](https://wordpress.org/plugins/option-tree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/option-tree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/option-tree/)
 * [Active Topics](https://wordpress.org/support/plugin/option-tree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/option-tree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/option-tree/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [OllieMcCarthy](https://wordpress.org/support/users/olliemccarthy/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-with-importing-xml-file/#post-1770246)
 * Status: resolved