Editing and statement completion in XML files is made easier by using XSDs (XML Schema Definitions). This topic helps you configure IntelliJ to find and use these files.

Using XSDs

In an XML file, you can use information from XSD files by including syntax like this:

<tables xmlns="http://labkey.org/data/xml">

In this example, the tableinfo.xsd will be loaded and when editing your XML, you will have options like statement completion: if you enter a '<' character (to start an element), you will see a popup of valid options to assist you:

Configuring IntelliJ to Recognize XSDs

If you are not seeing XSDs registered and available as expected, check to ensure that your intelliJ is configured to find them in the correct location.

One symptom of an incorrect configuration is that the XML elements will be shown in intelliJ in red. Select the path value and click 'Alt-Enter' for a menu of options. Choose Manually setup external resource.

In the popup, find and double click the relevant xsd file, in this example, tableinfo.xsd. Click OK. After you begin to edit your XML file, you will see the red alerts disappear and your XSD will be available.

You can also directly edit intelliJ's settings as follows:

  • In IntelliJ, select File > Settings > Languages and Frameworks.
  • Select Schemas and DTDs.
  • In the top panel, you should see (or add) an entry for http://labkey.org/data/xml pointing to the tableinfo.xsd file in your enlistment.
    • To edit an existing entry, click to select it and use the pencil icon to edit.
  • Click OK.

Learn more about how to manually setup external resources in IntelliJ here:

Common Namespace URIs

The following are some common LabKey XSD namespace URIs and their paths in the source tree.

URILocation
http://cpas.fhcrc.org/exp/xml<LABKEY_HOME>/server/api/schemas/expTypes.xsd
http://labkey.org/data/xml<LABKEY_HOME>/server/api/schemas/tableinfo.xsd
http://labkey.org/data/xml/query<LABKEY_HOME>/server/api/schemas/query.xsd
http://labkey.org/data/xml/queryCustomView<LABKEY_HOME>/server/api/schemas/queryCustomView.xsd
http://labkey.org/moduleProperties/xml/<LABKEY_HOME>/server/api/schemas/module.xsd
http://labkey.org/data/xml/webpart<LABKEY_HOME>/server/api/schemas/webpart.xsd
http://labkey.org/study/xml<LABKEY_HOME>/server/api/schemas/datasets.xsd
http://labkey.org/etl/xml<LABKEY_HOME>/server/optionalModules/dataintegration/schemas/etl.xsd

Related Topics

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all