![]() |
XML documents use a self-describing and simple syntax. XMLs are often used for storing meta data about applications and deployment platform. Studio simplifies the process of writing an XML code. XML coding aids provided by Studio are:
An invalid XML is unusable as the tool that uses this XML will not understand it. These coding aids help to create a valid and well formed XML document, which also conforms to the DTD rules. This document as describes all XML code aids available in Studio.
Validation of an XML is necessary to eliminate any problems with the page as visually checking the code may not be enough. Studio uses Xerces 2.4 parser and validates for the following errors:
If there is a well formedness errors, only that is highlighted in Studio. When well formedness error has been corrected, validation errors are highlighted.
Studio validates an XML against the corresponding DTD or schema. For example, if the start tag is <dsml:id> and the end tag has not been typed, Studio underlines the tag with a red squiggly. To view details, place the cursor over the squiggly or on the highlight in the overview bar.
If Studio can provide any correction, it suggests to press Alt + Enter; select a suitable suggestion. Press Enter to apply selection.
Studio provides XML tag, attribute, and value completion facility.
Tag completion is triggered on typing < at a valid location. A list of tags is also displayed on pressing Ctrl + Space. The dropdown shows only those tags that are valid at the particular location.
To view a list of tags valid under a parent tag, press Ctrl + Shift + Space.
To view a list of all tags defined in the DTD, press Ctrl + Alt + Space. Select a suitable suggestion from the dropdown; press Enter to include selection in the code. To replace the current tag name with a new tag selected from the dropdown, press Tab.
Sel ecting a tag name and pressing space inserts the tag name, space character, quotes, and displays the attribute completion dropdown. Selecting a tagname and pressing > inserts the tag name followed by the > symbol. Select a tag name and press Slash to insert a tagname, insert, > symbol, and a close tag. Pressing slash inserts tag name followed by > symbol, and a close tag.
Attribute completion is triggered on pressing Space at a valid location such as within a tag. To trigger it explicitly, press Ctrl + Space. This displays a dropdown with a list of attributes allowed at that location.
To view a list of attributes allowed for the current tag only, press Ctrl + Shift + Space or Ctrl + Alt + Space. Mandatory attributes are displayed in bold. Select an attribute an press Enter to include it in the code.
To replace the current attribute, press Ctrl + Space; select a new attribute; press Tab. Selecting an attribute from the dropdown and pressing Equal to inserts the attribute name, equal to symbol, start and end tag, and triggers value completion.
As mentioned in the previous section, value completion is triggered on typing the start quote and one of the predefined values can be an attribute value. It can be explicitly triggered by pressing Ctrl + Space. The dropdowns displays only those tags allowed within that tag.
Select a suitable value and press Enter to include it in the code. To replace the current value, press Ctrl + Space; select a suitable value; pressing Tab. Selecting a value from the dropdown and pressing Quote inserts the value followed by an end quote.
In absence of DTD, Studio provides tag, attribute, and value completion suggestions based on the existing structure of the XML. New tags, attributes, and values once added appear in the dropdown the next time Ctrl + Space is pressed.
XML code completion options are not filtered against schema. But, learns from the existing structure of the XML and provides suitable suggestions.
| Pramati Technologies © Copyright |
|