p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Expert WSS 3.0 and MOSS 2007 Programming ISBN: 978-0-470-38137-3 (http://p2p.wrox.com/book-expert-wss-3-0-moss-2007-programming-isbn-978-0-470-38137-3-421/)
-   -   "Root Element Missing" error creating custom columns (http://p2p.wrox.com/book-expert-wss-3-0-moss-2007-programming-isbn-978-0-470-38137-3/77805-root-element-missing-error-creating-custom-columns.html)

nurat January 16th, 2010 09:53 AM

"Root Element Missing" error creating custom columns
 
Custom site column deployment fails with "Root Element missing" error. Using sample right out of the book. Could anyone tell me what's wrong or how I can debug?

See below.
Code:

<?xml version="1.0" encoding="utf-8" ?>
<Feature
    xmlsn="http://schemas.microsoft.com/sharepoint/"
    Description="This is MyCustomColumn feature!"
    Hidden="FALSE"
    Id="{BE52699A-500F-4467-9E93-F7CAC2A1DBD9}"
    Scope="Site"
    Title="MyCustomColumn Feature"
    Version="1.0.0.0">
  <ElementManifests>
    <ElementManifest Location="MyCustomColumn.xml" />
  </ElementManifests>
</Feature>

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field
    AllowDeletion="TRUE"
    Description="This is MyCustomColumn"
    DisplayName="My Custom Column"
    DisplaySize="100"
    Group="My Custom Group"
    Hidden="FALSE"
    ID="{34A92E83-51F6-4f8c-B88C-919A17C80DC1}"
    ReadOnly="FALSE"
    Required="FALSE"
    SourceID="http://schemas.microsoft.com/sharepoint/v3"
    ShowInDisplayForm="TRUE"
    ShowInEditForm="TRUE"
    ShowInNewForm="TRUE"
    ShowInViewForms="TRUE"
    Type="Text"
    Name="MyCustomColumn"
    Filterable="TRUE"
    HeaderImage="/_layouts/images/actionlhd.gif"
    DisplayImage="/_layouts/images/actionlhd.gif"
    Height="200"
    Sealed="FALSE"
    RowOrdinal="3"
    Sortable="TRUE"
    StaticName="MyCustomColumn"
    Width="100">
    <CHOICES>
      <CHOICE>Item1</CHOICE>
      <CHOICE>Item2</CHOICE>
      <CHOICE>Item3</CHOICE>
      <CHOICE>Item4</CHOICE>
    </CHOICES>
    <Default>Item2</Default>
  </Field>
</Elements>

error:
XML Document failed to parse, file 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Features\MyCustomColumn\fea ture.xml', line 0, character 0:
System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo( String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent( )
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(Stream inStream)
at Microsoft.SharePoint.SPXmlDocCache.GetGlobalXmlDoc umentCore(String pathXml, Boolean bFeature)

nurat January 16th, 2010 02:01 PM

Somehow got it working.
 
Recopied top 2 lines from a working feature and it installed. Then I had to put the files into a renamed copy of a previously working feature folder to get past "Server declined to show page" error in trying to activate it. Security was the same on both folders. It makes no sense. But it's working!


All times are GMT -4. The time now is 10:18 AM.

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.