Expand my Community achievements bar.

XML file content assist in Eclipse

Avatar

Level 2

Hi all,

I am new to the development in the AEm product and I need to know how to get the XML files content assist to find the XSD files for all the XMl files formats used in AEM.

I am running Eclipse Luna, Sling and AEM plugin 1.10, latest and greatest..

I See the proper node structure and can open the .content.xml files, filter.xml files and all, but I cannot get the content assist to work, To where do I point the CA engine to find the XSD files for all the XML files?

/Peter

4 Replies

Avatar

Level 7

Not sure on what do you exactly plan to do with content assist. But content assist for xml in eclipse lies in "Eclipse > Preferences > XML > XML Files > Editor > Content Assist" path and which is enabled by default.

 

In general if you want to develop component and templates, use crxde lite in the browser. Its quick and easy, less error prone. Then use vault to get that code into your eclipse. Hope this helps your problem.

 

Thanks

Tuhin

Avatar

Administrator

Hi 

Please have a look at this reference link:- http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.wst.xmleditor.doc.user%2Ftopics%2Ftwcdas...

//

Using XML content assist

You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code.

The placement of the cursor in your source file provides the context for the content assist to offer suggestions for completion.

You can launch content assist in either of the following ways:

  • From the Edit menu, click Content Assist, or
  • Press Ctrl+Space

In addition, you can set up an option that causes content assist to pop up automatically when certain characters are typed. To set up this option, click Window > Preferences to open the Preferences window, then select XML > XML Files Editor > Content assist . Select the Automatically make suggestions check box, and supply any additional characters that should trigger content assist.

If your cursor is in a position where content assist is available, a pop-up list of available choices is displayed when you launch content assist. The list is based on the context and whether a DTD or XML schema is associated with the XML file being edited. For example, if you have an Address element that can contain any of the following children elements: Name, Street, City, Zip Code, Country, and Province, and you place your cursor after any of them and launch content assist, all of the child elements will be listed in the content assist list.

Content assist cycling is available in the XML editor, offering multiple pages of content assist. You can set preferences for the proposal categories and the cycle order when repeatedly invoking content assist

The content assist list displays all valid tags for the current cursor position, including templates. If your grammar constraints are turned off, all available tags, not just valid ones, are displayed.

As you type the first one or two letters of the tag that you want, the list automatically refreshes with alphabetized choices that match your input. Scroll down and select the tag that you want to use by double-clicking on it.

Note: The list only refreshes as described if you first type < before prompting for content assist.

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Administrator

Hi i would suggest you to use "Brackets" if content assist is what you needed.

Link:- http://brackets.io/

Documentation:- https://docs.adobe.com/docs/en/dev-tools/aem-brackets.html

Ask the Expert session:- https://communities.adobeconnect.com/p72w6ea9pf1/?launcher=false&fcsContent=true&pbMode=normal

 

I hope this would be helpful to you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 2

Hi all,

Thanks for taking the time to try to answer my question, but what I am after are the XSD files for CQ, Sling and the JCR namespaces, i.e the definitions of the XML formats used.

Here is a example JCR .content.xml file I am after the XSD files for these namespaces:

xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

The best will of course be if Adobe has got a XML file catalog that I can refer to in Eclipse.

.content.xml example file:

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"jcr:description="Template with focus on content." jcr:primaryType="cq:Template" jcr:title="NewTradingview Site Content Page" allowedPaths="[/content/newtradingview/.+]" ranking="{Long}100"> <jcr:content jcr:primaryType="cq:PageContent" sling:resourceType="newtradingview/components/structure/page"> <logo jcr:primaryType="nt:unstructured" sling:resourceType="newtradingview/components/structure/logo"/> <title jcr:primaryType="nt:unstructured" sling:resourceType="newtradingview/components/content/title"/> <topnav jcr:primaryType="nt:unstructured" sling:resourceType="newtradingview/components/structure/topnav"/> <par jcr:primaryType="nt:unstructured" sling:resourceType="wcm/foundation/components/parsys"> <text jcr:primaryType="nt:unstructured" sling:resourceType="newtradingview/components/content/text" text="&lt;p>This is a content page&lt;/p>" textIsRich="true"/> </par> </jcr:content>