<oXygen/> XML Editor User Guide

XML editor specific actions

<oXygen/> offers a group of actions for working on single XML elements. They are available from the Document menu and the context menu of the main editor panel.

Select actions

  • Document+Select->Select element: Selects the entire current element;

  • Document+Select->Select content: Selects the current element, excluding the start tag and end tag;

  • Document+Select->Select attributes: Selects all the attributes of the current element;

[Note]Note

The Select actions are enabled when the caret is positioned inside a tag name.

Source actions

  • Document+Source+ ->Locks / Unlocks the XML Tags: Disable / Enable editing of XML tags

  • Document+Source+ ->Shift Right (Tab): Shifts the selected block to the right;

  • Document+Source+ ->Shift Left (Shift+Tab): Shifts the selected block to the left;

  • Document+Source+ ->Escape Selection ...: Escapes a range of characters by replacing them with the corresponding character entities.

  • Document+Source+ ->Unescape Selection ...: Replaces the character entities with the corresponding characters;

  • Document+Source+ ->Indent selection:Corrects the indentation of the selected block of lines.

  • Document+Source+ ->Pretty-Print Element: Pretty prints the element that surrounds the caret position;

  • Document+Source+ ->Uncomment selection : Removes <!-- --> comment brackets from currently selected comment.

  • Document+Source+ ->Comment selection : Places <!-- --> comment brackets around current selection or cursor position.

  • Document+Source+ ->Import entities list : Shows a dialog that allows you to select a list of files as sources for external entities. The DOCTYPE section of your document will be updated with the chosen entities. For instance, if choosing the file chapter1.xml, and chapter2.xml, the following section is inserted in the DOCTYPE:

    <!ENTITY chapter1 SYSTEM "chapter1.xml">
    <!ENTITY chapter2 SYSTEM "chapter2.xml">
  • Triple click on an element or processing instruction.: Selects the entire element or processing instruction that was triple clicked on.

XML document actions

  • Document+XML Document->Copy XPath (Ctrl+Alt+.): Copy XPath expression of current element from current editor to clipboard.

  • Document+XML Document+ ->Go to the matching tag (Ctrl+Shift+G): Moves the cursor to the end tag that matches the start tag, or vice versa.

XML Refactoring actions

  • Document+XML Refactoring+ ->Surround with tag... (Ctrl+E): Selected Text in the editor is marked with the specified start and end tags.

  • Document+XML Refactoring+ ->Surround with <tag> (Ctrl+/): Selected Text in the editor is marked with start and end tags of the last 'Surround in' action.

  • Document+XML Refactoring+ ->Rename element (Alt+Shift+R): The element from the caret position and the elements that have the same name as the current element can be renamed according with the options from the Rename dialog.

  • Document+XML Refactoring+ ->Rename prefix (Alt+Shift+P): The prefix of the element from the caret position and the elements that have the same prefix as the current element can be renamed according with the options from the Rename dialog.

    Figure 4.39. Rename Prefix Dialog

    Rename Prefix Dialog

    Selecting the "Rename current element prefix" option the application will recursively traverse the current element and all its children.

    For example, to change the xmlns:p1="ns1" association existing in the current element to xmlns:p5="ns1" just select this option and press OK. If the association xmlns:p1="ns1" is applied on the parent of the current element, then <oXygen/> will introduce a new declaration xmlns:p5="ns1" in the current element and will change the prefix from p1 to p5. If p5 is already associated in the current element with another namespace, let's say ns5, then a dialog showing the conflict will be displayed. Pressing the OK button, the prefix will be modified from p1 to p5 without inserting a new declaration xmlns:p5="ns1". On Cancel no modification is made.

    Selecting the "Rename current prefix in all document" option the application will apply the change on the entire document.

  • Document+XML Refactoring+ ->Split element (Ctrl+Alt+D): Split the element from the caret position in two identical elements. The caret must be inside the element

  • Document+XML Refactoring+ ->Join elements (Ctrl+Alt+J): Joins the left and the right elements relative to the current caret position. The elements must have the same name, attributes and attributes values.

  • Document+XML Refactoring+ ->Delete element tags (Ctrl+Alt+X): Deletes the start tag and end tag of the current element.

XML Schema actions

  • Document+Schema->Show definition (Ctrl + Shift + ENTER): Move the cursor to the definition of the referenced XML Schema item - element, group, simple or complex type.

[Note]Note

The Select actions are enabled when the caret is positioned inside a tag name.