function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SteveDundeeSteveDundee 

Validation error message in IDE: cvc-elt.1: Cannot find the declaration of element 'ReportFolder'.

Hello

 

I have been using the IDE to merge two SF environments and I am getting validation errors:

 

cvc-elt.1: Cannot find the declaration of element 'ReportFolder'.

cvc-elt.1: Cannot find the declaration of element 'DashboardFolder'.

cvc-elt.1: Cannot find the declaration of element 'DocumentFolder'.

 

These happen against all the -meta.xml files in src/reports, src/dashboards, and src/documents, respectively. These files have not themselves been changed.

 

The errors seem to be significant because one of the changed dashboards complains that its new report cannot be found, even though the path names look OK to me

 

Our main development has been happening in a Sandbox, but the business have also been making changes in Live, since the sandbox was refreshed. I am trying to get all their changes merged from Live into the Sandbox for final testing before deployment. I created a Force.com project in the IDE for each environment and then compared the projects and copied changes from the Live project to the Sandbox project.

 

The changes included changes to Dashboards and to Reports, but not to Documents, so it is especially surprising to see the latter amongst these errors!

 

Does anyone know what these messages mean? And of course, how to fix them?

 

Thanks!

 

Steve

 

Best Answer chosen by Admin (Salesforce Developers) 
JonPJonP

Those look like XML validation messages.  The easiest solution is probably just to create a new Force.com project.  If you have a complicated file set, you can create a new project with contents set to "None," then copy your src/package.xml file from your old project to the new project and then right-click on "src" and choose Force.com > Refresh from Server.

 

Out of curiosity, what version of the Force.com IDE are you using?

 

Jon

salesforce.com Product Manager

All Answers

JonPJonP

Those look like XML validation messages.  The easiest solution is probably just to create a new Force.com project.  If you have a complicated file set, you can create a new project with contents set to "None," then copy your src/package.xml file from your old project to the new project and then right-click on "src" and choose Force.com > Refresh from Server.

 

Out of curiosity, what version of the Force.com IDE are you using?

 

Jon

salesforce.com Product Manager

This was selected as the best answer
SteveDundeeSteveDundee

Hi Jon

 

Thanks for your assistance. My first cry for help with Salesforce, so good to find that it was answered so quickly!

 

Yes, I thought they seemed like XML validation errors. It's hard to see what caused them though.

 

I did as you advised and that gives me a "clean" project on Eclipse. It differs from the "main" project because it is missing the components that had been local-saved only (due to the XML errors and some other errors). So now I have three projects: the main one, the new one, and the one I am trying to merge changes from! I'll do them component-by-component, starting with getting the "main" project merged into the new one, so that the new one replaces the main one. If I spot anything useful about what leads to these errors, I'll post the details here.

 

My IDE is "Spring '09 (15.0.0)". This was the most up to date version when I updated it about a week ago.

 

For your information, the "main" project is linked to our CVS server for version control. The project as it was immediately before I started the merge is committed there.

 

Steve

 

SteveDundeeSteveDundee

What makes the XML errors come up is using the Eclipse "Validate" option (right-click on the project and choose Validate). 

Message Edited by SteveDundee on 04-06-2009 03:16 AM
JonPJonP

If you're getting your source files from CVS, is it possible they were checked in using an older version of the Force.com IDE?

 

Each version of the Force.com IDE is tied to a specific version of the Metadata API, which generally is updated with each major Salesforce/Force.com release.  The schema for all the XML files is defined in the Metadata API, and they can change from release to release (typically by adding new optional or required tags).

 

What may have happened is that your file was created by the v14 or earlier Metadata API and checked into CVS; but when you tried to use it with v15 API/IDE, the file would no longer validate because a new required tag added to the XML schema in v15 was missing from your file.  Mind you, this is just conjecture at this point.

medik8medik8

While creating a new project makes these errors disappear, they will/do appear the next time one clicks Validate in Eclipse. 

 

I have the exact same errors for the exact same folders (relating to the Salesforce for Google AdWords referenced package) and can make them disappear as described in the solution, but how does one go about actually fixing them?

JonPJonP

Have you found this behavior for any other types besides ReportFolders?  I tried a number of other metadata XML files and they were able to validate successfully.

 

Thanks,

Jon

medik8medik8

DashboardFolder

DocumentFolder

ReportFolder

 

All under Salesforce for Google AdWords generate this exact same error when you try to validate the project.

JonPJonP

Looks like there's a bug, that the *Folder XML definitions didn't get registered properly with the XML editor.

 

As a workaround, when you see validation errors on those files, you can just delete the errors directly from the Problems view. I tested this out and it works fine.

Yahor VolkauYahor Volkau
I had the same issue in VS Code and resolved it:
Go to VS Code: File => Preference => Settings => (search for) Validation ==> Click on XML (from the left Nav) and uncheck "Validation"
sahil arora 14sahil arora 14
@Yahor Volkau, it worked, thanks.