adobe / aem-eclipse-developer-tools

The Eclipse plugin that brings you the full connection to the Adobe Experience Manager, with auto-sync and project creation wizard.
Apache License 2.0
35 stars 23 forks source link

Wrong namespace in the XML file for cq:EditConfig node #50

Closed ghost closed 4 years ago

ghost commented 9 years ago

Steps to reproduce this issue.

  1. From within AEM Eclipse Developer Tools, create a node with node type = cq:EditConfig under a cq:Component node. Let's call it Component-A
  2. Double click the cq:EditConfig node to open up as XML.
  3. Notice that there's a namespace = xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
  4. Repeat step ONE on another component (Component-B) but using CRXDE Lite.
  5. From within AEM Eclipse Developer Tools, click on Component-B, right click > Import From Server.
  6. Double click the cq:EditConfig node to open up as XML.
  7. Notice that you can find the namespace discovered in step 3. Instead, you'll see this namespace = xmlns:cq="http://www.day.com/jcr/cq/1.0"

The one created in AEM Eclipse Developer Tools will have issue after I added an attribute say for e.g.: cq:layout = editbar and trying to export into server.

rombert commented 9 years ago

@patricklwy14 - thanks for the report. I was able to reproduce the error that you mentioned - for the record it is

Failed reading file at /sample004/jcr_root/content/example/comp/.xml org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 26; The prefix "cq" for attribute "cq:layout" associated with an element type "jcr:root" is not bound.

Now, this simply says that you have added a cq:layout attribute without declaring the cq namespace in the XML file. The error will be avoided by adding that namespace to the XML file. I can see this being a bug if we were to have specific wizards for components and edit configs and those would have missing namespaces. But at the moment I'm not sure what we can do ... it's not 100% safe to 'detect' namespaces from the repository ( and we're not always connected to the repository ) and even that would be awkward to implement.

Thoughts?

rombert commented 8 years ago

Adding @AliShirazi from duplicate issue #62

Some things which we can do better here, in no particular order:

Thoughts?

kwin commented 7 years ago

The XML Validation has been enabled now for content-package projects (https://issues.apache.org/jira/browse/SLING-6237) so with the upgrade to Sling IDE 1.2.0 there should be a proper error message once you use an undeclared namespace.

gabrielwalt commented 4 years ago

Closing this as there hasn't been activity for over a year.