Tools Guide  

Chapter 7   XML Editors

This chapter describes the facilities that Workbench provides to work with XML and XML-related files. It contains the following topics:

 
Top of page

About XML

XML (Extensible Markup Language) is a language designed to facilitate the exchange of data between computer systems (which can be of different types) and applications on the Web. XML is a project of the World Wide Web Consortium (W3C). It is a standard, public format.

Unlike HTML, XML is extensible. It is a metalanguage, a language that describes other languages. With XML, you can define customized markup languages to describe any type of document structure. XML can be used to specify the structure of anything from a recipe (which might consist of descriptions, ingredients, preparation steps, and so on) to a Web application (WAR deployment descriptors are XML documents).

The definition of an XML document is specified by either a Document Type Definition (DTD) or a Schema. DTDs, which are older, specify the structure of an XML document. They specify the names of elements, attributes, and entities that can exist in a conforming XML document. DTDs also specify where the elements can be used, whether they are required, and so on.

Schemas are more recent and more powerful. They can specify the structure as well as the content (data types) allowed in XML documents. Unlike DTDs, Schemas are themselves XML documents.

    The complete XML standard can be found at http://www.w3.org/XML.

TIP   If you are new to XML, you might want to read the XML FAQ at http://www.ucc.ie/xml. Among other topics, it describes the differences between Schemas and DTDs.

 
Top of page

XML support in Workbench

Workbench provides comprehensive support for working with XML files, including:

This chapter describes these XML facilities.

 
Top of page

Using the XML Editor

The XML Editor lets you:

 
Top of section

Using the Source View

The Source View provides you with a powerful XML source editor. In addition to standard text editing features—including cut-and-paste editing, undo and redo, and searching and replacing text—it supports these specialized features for editing XML files:

The XML Editor displays the current XML document in the Source View if you click the XML Source View tab.

 
Top of section

Using the Tree View

The Tree View has special features designed to help you create valid XML documents quickly and easily based on XML Schemas or DTDs. The Tree View supports:

The XML Editor displays the current XML document in the Tree View if you click the XML Tree View tab.

NOTE   The Tree View does not show or manipulate XML comments.

Tree View display buttons

Icon

Description

Expand element list (show subelements as well as the text value and CDATA for the element)

Collapse element list

Display menu allowing you to toggle the display of all elements' attributes and namespace declarations

Display menu allowing you to show or hide an element's attributes and namespace declarations

Tree View icons

Icon

Description

Document

Element

Text value of an element (for example, the text value of <myTag>the text</myTag> is the text)

CDATA

Attribute

Required attribute

Namespace declaration

Search result

Indicates that the XML cannot be parsed

 
Top of page

Creating and opening XML documents

You can create new XML documents or work with existing ones.

To create a new XML document:

  1. Select File>New.

  2. On the XML tab, select XML file.

  3. To create a blank XML document, deselect Use Wizard and click OK. An empty XML document is created and displayed in the XML Editor.

    To use the XML Wizard, select Use Wizard and click OK. The XML Wizard displays. Go through the wizard as follows.

  4. Specify the name and location of the XML file and click Next.

  5. Specify a Schema or DTD to associate with the XML file. You can:

        For more information about the Workbench catalog, see Maintaining the XML catalog.

  6. Click Finish.

    The XML Editor displays the Schema Guide.

  7. You can use the Schema Guide, or click Close to edit the file manually.

    For information about the Schema Guide, see Using the Schema Guide.

To open an XML document:

  1. Select File>Open.

  2. In the Open dialog, select the XML file and click Open.

    The file extension must be .XML, .XSD (for a Schema file), or .TLD (for a tag library descriptor file).

    The file opens in the XML Editor. If you opened an .XML or .TLD file, there is a new XML Editor item on the menu bar.

    NOTE   An XML file might instead be opened by a specialized XML editor, such as the XML Catalog Editor or Deployment Descriptor Editor.

Finding Schemas and DTDs   If the XML document specifies a Schema or DTD, Workbench searches for it when opening the document. If Workbench finds the Schema or DTD, it attaches it to the XML document. If the reference is unqualified, Workbench first looks in its XML catalog; if Workbench doesn't find the Schema or DTD there, it looks in the directory containing the XML document.

If the XML Editor cannot find the referenced Schema or DTD, you receive an error message in the Output Pane and the document is opened without being attached to the Schema or a DTD.

    For more information, see Associating Schemas and DTDs with XML documents.

The window title for an XML document specifies whether the document is attached to a Schema or DTD.

 
Top of page

Associating Schemas and DTDs with XML documents

In order to use context-sensitive code completion and to validate your document, an XML Schema (.XSD file) or a DTD (.DTD file) must be attached to the document.

If Workbench didn't attach a Schema or DTD when opening an XML document, you can manually attach a Schema or DTD or modify your XML document to specify a Schema or DTD and refresh Workbench.

 
Top of section

Attaching a Schema or DTD to a document

You can attach a Schema or DTD that is in the Workbench XML catalog or elsewhere on the file system to an open XML document.

    For more information about the Workbench XML catalog, see Maintaining the XML catalog.

To attach a Schema or DTD to an XML document:

  1. Select XML Editor>Attach Schema or DTD.

  2. Specify a Schema or DTD to associate with the XML document. You can:

  3. Click OK.

    The Schema or DTD is now attached to your XML document. You can use the XML Editor's context support for editing, and you can validate your document.

NOTE   Attaching a Schema or DTD to an XML document is only for the purpose of context editing and validation in the XML Editor; it doesn't modify the XML document itself. See the next section for permanently associating a Schema or DTD with the document.

Errors   Any errors that occur when attaching a Schema or DTD are reported in the Messages tab of the Output Pane.

 
Top of section

Specifying a Schema or DTD in the XML document

After opening an XML document, you might want to permanently associate the document with a Schema or DTD and make Workbench aware of the association.

To associate the document with a Schema or DTD and update Workbench:

  1. Edit the open XML document to specify the associated Schema or DTD. For example, to associate the document with a DTD, edit its DOCTYPE statement.

  2. Update Workbench to use the association by selecting XML Editor>Refresh Schema Handler.

    Workbench parses the XML document and updates the DTD or Schema information associated with the document.

Errors   Any errors that occur when updating the Schema or DTD information are reported in the Messages tab of the Output Pane.

 
Top of section

Detaching a Schema or DTD

You can detach a Schema or DTD from an open XML document.

To detach a Schema or DTD:

The Schema or DTD is not permanently detached. The next time you open the XML document, if the document specifies a Schema or DTD that Workbench can find, the Schema or DTD will be attached again.

 
Top of page

Converting a DTD to a Schema

Schemas are more powerful than DTDs and are becoming the standard for defining the structure and allowable content type for XML documents. Also, unlike DTDs, Schemas are themselves XML documents and can be edited and validated in the XML Editor.

If you have been using DTDs, you can use Workbench to convert a DTD to a Schema. You can:

To convert a DTD on the file system to a Schema:

  1. Select File>New.

  2. On the XML tab, select DTD to Schema and click OK.

  3. Specify the DTD to convert. You can click the ellipses button to browse the file system for the DTD file. The file must have the extension .DTD.

  4. Specify the name of the Schema file to generate. Don't provide a file extension; the file will be given the extension .XSD.

  5. Specify the location to save the Schema file. You can click the ellipses button to browse the file system.

  6. Specify whether you want the Schema opened in the XML Editor after it is created.

  7. Click Finish.

    Workbench converts the DTD to a Schema, stores the Schema in the specified location, and displays the Schema in the XML Editor if you specified to open it.

To convert a DTD attached to an open document to a Schema:

  1. Attach a DTD to an open XML document.

  2. Select XML Editor>Convert DTD to Schema.

    A file save dialog displays.

  3. Specify the name and location of the Schema. Don't provide a file extension; the file will be given the extension .XSD.

  4. Click Save.

    The Schema is saved.

What to do next   You can edit the generated Schema file in the XML Editor and attach it to an XML document for context editing and validation. If you want to permanently associate the Schema with an XML document, edit the XML document to specify the Schema.

 
Top of page

Editing an XML document

You can edit an XML document using either Tree View or Source View. If you have attached a Schema or DTD, you can use the XML Editor's context support.

 
Top of section

About context support

Workbench provides context editing in both the Tree View and the Source View.

Context support in Tree View

In Tree View, right-click at the appropriate location in the document. In the following illustration, a new person is being added to the document, and the XML Editor detects from the Schema that the next valid element is name.

Once the name has been added, the XML Editor presents the new list of valid elements, according to the Schema.

Similarly, the editor presents valid attributes when you have an element selected.

Notice that the editor also provides the choice Other, allowing you to define an entry that does not conform to the Schema. If you choose Other, you see a dialog similar to the following:

Using the Schema Guide   In addition to using the context menu to edit your XML document, you can use the Schema Guide for more comprehensive context support. See Using the Schema Guide.

Context support in Source View

In Source View, after you type < (to start an element tag) or a single space within an element (to define an attribute), the editor displays the valid entries (if there are any). For example:

Here a space has been typed in the url element, which results in a display of the valid attribute, href:

 
Top of section

Adding elements

To add an element in Tree View:

  1. Select where you want to insert the element.

  2. Right-click and select Insert New Element to insert an element inside the current element, or select Insert New Element Before to insert an element before the current element at the same level.

    If valid elements can be inferred from the definition of the document, they will be listed.

    If no element can be inferred, you can add an element by choosing Other. You are warned that the new element might not be valid.

To add an element in Source View:

  1. Position the insertion point where you want to insert the element.

  2. Type <.

    If valid elements can be inferred from the definition of the document, they will be listed.

    If no element can be inferred, you can add an element by typing it.

 
Top of section

Adding attributes

To add an attribute in Tree View:

  1. Select the element to contain the new attribute.

  2. Right-click and select Insert New Attribute.

    If valid attributes can be inferred from the definition of the document, they will be listed.

    If no attribute can be inferred, you can add an attribute by choosing Other. You are warned that the new attribute might not be valid.

To add an attribute in Source View:

  1. Position the insertion point inside an element where you want to insert the attribute.

  2. Type a space.

    If valid attributes can be inferred from the definition of the document, they will be listed.

    If no attribute can be inferred, you can add an attribute definition by typing it.

 
Top of section

Adding namespace declarations

To add a namespace declaration in Tree View:

  1. Select the element for the namespace declaration.

  2. Right-click and select Insert New Namespace Declaration.

    The Insert Namespace Declaration dialog displays.

  3. Specify the prefix, URL, and Schema location for the namespace.

  4. Click OK.

To add a namespace declaration in Source View:

 
Top of section

Editing objects

To copy, move, or delete objects in Tree View:

To copy, move, or delete objects in Source View:

Reversing changes   All editing actions can be undone by selecting Edit>Undo or pressing Ctrl+Z, or redone by selecting Edit>Redo or pressing Ctrl+Y.

 
Top of page

Using the Schema Guide

The context editing functionality described above is very useful when editing XML documents, but doesn't always provide all the information you might want. For example:

The Schema Guide addresses these situations.

To invoke the Schema Guide:

  1. Select Tree View in the XML Editor or XML Catalog Editor.

  2. Do one of the following:

    The Schema Guide opens in a new window.

 
Top of section

The Schema Guide window

The Schema Guide window consists of four parts:

In the screen shown above, the second person element (/personnel/person[2]) was selected when the Schema Guide was invoked.

About the left pane

The left pane shows the element's subelements as well as the Schema model groups they belong to (Choice, Sequence, or All) or the model group declarations (for example, schemaTop).

Positioning the mouse pointer over an element displays a tool tip describing the element if there is documentation for the element in the Schema or DTD.

The Schema Guide also displays how many instances of each subelement and attribute are allowed. If exactly one of the subelement or attribute is required, no enumeration is shown. Otherwise, the Schema Guide displays the requirement (such as "0 or more", "0 or 1", or "1 or more").

The Schema Guide is invoked automatically when you use the XML Wizard to create an XML document. You can also invoke it when the document is empty and has a Schema attached. In this situation, the Schema Guide lists in the left pane possible root elements. If using a DTD, the description in the header will show the suggested root elements (that is, those elements that are not in the content model of other elements).

About the right pane

The right pane displays the standard Tree View of the XML Editor to show the element that was selected when the Schema Guide was invoked, its attributes, and its immediate children.

Subelements that are not legal are shown with a red background. If the selected element contains an illegal attribute, the element itself is marked with red. Clicking on a colored element displays a similarly colored region of text along the bottom of the tree. The text describes the issue in more detail.

In many cases, the Schema Guide can fix validation errors, either by removing illegal elements or attributes, or by moving an element from a wrong namespace into a correct one. In the following example, the Schema Guide is indicating that the age element is invalid in the person element. You can delete the invalid element by clicking Delete.

Namespace errors are treated separately. These errors are common when dealing with Schemas, because Schemas can contain elements from several namespaces and have different rules for whether specific elements or attributes are required to be in a namespace. An element that has the correct local name for the document to validate correctly but whose namespace is incorrect is shown with a yellow background. You can use the Change button to move the element to the correct namespace.

 
Top of section

Adding elements and attributes

Elements   When selecting an element in the left pane, the tree view shows where the element can be legally inserted by displaying one or more green nodes in the tree. The following screen shows that an email element can be legally inserted above or below the existing email element.

To insert an element, select one of the green elements in the tree and click Insert. If you don't want to insert the element, simply select another object in the left pane to consider.

If you click an element in the left pane that cannot be legally inserted, you will not see any green entries in the right pane.

Attributes   To add an attribute, select it in the left pane. If it is legal to add, you will see a green attribute in the right pane. Specify the attribute's value and click Insert.

 
Top of section

Looking at different elements

You can navigate the element hierarchy by selecting a subelement in the right pane and clicking Go to. The subelement becomes the selected element and its definition is now shown in the left pane and the tree structure for the selected instance is shown in the right pane. You can work with it the same way you worked with the parent element.

The following screen shows the Schema Guide after the person element's name subelement was selected and Go to was clicked.

Click Back to return to working with the parent element.

 
Top of page

Validating an XML document

As you type in Source View, the editor automatically highlights in red any areas of the document that are not well formed. The Tree View creates well-formed documents by design.

You can also manually validate the document for conformance to the Schema or DTD.

To validate an XML document:

The editor validates the XML document against the attached Schema or DTD.

The results   The report identifying any malformed statements displays in the Validate tab of the Output Pane.

XPaths   References to errors are reported as XPaths. XPath (XML Path Language) is the W3C-endorsed language for addressing parts of an XML document. It uses a path notation similar to an URL for navigating through the structure of the document. (For more information, see http://www.w3c.org/TR/xpath.)

For example, the XPath /personnel/person[1] indicates the first instance of person in the XML document, the XPath /personnel/person[2] indicates the second instance of person, and so on.

In the preceding example, the id attribute is reported as missing from the first two person elements.

TIP   You can search for specific XPaths in Tree View. See Searching an XML document.

 
Top of page

Searching an XML document

You can search your document in either Source View or Tree View.

To search an XML document:

  1. In either Source View or Tree View, select Search>Find or press Ctrl+F.

    The Find dialog displays.

  2. In Source View, you can perform standard text searches. In Tree View, you can specify the following:

  3. Click OK to search.

    If there is a match, the first match is selected and all matching occurrences are indicated:

  4. To go to the next occurrence, press F3.

Searching for attributes in Tree View   When searching for attributes, you can specify:

You can click Add attribute name and value search to search for elements containing more than one attribute with a given name and/or value. To be matched, an element must match all of the specified entries. For example, you could search for all elements having an id attribute and a salary attribute.

 
Top of page

Maintaining the XML catalog

Workbench provides a built-in catalog of widely used Schemas and DTDs. For example, the catalog includes the Schemas for XSL, WSDL, and XML Schemas; the Sun J2EE DTDs; and the SilverStream deployment plan DTDs.

When you open an XML document that references a Schema or DTD, if the Schema or DTD is in the catalog, Workbench associates it with the XML document and enables context editing and validation.

The Workbench catalog is based on the OASIS XML catalog standard. The OASIS XML catalog standard specifies a format for mapping external identifiers (public and system identifiers) and URI references to other URI references. This makes it possible to map, for example, a URI of a namespace to a local Schema file. The standard specifies that catalogs consist of one or more catalog entry files, each file specifying a set of catalog entries.

    For information on the OASIS standard, see http://www.oasis-open.org/committees/entity/spec.html.

The built-in Workbench catalog consists of three directories in the Workbench Resources directory:

About the catalog entry files   There are four built-in catalog entry files:

The two DTD-related catalog entry files both point to DTD files in the DTDCatalog directory, that is, their base directory is specified as ../DTDCatalog. Similarly, the two Schema-related catalog entry files both point to Schemas in the SchemaCatalog directory, that is, their base directory is ../SchemaCatalog.

An example   For example, say you are working with the personal.xsd document that contains this declaration:

  <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

Because the built-in Workbench catalog entry file schemacatalog.xml lists this URI and maps it to XMLSchema.xsd in the SchemaCatalog directory, when you open personal.xsd, Workbench locates its Schema in the local catalog without having to go out to the Internet for it.

 
Top of section

Adding to the catalog

You might have Schemas and/or DTDs that you want to add to the Workbench catalog so they can be located when you open XML documents that use them. You can add Schemas and DTDs using the existing catalog structure or by extending the structure.

Maintaining the existing structure   The easiest way to add entries to the Workbench catalog is by using the existing catalog directory structure.

To add to the Workbench catalog using the existing structure:

  1. Add the .DTD or .XSD file to the DTDCatalog directory or SchemaCatalog directory.

  2. Open the corresponding user-editable catalog entry file in the Workbench Resources\CatalogFiles directory.

  3. Add the catalog entries to the file.

    You edit catalog entry files with the XML Catalog Editor, as described in Using the XML Catalog Editor.

Extending the catalog structure   You can also add entries to the XML catalog by extending the directory structure, that is, by creating additional directories of Schemas and DTDs and additional catalog entry files.

To add to the catalog by extending the directory structure:

  1. Add the .DTD and/or .XSD files you want in the catalog to directories on your file system. You can organize the DTDs and Schemas any way you want, but you will need to create a catalog entry file for each directory containing DTDs or Schemas.

  2. Create catalog entry files for each of the directories using the XML Catalog Wizard:

    1. Select File>New.

    2. On the XML tab, select XML Catalog file and click OK.

      The XML Catalog Wizard displays.

    3. Specify the name of the catalog entry file.

    4. Specify its location. In order to have Workbench read the catalog entry file, place the file in the Workbench Resources\CatalogFiles directory.

    5. Specify the base URI, that is, the path to the directory containing the DTD or Schema files. It is through this base URI that Workbench is able to find the DTDs or Schemas listed in the catalog entry file.

    6. Click Finish.

      The catalog entry file is opened in the XML Catalog Editor.

    7. Add entries as described in Using the XML Catalog Editor.

 
Top of section

Using the XML Catalog Editor

When you open a catalog entry file, Workbench displays it in the XML Catalog Editor.

The XML Catalog Editor has three views:

The Catalog View has one or more tabs:

To add a catalog entry:

You can also edit and remove entries from the catalog entry file.

CAUTION   Don't delete preexisting DTDs or Schemas from the catalog, because Workbench might require them.

To edit an entry:

To delete an entry:

 
Top of page

Using the XSL Editor

Workbench provides an XSL Editor for you to create and maintain XSL style sheets.

    For complete information about XSL, see http://www.w3.org/Style/XSL.

To create an XSL file:

  1. Select File>New.

  2. On the XML tab, select XSL file and click OK.

    Workbench generates a skeleton XSL document and displays it in the XSL Editor.

Using the XSL Editor   The XSL Editor provides an environment for editing, validating, and testing XSL files.

Task

Description

Editing

Use the XSL tab. You can use the keyboard shortcuts listed under In Source View.

Validating the style sheet

Select XSL Editor>Validate.

Workbench displays the results in the Validate tab in the Output Pane.

    For more information, see Validating an XML document.

Attaching or detaching Schemas/DTDs

Select XSL Editor>Attach Schema or DTD or XSL Editor>Detach Schema or DTD.

    For more information, see Associating Schemas and DTDs with XML documents.

Testing transformations

The Result tab allows you to see the result of the transformation specified by the XSL file:

  1. Select XSL Editor>Transform or press Ctrl+Shift+T and specify a file you want to apply the XSL style sheet to.

  2. Click the Result tab to see the result.

    Workbench displays the result of the transformation in the Edit Pane. If the transformation failed, errors are listed in the Messages tab in the Output Pane.

  3. View the result of the transformation rendered in the default browser by selecting XSL Editor>View in browser. (You can also select this menu item from the XSL tab to specify an XML file to transform and render in a browser.)

        For information about the default browser, see "General preferences" on page 14.

 
Top of page

Keyboard shortcuts

Here are the keyboard shortcuts provided in the XML Editor, XML Catalog Editor, and XSL Editor.

 
Top of section

In Tree View

Navigation and display

Keys

Description

Ctrl+A

Expands all

Ctrl+Shift+A

Collapses all

Ctrl+E

Expands element group

Ctrl+Shift+E

Collapses element group

Up Arrow

Navigates to previous visible node

Down Arrow

Navigates to next visible node

Left Arrow

Collapses element group

Right Arrow

Expands element group

Alt+Up Arrow

Navigates to previous sibling (element within an element group)

Alt+Down Arrow

Navigates to next sibling

Alt+Left Arrow

Navigates to parent

Alt+Right Arrow

Navigates to first child

Alt+Page Up

Navigates to previous cousin (element with the same element path to the root)

Alt+Page Down

Navigates to next cousin

Ctrl+Up Arrow

Hides the selected element's attributes

Ctrl+Down Arrow

Displays the selected element's attributes

Ctrl+Left Arrow

Hides the selected element's namespace declarations

Ctrl+Right Arrow

Displays the selected element's namespace declarations

Ctrl+Shift+Up Arrow

Hides the selected element's attributes and namespace declarations

Ctrl+Shift+Down Arrow

Displays the selected element's attributes and namespace declarations

Ctrl+Q

Toggles the display of attributes for all displayed elements

Ctrl+Shift+Q

Toggles the display of namespace declarations for all displayed elements

Ctrl+Alt+Shift+Q

Toggles the display of attributes and namespace declarations for all displayed elements

Ctrl+Shift+G

Displays the Schema Guide for the selected element

Searching for text

Keys

Description

Ctrl+F

Shows Find dialog

F3

Navigates to next search result

Shift+F8

Finds matching elements (displays Search Result icon, )

Alt+Shift+H

Toggles display of Search Result icon

Ctrl+Alt+Shift+H

Clears the search

F9

Finds next matching element

Shift+F9

Finds previous matching element

Editing text

Keys

Description

Ctrl+X

(Cut) Cuts the current selection to the clipboard

Ctrl+C

(Copy) Copies the current selection to the clipboard

Ctrl+V

(Paste) Pastes the contents of the clipboard at the insertion point

Ctrl+Shift+V

Pastes the contents of the clipboard as the last child of the selected element

Del

(Delete) Deletes the current selection

F5

Refreshes and collapses the tree

Ctrl+Z

Reverses editor actions (except save)

Ctrl+Y

Reverses Undo actions

Ctrl+L

Inserts new element as last child

Ctrl+T

Inserts new text as last child

Ctrl+D

Inserts new CDATA as last child

Ctrl+Shift+L

Inserts new element before selected node

Ctrl+Shift+T

Inserts new text before selected node

Ctrl+Shift+D

Inserts new CDATA before selected node

Ctrl+K

Inserts new attribute

Ctrl+Shift+K

Deletes selected attribute

Ctrl+M

Inserts new namespace declaration

Ctrl+Shift+M

Deletes selected namespace declaration

 
Top of section

In Source View

Moving the insertion point

Keys

Description

Left Arrow, Right Arrow

Moves the insertion point one character to the left or right

Ctrl+Right Arrow

Moves the insertion point one word to the right

Ctrl+Left Arrow

Moves the insertion point one word to the left

Home

Moves the insertion point to the beginning of the line

End

Moves the insertion point to the end of the line

Up Arrow

Moves the insertion point one line up

Down Arrow

Moves the insertion point one line down

Alt+Shift+T

Moves the insertion point to the top of the window

Alt+Shift+M

Moves the insertion point to the middle of the window

Alt+Shift+B

Moves the insertion point to the bottom of the window

Ctrl+Home

Moves the insertion point to the beginning of the document

Ctrl+End

Moves the insertion point to the end of the document

PgUp

Moves the insertion point one page up

PgDn

Moves the insertion point one page down

Alt+Shift+F8

Moves the insertion point to matching begin/end tag

Alt+Up Arrow

Moves the insertion point to previous sibling (element within an element group)

Alt+Down Arrow

Moves the insertion point to next sibling

Alt+Right Arrow

Moves the insertion point to first child

Alt+Left Arrow

Moves the insertion point to parent

Ctrl+G

Displays Go to Line dialog

Ctrl+L

Toggles display of line numbers

Selecting text

Keys

Description

Ctrl+A

Selects all text in the document

Shift+Right Arrow

Selects the character to the right of the insertion point

Shift+Left Arrow

Selects the character to the left of the insertion point

Alt+J

Selects the word the insertion point is on, or deselects any selected text

Ctrl+Shift+Right Arrow

Selects the word to the right

Ctrl+Shift+Left Arrow

Selects the word to the left

Shift+Home

Selects text to the beginning of the line

Shift+End

Selects text to the end of the line

Shift+Up Arrow

Selects text to the previous line

Shift+Down Arrow

Selects text to the next line

Ctrl+Shift+Home

Selects text to the beginning of the document

Ctrl+Shift+End

Selects text to the end of the document

Shift+PgUp

Selects text one page up

Shift+PgDn

Selects text one page down

Scrolling text

Keys

Description

Alt+U T

Scrolls line containing insertion point to top of window

TIP   Press and release Alt+U, then press T

Alt+U M

Scrolls line containing insertion point to middle of window

TIP   Press and release Alt+U, then press M

Alt+U B

Scrolls line containing insertion point to bottom of window

TIP   Press and release Alt+U, then press B

Ctrl+Up Arrow

Scrolls the window up without moving the insertion point

Ctrl+Down Arrow

Scrolls the window down without moving the insertion point

Modifying text

Keys

Description

INSERT

Switches between insert text and overwrite text modes

Alt+U U

Makes the selected characters or the character to the right of the insertion point uppercase

TIP   Press and release Alt+U, then press U

Alt+U L

Makes the selected characters or the character to the right of the insertion point lowercase

TIP   Press and release Alt+U, then press L

Alt+U R

Reverses the case of the selected characters or the character to the right of the insertion point

TIP   Press and release Alt+U, then press R

F11

Reformats the tag the insertion point is on

Shift+F11

Reformats the entire document

Ctrl+Alt+O

Opens the tag (for example, converts <a/> to <a></a>)

Ctrl+Alt+C

Closes the tag (for example, converts <a></a> to <a/> )

Cutting, copying, pasting, and deleting text

Keys

Description

Ctrl+Z

(Undo) Reverses (one at a time) a series of editor actions, except Save

Ctrl+Y

(Redo) Reverses (one at a time) a series of Undo commands

Ctrl+X

(Cut) Cuts the current selection and places it on the clipboard

Ctrl+C

(Copy) Copies the current selection to the clipboard

Ctrl+V

(Paste) Pastes the contents of the clipboard at the insertion point

Delete

(Delete) Deletes the current selection

Ctrl+E

Deletes the current line

Ctrl+H

Deletes the character preceding the insertion point

Ctrl+Shift+Backspace

Deletes text in the following sequence:

  1. Text preceding insertion point on same line

  2. Indentation on same line

  3. Line break

  4. Text on previous line

Ctrl+W

Deletes the current word or the word preceding the insertion point

Searching for text

Keys

Description

Ctrl+F3

Searches for the word the insertion point is in and highlights all occurrences of that word

F3

Moves the insertion point to the next occurrence of the found word

Shift+F3

Moves the insertion point to the previous occurrence of the found word

Alt+Shift+H

Toggles highlighting of words

Ctrl+F

Displays Find dialog

Ctrl+R

Displays Replace dialog

Changing indentation

Keys

Description

Tab

Shifts all text to right of insertion point to the right

Ctrl+T

Shifts text in line containing the insertion point to the right

Ctrl+D

Shifts text in line containing the insertion point to the left

Bookmarks

Keys

Description

Ctrl+F2

Sets or unsets a bookmark at current line

F2

Goes to next bookmark

Specifying transformation (XSL Editor)

Keys

Description

Ctrl+Shift+T

Displays dialog for specifying file to transform

 
Top of section

In Catalog View, XML Catalog Editor

Modifying text

Keys

Description

Ctrl+B

Displays dialog for changing the base URI, that is, the path to the directory containing the DTD or Schema files for the catalog entry file


   

Tools Guide  

Copyright © 2002, SilverStream Software, Inc. All rights reserved.