Introduction to XML

xml spy
Introduction to XML

The eXtensible Markup Language (XML) is a subset of SGML (the Structured Generalized Markup Language) that has been defined by the World Wide Web Consortium (W3C) in 1998 (see http://www.w3.org/TR/REC-xml). Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML.

The XML Spy online help and printable documentation contain a Tutorial section that give you a general overview of XML and XML Spy.

Please note that the complete XML Spy Suite documentation is available in printed form, and can be purchased from http://www.xmlspy.com/bookstore in the USA or Canada. To order from other coutries please go to the XML Spy resources page and select the specific link for your region.

To learn more about XML and its associated protocols, please also visit our list of recommended links to various XML-related information resources on the XML Spy web server.

We will take a short tour to discuss the various aspects of XML and the other related W3C standards, before explaining the various features of XML Spy that will help you make the most of XML.

If you are already familiar with XML, you may wish to skip to the Using XML Spy section.

Top Next

© 2002 Altova


Welcome to XML Spy

Welcome to XML Spy

XML Spy Suite is a comprehensive and easy-to-use product family that facilitates all aspects of XML Application Development.

The product family consists of the XML Spy Document Framework and XML Spy IDE.
XML Spy Document Framework consists of XSLT Designer and XML Spy Document Editor. Help on each member of the product family is available using the Help menu option.

XSLT Designer is a new approach to automate the writing of complex XSLT Stylesheets using an intuitive drag-and-drop user interface. XSLT Designer creates advanced electronic forms for use with XML Spy Document Editor.

XML Spy Document Editor is a word processor type editor, supporting electronic form-based data input, graphical elements, tables, as well as real-time validation using XML Schema.

XML Spy IDE is the industry-leading solution for XML-based application development, allowing easy creation and management of XML documents, XML schemas, as well as XSLT Stylesheets.

XML SPY Suite includes a Tutorial that shows you how to use XML Spy for the major aspects of XML:

· XML editing & validation
· Schema/DTD editing & validation
· XSL editing & transformation

The Reference section explains each window and menu command in detail and can easily be accessed through the Contents, Index and context-sensitive help (F1) from any menu or dialog box.

You may also want to periodically check our XML Spy web-server for news, updates, and new examples. Please note that the complete XML Spy Suite documentation is available in printed form, and can be purchased from http://www.xmlspy.com/bookstore in the USA or Canada. To order from other coutries please go to the XML Spy resources page and select the specific link for your region.

If you encounter an occasional error or, perhaps, some incomplete information in this online help or the printed documentation and you need help with XML Spy, please don't hesitate to visit our Support Center on the Internet, where you'll find additional links to the FAQ pages as well as our online Support Form. Also, please feel free to send us any feedback regarding the new documentation.

We will also be providing periodic free updates to the online help system and the printable documentation on the Download page on our web server.

Previous Top Next


What is XML

What is XML

If you are new to XML, perhaps the most confusing aspect is it's similarity to HTML, which makes XML seem familiar at first, but also tends to obscure the view for the finer details of what makes XML tick.

We will, therefore, start by looking at what XML really is and why you need XML.

The XML Specification
The W3C specification defines XML as a subset of SGML, so to properly understand XML, it is useful to take a closer look at SGML first.

SGML stands for Standard Generalized Markup Language, and was developed for large scale applications, aircraft maintenance or power plant documentation, and intended to be maintained over the long term .

The reason why XML seems to be so similar to HTML lies in the fact that HTML is defined as a subset of SGML. XML is actually a lot more similar to SGML than to HTML, because HTML is only one specific subset of SGML used to describe web pages.

As XML was created to simplify SGML, it is no wonder that the W3C has now decided to redefine HTML 4.0 as an XML application, thereby creating XHTML 1.0. But this shall be of no concern for us at the moment, because we are still faced with the fundamental question "What is XML?".

To answer this, let us define what XML is not:

· It is not a programming language.
· It is not the next generation of HTML.
· It is not a database.
· It is not specific to any horizontal or vertical market.
· It is not the solution to all your problems, but it can be a very powerful tool in building such a solution.

XML is a clearly defined way to structure, describe, and interchange data.

Data in this context really means every conceivable kind of data! You can use XML for such diverse things as describing mathematical formulas, chemical compounds, astronomical information, financial derivatives, architectural blueprints, annotating Shakespearean plays, collecting Buddhist wisdoms, or voice-processing in telephone systems!

To get a feeling for XML, let us take a look at a simple XML document:

<product>
   <name>Apple</name>
   <price>0.10</price>
</product>

The < and > angle brackets are used to distinguish between the so-called "markup" (between the brackets) and the actual data of the document (outside of the brackets).

The XML document consist of individual elements that are marked by start- and end-tags (hence the term markup). Tags contain the name of the element, so that they can be distinguished from one another more easily.

The start-tag is bracketed by < > and the end-tag by </ > - both the start- and end-tag must always occur in pairs. The example XML document contains one element called "product", which consists of two elements: "name" (which contains the data "Apple") and "price" (which contains the data "0.10"). Unlike HTML, XML does not enforce a predefined set of element names (such as "body", "h1", and "p") - you can make up your own to suit the particular needs of your data.

This simple XML document also shows a very important aspect of XML - it is "self-describing". In addition to structuring the actual data, the XML element names (sometimes also called tag names) serve to describe the information provided in the document (in our case the price of an Apple). If you compare this to the way such data is traditionally exchanged between different applications (e.g. comma-separated value or CSV files), you can easily see the benefit:

   "Apple";0.10

This is even more obvious, if you look at a slightly more complicated XML example document (as shown as in the Text View of XML Spy):

<invoice due="2000-09-22">
   <product>
      <name>Apple</name>
      <price>0.10</price>
   </product>
   <product>
      <name>Orange</name>
      <price>0.08</price>
   </product>
   <product>
      <name>Strawberries</name>
      <price>0.20</price>
   </product>
   <product>
      <name>Banana</name>
      <price>0.14</price>
   </product>
   <total currency="US$">0.52</total>
</invoice>

You can immediately see another crucial property of XML here: the elements can be nested in any way that is useful to show the semantic structure of the data contained, and elements can be repeated, if more than one item of data of the same kind needs to be listed. Our example now describes an invoice with four products and a total.

Also note that some elements contain additional information within the start-tag: attributes always have a name and a value and are written as name="value" (E.g. currency="US$"). Attributes are used to further specify additional information that augments the data of the element (in our example, the currency of the total).

A disadvantage of XML is that the bigger an XML document is, the more markup it contains. This can make it difficult to find the data contained in the document. This slight disadvantage is typically more than compensated by the flexibility of XML, and by the fact that XML is inherently suitable for reading by both humans and machines.

XML Spy offers a concise presentation of a XML document - called the Enhanced Grid View. This view allows you to see and directly manipulate elements in your XML document, such as the actual data it contains:

invoice1

This is the same XML document as show in the Text view above. The product names and respective prices are shown as columns of a table - just as you would expect to see in a grid view.

Editing in this view is infinitely more comfortable, since you can simply:
· drag & drop elements
· insert new rows
· copy/paste your data to and from other applications (e.g. Excel, etc.) and
· manipulate data in a graphical way that is not possible in views offered by other products

You now have a first impression of an XML document and have learned about the two most important features of XML: elements and attributes. We will explain the other concepts of XML in the tutorial when we look at the specific features offered by XML Spy.

Before we continue, let us first consider the ever-important "why" question...


Why XML

Why XML

The reasons for using XML typically are as diverse as the different forms of data that exist today. We will, therefore, not consider specific benefits for certain vertical markets - such as engineering, e-commerce, mathematics, or others - but will instead try to focus on several individual properties of XML that are of universal advantage to all applications.

XML is easily readable by both humans and machines
Until now, most formats for storing data were either suitable for interpretation by software programs (e.g. dBase, GIF, etc.), or human readable (text or CSV files) - but not both.

XML defines a set of rules that make interpretation by computer very simple. It thus satisfies both needs, because XML documents remain text-based and can still be easily manipulated by a human being.

XML is object-oriented
While the relational data model is very successful for processing large amounts of table-like data, manipulation of other kinds of data - such as hypertext (i.e. text plus hyperlinks), multimedia, graphics, mathematical or chemical formulas, hierarchical information - are not so straightforward.

In contrast, XML is object-oriented in the sense of being suitable for describing objects of the real world or any abstract problem domain by modeling their properties as they are, instead of enforcing a normalized decomposition into various tables linked by relations. This makes XML documents more intuitively understandable and thereby reduces both the time required to design and implement computing systems based on XML.

XML is being widely adopted by the computer industry
One key factor in the success of the Internet was the wide adoption of the TCP/IP protocol suite by many corporations. This resulted in huge sales volumes and consequently ever decreasing prices for all network components used.

XML is widely accepted and implemented by many vendors, this fact will result in higher volumes and lower prices for software components. This is why XML's predecessor, SGML, was never successful on a broad scale. SGML products were typically priced in the ten-thousand dollar range, whereas XML products are today priced in the hundreds.

XML is global
To better understand the attention that XML has received, it is useful to recall another widely-adopted data standard that everybody takes for granted today: ASCII, the American Standard Code for Information Interchange.

While ASCII was restricted to a certain alphabet and writing system, it was still crucial in allowing different computer types and operating systems to freely exchange data. With the adoption of Unicode 1.0 and its continuing evolution. The idea of ASCII was expanded to encompass all languages and writing systems of the world.

Today, it is taken for granted that computers are capable of reading and processing text documents based on ASCII or Unicode. XML takes this approach one step further, by building on Unicode and defining a universal way to describe structured data for all different purposes.

All XML documents are per definition Unicode-based, but may be stored on disk or transmitted over the network in various different "encodings", such as ISO-8859-1 or UTF-8 . This is, why some people today call XML the "ASCII of the future".

Now that we have investigated some of the reasons why XML makes sense, we will turn to the XML "Acronym Puzzle".


The XML Standards Puzzle

The XML Standards Puzzle

In addition to XML, you will also encounter one or more of the following standards or acronyms closely associated with XML:

DTD
The "Document Type Definition" is a part of the original XML 1.0 specification that allows a developer, or standards body, to specify what elements and attributes may be used in a particular type of XML document and what their structure and nesting may be. This is also called the content model or schema of an XML document.

If an XML document conforms with the content model defined by a DTD, it is said to be valid with respect to that DTD.

XSLT
The "eXtensible Stylesheet Language Transformation" is a programming language that allows XML documents to be transformed from one schema to another or into entirely different forms, such as HTML pages, WML cards, or PDF files.

XPath
The "XML Path Language" is a language for addressing and querying the content of XML documents.

XPointer
The "XML Pointer Language" is a companion standard to Xlink and describes mechanisms for addressing particular parts of a document.

XML Schema
The "XML Schema" is an ongoing effort by the W3C to supplant DTDs with a more flexible and powerful system to describe the structure of conforming XML documents, including provisions for defining datatypes.

XHTML
The "Extensible HyperText Markup Language" is the reformulation of HTML 4.0 based upon XML and will soon supplant HTML as the de-facto standard of the Internet.

WML
The "Wireless Markup Language" is used for WAP phone systems to enable a mobile Internet environment and is entirely based on XML - it is described by one particular DTD, which is part of the WML specification.

SVG
Scalable Vector Graphics. SVG is an XML application used to describe 2D vector graphics, text and raster images. This enables vector graphics to be defined solely in XML.

SMIL
The "Synchronized Media Integration Language" is a XML document type designed to describe multimedia presentations.

DOM
The "Document Object Model" describes how some XML parsers return the information contained in an XML document. The elements of the XML document are described as nodes of a tree that can be traversed by a programmer.

SAX
The "Simple API for XML" provides another programming model used by some parsers, which is based on events instead of a traversable tree.

This list does not attempt to be a complete list of all XML-based standards, as there are new proposals emerging on an almost daily basis and many standards are very specific to a certain market or problem domain. Please feel free to visit our XML Spy Home Page to learn about recommended links, news, and other XML related information.


XML Spy user interface

XML Spy user interface

This screen shot shows the XML Spy application window.

The Enhanced Grid View [image] is enabled, and the Altova.xml file is the active document.

The Database/Table view has been activated for the Division element. This view is available wherever the Enhanced Grid view can be activated, and can be used when editing any type of XML file - XML, XSD, XSL etc.
Clicking the "Display as Table" icon, [image] activates the Database/Table view.


XML Editing

XML Editing

This screen shot shows the main window containing a XML document, and the same document in Browser view.
Click on the Browser view icon, [image] to open the Browser view of an XML Document.

For the Browser view to display/render a XML document correctly:
· The XML Document must contain a reference to a XSL stylesheet, or
· A XSL Stylesheet has to be assigned to the to the XML folder or project.


Schema Editing

Schema Editing

This screen shot shows the main window containing an XML Schema document (XSDL - XML Schema Definition Language).
Click on the Schema Design View icon [image] to open Schema Overview. The main window then displays all Global "definitions" (elements, complex types etc.) in list form.

To see the content model in graphical form:
1. Click on the [image] icon next to the definition you want to display.
The content model for that component appears in a tree view.

To return to the Schema overview:
· Click the "Show Globals" icon [image] to return to the Schema Overview.
· Select the menu option Schema design | Display All Globals to return to the Display All Globals view.


XSL Editing

XSL Editing

This screen shot shows the main window containing a XSL (eXtensible Stylesheet Language) document, in Text view.

Clicking on the Enhanced Grid View icon, [image] displays the same XSL document in grid form.


Project Management

Project Management

XML Spy uses the familiar tree view display to manage your XML projects.

Project folders allow you to:
· Group XML files by their extension
· Assign XSL transformation parameters to specific folders, enabling you to view XML documents with "default" stylesheets
· Validate XML files by assigning DTDs or Schemas to specific folders.


User Reference

User Reference

The reference section contains a complete description of all XML Spy windows and menu commands and explains their use in general.

We've tried to make this user manual as comprehensive as possible. If you have questions which are not covered by this documentation and you are a registered user, please don't hesitate to contact us through the Support Center on the XML Spy web site.


Windows

Windows

The XML Spy user interface provides several windows that show both your document, project and intelligent editing "entry-helper" windows, that can be freely arranged to suit your personal working style.

The central area shows the main window, where you edit (and view) your XML, XML Schema, or XSL documents in the Enhanced Grid view, Schema view, Text view, Document Editor view, embedded Database/table view, or Browser view.

The left area contains the project and info windows; the right area contains the entry helpers for intelligent editing of elements, attributes, and entities.


Main Window

Main Window

The Main Window is where you view and edit all documents in XML Spy. XML Spy allows you to open any number of XML documents simultaneously. To switch between them click on the any part of the window you wish to bring to the front.

You can also use the commands on the Window menu to organize your windows. If your windows are maximized, XML Spy also provides tabs, letting you switch between all open windows. Keyboard equivalents are: CTRL+TAB and CTRL+F6.

Right click on a tab, opens the context-menu enabling you to perform various functions on that XML document. (e.g. print, close, mail etc.).

XML Spy provides advanced views on your documents:
· An Enhanced Grid View for structured editing
· An embedded Database/Table view, available from within the Enhanced Grid view, that shows repeated elements in a tabular fashion
· A Schema Design View for viewing and editing XML Schemas
· A Text View with syntax-coloring for source-level work,
· A Document Editor view allowing you to edit XML documents based on templates created in XSLT Designer, and
· An integrated Browser View that supports both CSS and XSL style-sheets.

To switch any main window between the different views, use the commands on the View menu or the corresponding toolbar buttons.

Please note:
You can set your personal default viewing preferences on a per-file-type basis in the File Types tab on the Tools | Options dialog. Select the menu option Tools | Options to open this dialog box.


Enhanced Grid View

Enhanced Grid View

Click the Enhanced Grid View icon [image] to open this view.

The Enhanced Grid View is the core presentation and editing view of XML Spy. It shows the hierarchical structure of any XML-compliant document through a set of nested containers, that can be easily expanded and collapsed to get a clear picture of the document's structure.

All items contained in an XML document are displayed in a structured way that allows for easy manipulation of contents and structure at the same time.

An hierarchical item (such as the XML declaration, document type declaration, or any element that contains child elements) is represented with a gray side bar and a tiny arrow. Clicking the side bar expands or collapses the item.

Please note:
An element is denoted with the [image] icon, eg. header
An attribute is denoted with the [image] icon, eg. style

Display & Navigating
The contents of an hierarchical item depend on its kind and - in the case of elements - mostly consists of attributes, character data, comments and child elements.

Element and Attribute order
To emphasize the strong coupling between attributes and the respective parent element, attributes are always listed first and cannot be preceded by comments, character data or child elements. The order of the individual attributes is, however, preserved from the input file and can be modified if necessary.

Following the attributes, the remaining items within an element appear exactly in the order found in the source file, and can be rearranged without restriction using drag & drop.

Elements and character data
If an element contains only character data, the data will be shown in the same line as the element and the element will not be considered hierarchical by nature. The character data for any other element will be shown indented with the attributes and potential child elements and will be labeled as "Text".

If an element is collapsed, its attributes can be shown in the same line in a different color. This attribute preview is especially helpful, when editing XML documents that contain a huge number of elements of the same kind that only differ by their contents and attributes (e.g. database-like applications).

Customizing the grid view
The grid view can easily be customized using the mouse to adjust column widths.

To resize a column to the width of its largest entry:
1. Double-click on the grid line to the right of that column.

To adjust the column widths to display all content:
1. Select the menu item View | Optimal widths command, or click on the Optimal widths icon [image].

The heights of the cells are generally determined by their contents and can only be adjusted by the user using the menu option Tools | Options| View tab | Enhanced Grid view, "Limit cell height to xx lines".

You can also use the keyboard to navigate an XML document in the Enhanced Grid View.
· The arrow keys move the selection bar in the tree and grid views
· the + and - keys on the numeric keypad allow you to expand and collapse items.

Please note:
You can activate the Text view icon at any time, to see marked data in the source file for example.

Embedded Database/Table view
XML Spy allows you to display recurring elements in a Database/Table view. This function is available wherever the Enhanced Grid view can be activated, and can be used when editing any type of XML file - XML, XSD, XSL etc.

Intelligent editing
When editing an XML document based on a DTD or Schema, the Enhanced Grid View provides many Intelligent Editing features based on the information gathered from the Schema or DTD.

Whenever editing the name of an element or attribute, a popup menu opens. The options available depend on the position of the element and the content model defined by the Schema or DTD. A similar popup is displayed, if the contents of an element or attribute are restricted by an enumeration or choice of some sort.

To edit an element or attribute name:
1. Double click on the element name.
2. Edit the name (XML Spy chooses the best match from the menu).
3. Accept the selection by hitting the Return key (Esc. abandons the change).

To insert or append elements or attribute names:
1. Click on the respective icon in the Attr. & Element toolbar, or

2. Double click on an element or attribute name in one of the Entry Helpers.

You will notice that the various Entry Helpers are constantly updated depending on the current selection in the Enhanced Grid View. The Info Window constantly shows important information regarding the selected element or attribute.

Enhanced Grid View context menu
In addition to the commands available through menus and toolbars, the Enhanced Grid View also provides a context-menu, activated by the right mouse-button. It contains the most useful commands in one convenient place:

Enhanced Grid View context menu:


Database/Table View

Database/Table View

Having clicked the Enhanced Grid View icon, [image] click on the "Display as Table" icon [image].

The Database/Table View is integrated into the Enhanced Grid View, and allows you to view recurring elements in grid or compressed into table form. The Database /Table view is available wherever the Enhanced Grid view can be activated, and can be used when editing any type of XML file - XML, XSD, XSL etc.

You can switch between both views, grid and table, by clicking the "Display as Table" icon or pressing the F9 hotkey.

Editing in the table view supports drag&drop and intelligent editing functions. You can also use table-specific commands to sort elements or insert new rows.

XML documents often contain sequences of repeating elements of the same kind. XML Spy automatically detects such sequences and rearranges the presentation to show these elements in a tabular fashion - common to database- or spreadsheet-like applications.

XML Spy achieves this database/table view by taking the respective attributes and sub-elements of the repeating element, and showing them as columns of the table.

To display recurring elements in a table view:
1. Click on the recurring element in the Enhanced Grid View (flag, in this example).
The "Display as table" icon is now active.

2. Click the "Display as table" icon [image] to activate the Table View, or select the menu option XML | Table | Display as Table. The keyboard shortcut for this function is F9.

The nine "flag" elements are displayed in table form. Click in a cell to demark the table.

To return to the grid view, from the table view:
1. Click on the table "name" (flag (9) in this eg.). This selects the whole table.
2. Click the "Display as Table" icon, to deactivate the Table view and return to the Grid view.

Manipulating table data:
· Drag and drop column headers to move columns
· Sort column data using the menu command XML | Table | Ascending Sort
· Append (or insert) rows using the menu command XML | Table | Insert Row.

Exchanging data from the Database/Table view
To exchange with other applications, select elements in this table and use the copy as structured text option to copy/paste them directly into Excel for example. Data exchange works in both ways. You can therefore copy data from any spreadsheet-like application and insert it directly into XML Spy.

For more complex data exchange tasks, XML Spy also offers a set of unique conversion functions that let you directly import or export XML data from any text file, Word document or database.


Schema Design View

Schema Design View

This is the default view when you double click an .XSD file.
Click the Schema Design view icon, [image] to display W3C conformant schemas.

A Schema is a model describing the structure of information. A Schema in XML, describes the possible arrangement of tags and text in a valid document. The purpose of a schema is to allow machine validation of document structure, to enable large volume XML transactions over the web.

Schemas are defined in terms of constraints:
· The content model constraint, describes order and sequence of elements
· The datatype constraint, defines the valid units of data in the content model

Instead of using the syntax of XML 1.0 DTD declarations, schema definitions use XML element syntax. A correct XML schema definition is, therefore, a well-formed XML document.

XML Spy features:
· Supports the Final XML Schema Recommendation of May 2nd 2001, and the ability to convert schemas from the April 7th 2000 Working Draft, or Oct. 24th Candidate Recommendation to the Final Recommendation.
· Generation of DTD/Schema from an XML document
· Conversion of DTD/Schema to different Schema flavors (DTD, DCD, XML-Data, BizTalk, W3C-Schema)
· Generation of XML Schema documentation in Word or HTML format

Viewing and editing XML Schema documents
XML Spy Schema editor allows you to view and edit schemas in two different ways:
· As a Schema overview, in list form
· In a graphical view of specific schema components

Schema overview
Open a XSD document in the DTD/Schemas folder of the project window, or double click on an XSD document in Explorer. The main window then displays the Schema overview.

The top window displays all Global "definitions" (elements, complex types etc.) in list form. The bottom window displays the corresponding attributes of the currently selected component (eg. Mgr. Prg etc.).

Content model
The content model is a graphical representation of a component. The tree structure as well as annotations etc. are shown for each element. This view supports drag and drop. Configure this view by selecting the menu option Schema design | View config.

To see graphical representation (Content model) of a component:
· Click on the [image] icon next to the component you want to display, or
· Select the menu option Schema design | Display Diagram, or
· Double click on a component name in the "Component Navigator" (Top right entry helper).

The content model for that component, appears in a tree view.

To return to the Schema overview:
· Click the "Show Globals" icon [image] to return to the Schema Overview.
· Select the menu option Schema design | Display All Globals.

To append or insert Components:
1. Click the Append [image] or Insert [image] icon at the top left of the component window.
2. Select the component you want to append from the popup.

To append or insert Attributes to a component:
1. Click the Append [image] or Insert [image] icon at the top left of the attribute window.
2. Select the attribute you want to append/insert from the popup.


Schema design content model

Schema design content model

The content model view, enables you to directly manipulate the symbols depicting your schema. You can insert or append elements, as well as change their parameters directly.

Element Symbols

Mandatory single element. Details: MinOcc=1, MaxOcc=1

Mandatory single element, containing Parsed Character Data (#PC-Data).
The content may be simple content or mixed complex content.
Details: MinOcc=1, MaxOcc=1, type=xsd:string, content=simple.

Single optional element. Details: MinOcc=0, MaxOcc=1
The context menu option Optional, converts a mandatory element into an optional one.

Mandatory multiple element. Details MinOcc=1, MaxOcc=5.

Mandatory multiple element containing child elements.
Details: MinOcc=1, MaxOcc=unbounded, type=DivisionType, content=complex.
The context menu option Unbounded, changes the max. occurrence of an element to unbounded.

Clicking on the + character of the element expands the tree view and shows the child elements.

Group element. Details: name=Subsidiaries.
A named collection of elements to allow reuse in the construction of different complex types.

"Any" can be a placeholder for any element from a certain namespace.

Please note:
To display the definition of any element, hold down the CTRL key, and double click on the element you want to see the definition of.

To add / insert / append, elements or child elements:
1. Click right on the element (or "model type" symbol), to open the context menu.
2. Select the operation you want to carry out from the menu.

Please note:
Only those operations that are possible with the element, appear in the context menu. Invalid operations are grayed out in the context menu and cannot be selected.

Simple types:
A "simple type" element, is defined as a datatype that only contains values and no element or attributes. The element type is usually prefixed by the namespace prefix xsd: string, indicating that it is a predefined XML Schema datatype.

Details: name=Name, type=xsd:string, content=simple.

Complex types:
"Complex type" is a datatype which may contain attributes, elements and text.
Adding sub elements to an element, automatically defines the element with the content model as complex (Details entry helper content=complex.). Click on the "Com" tab of the component navigator, to see the complex types.

XML Spy displays references to "external" complex types with a yellow background. In the example below, the Person element references the PersonType complex element.

To view the referenced complex type element:
1. Double click the complex type name in the yellow box (here, PersonType), or
2. Click on the "Com" tab of the Component Navigator, and double click on the PersonType entry.

The PersonType element definition, appears in the main window.


Schema, Content model

Schema, Content model

XML Spy enables you to define your content model with a few mouse clicks. All element types and methods of combining them can be defined in the content model.

Compositors
A "Compositor" defines an ordered sequence of sub elements (child elements).

To insert a compositor:
1. Click right on the element you want to add sub elements to.
2. Select Add Child | Sequence (Choice or All).
3. Click right on the compositor symbol and select Add Child | Element, to add further sub elements.

Sequence:

Choice:

All:

To change the compositor (model)
1. Click right on the compositor.
2. Select Change Model | Sequence (Choice or All).

Global components
There are two methods of defining global components: creating a new component from scratch, or changing an existing element into global component.

To create a global component from scratch:
1. Click the Insert / Append icon in the Schema Overview, and select the type of component you want (Element, Group, SimpleType, ComplexType etc.)
2. Enter the name of the component in the global list, and confirm with OK.

The global component appears in the respective tab (Elm, Grp, Com, Sim etc.) of the Component navigator. Double clicking on the component, displays the tree view of that component in the main window.

Please note:
You can create a global element while viewing a component in the content model. Click right in the main window, and select the option New Global | Element.

To delete a global component:
1. Switch to the Schema global overview, select the component and hit the delete key, or
2. Click the Delete icon [image] of the component window.

To change an element into a global component:
1. Click right on the element and select Make Global | Element.

If the element is a complex type, then the option Make Global | Complex type becomes available.

References to global components
A reference to a global component can be created in two ways:
· You add a component to a schema which has the same name as an existing global component. This causes a dialog box to appear, prompting you if you want to reference the element to it. Confirming with OK, references the component to the component definition.
· You right click an element and select the option Reference from the context menu.

In both cases, a link icon appears at the bottom left of the element symbol [image] and check box "isRef" is set active in the Details entry helper.

Please note:
If you create a reference to a component that does not exist, the element name appears in red as a warning that there is no definition to refer to.

To view the definition of an element:
· Use the Hotkey CTRL+Double click on an element.
The element definition appears, along with the corresponding info in the details window, or
· Right click the element and select Go to Definition from the context menu.

To edit the name of an element:
1. Right click the element
2. Select the context menu option Edit | Name and edit the name. (Double clicking the element name, also enables you to edit the name.)

To edit the annotation of an element:
1. Right click the element.
2. Select the context menu option Edit Annotation. (Double clicking the element annotation, also enables you to edit the annotation.)

To edit (or create) appinfo for an element:
1. Right click the element.
2. Select the context menu option Whole Annotation Data.
This opens the Annotation dialog box. If an element contains annotation text, then a row is visible when the dialog box is opened. The annotation type "doc", is displayed in the Kind column and the annotation text is visible in the Content text box.

3. Click the append [image] or insert icon at the top left, to insert a new line. This automatically inserts a new "doc" line.
4. Click the drop down arrow next to the new doc line, and select "app".
5. Double click in the Source column to enter a URI, it is not mandatory that you enter one however.
6. Enter the appinfo content text, in the Content text box.

Configuring the content model view
· Select the menu command Schema design | View config.

This command allows you to configure the content model view. The dialog box opens at the bottom right of the XML Spy window, giving you room to see changes reflected in the content model immediately. The settings you define here, apply to the schema documentation output as well the printer output.

Changing element parameters/values directly in the content model
· Double click the cell of the element (table) you want to edit and start entering data. If a selection is possible, a drop down list appears if not, enter the parameter or value and confirm the entry with the Return key.

The entry helpers will be updated at this point, reflecting the data you entered.

Documenting the content model
· Select the menu command Schema design | Generate documentation.

This command generates detailed documentation about your schema. Documentation is generated for each element using the settings you define in the dialog box. Related elements (child elements, complex types etc.) are hyperlinked, enabling you to navigate from element to element.


Text View

Text View

Click the Text view icon, [image] to open this view.

When it comes down to low-level work, the text view of XML Spy is ideally suited for XML editing in its textual or source form.

The text view can be used to edit any kind of text file (even non-XML conforming documents) and offers customizable syntax-coloring (including the ability to highlight server-side VBScript or JScript code in ASP pages) as well as an automatic display of the current line and character position in the status bar.

You can use the Find and Replace commands to quickly locate or change any information, and XML Spy offers unlimited levels of Undo and Redo for all your editing operations.

Intelligent Editing
If you are working with an XML document based on a DTD or XML Schema, XML Spy provides you with various intelligent editing capabilities.

1. Type the "<" less-than character at the position you want to insert an XML element, attribute, or attribute value.
This opens a popup list.
2. Enter the first few characters of the item you want to insert.
An item containing those characters is highlighted.

3. Click on the entry with the mouse pointer, or
Use the arrow keys to highlight your selection and
4. Hit the Return or Space key to accept the selected choice and close the popup window.

Please note:
The popup window also appears when you edit elements or attributes in Text view. If a specific attribute is defined to follow an element, a popup window containing all valid attributes will also appear.
Eg.

Auto-completion
Editing in the text view can easily result in unbalanced brackets, elements that are not closed properly, or other violations of the well-formedness principle.

XML Spy automatically completes elements as well as inserting all required attributes as soon as you finish entering the element name on your keyboard. The cursor is automatically positioned between the start and end tags of the element, so that you can immediately continue to add child elements or contents:

Use the Check well-formedness command at any time to ensure that the document meets the XML 1.0 Specification criteria for well-formedness. This check is also automatically performed every time you open or save a document.

Mouse & Context-Menu
You can also use the mouse during editing in the Text View. If you select text, you can either use drag&drop to move the text block to a new location, or you can use the context-menu on the right mouse button, to directly access frequently used editing commands - such as Cut, Copy, Paste, Delete, Send by Mail, and Go to line/char:

While most customers prefer the Enhanced Grid or Database/Table view for every-day work on XML data files, the text view can occasionally be very handy when editing XSL files or if you are using Active Server Pages (ASP) or any other non-XML files for your web application.


Document Editor view

Document Editor view

Click the Document Editor icon, [image] to open this view.

XML Spy Document Editor enables you to edit XML documents based on templates created in XSLT Designer! The templates in XSLT Designer are saved as *.sps files, and supply all the necessary information needed by Document Editor.

Templates are opened by Selecting the File | New command and then clicking the "Select a Document Editor template..." button. Please see the Document Editor documentation for further information.

Document Editor features:
· Free-flow WYSIWYG text editing
· Form-based data input
· Presentation and editing of repeating XML elements as tables
· Real-time validation, and consistency checking using XML Schema
· Support for CALS and HTML tables

XML Spy Document Editor is available in three versions: As a stand-alone application, integrated as a separate view within the XML Spy IDE user-interface (if you purchase the XML Spy Suite product), or as a Browser Plug-In for Internet Explorer.

Document Editor has two main areas: the main window, and the entry helpers at right. The graphic below shows the OrgChart template with all the markup info hidden.

· The main window allows you to display the document in several different views: the Document Editor view which is the default view for this type of document template, the Enhanced Grid view or Text view. The Enhanced Grid view incorporates a special view, called the Database/Table view, which collapses recurring XML data into table form.

· The right area contains three Entry helper windows, which allow you to insert specific elements (or attributes) depending on the current cursor position in the document.

Example of a partially filled in Orgchart template document.


Browser View

Browser View

Click the Browser View icon, [image] to open this view.

The Browser view requires Microsoft Internet Explorer 5, and we highly recommend you to also download the MSXML4 if you intend to work with XSLT in XML Spy, as MSXML4 already supports most of the W3C XSLT Recommendation. Please see our Download Center for more details.

Use the integrated browser view of XML Spy to preview any XML file with an XSL stylesheet, or view the output from an XSLT transformation to HTML.

Displaying source code and Browser views:
If you are using XML Spy for XHTML editing or if you have an XSL stylesheet associated with your XML document, you can display the browser view in a separate window.

This allows you to take a look at the document source in the Enhanced Grid or Text views and have the browser preview side-by-side, so that it can easily be refreshed directly from the editing view (just hit F5 in the editing view and the browser view is automatically updated).

The browser view also supports find and printing functions for when you want to document XML files that use CSS or XSL style-sheets, and offers the typical browser commands from both the Browser menu and toolbar: Back, Forward, Stop, Refresh.


Project Window

Project Window

XML Spy uses the familiar tree view to manage multiple files or URLs in XML projects. Files and URLs can be grouped into folders by common extension or any arbitrary criteria to allow easy structuring and batch manipulation.

Folders can correspond to physical directories on your file system, or you can define file-type extensions for each folder to keep common files in one convenient place.

Project folders are "semantic" folders, that represent a logical grouping of files and do not necessarily need to correspond to any hierarchical organization of the files on your hard disk into several directories.

Assigning XSL transformations to project folders
You can assign different XSL transformation parameters to each folder and even have the same physical file present in more than one project folder - this is especially useful when you want to keep your data in one XML file and use different XSL stylesheets to produce different output (e.g. separate HTML and WML presentations).

The menu option XSL | Assign XSL, can only be selected when you are in the Enhanced Grid view.

Assigning DTDs / Schemas to project folders
You can assign different DTDs or Schemas to different folders. This allows you to validate a file against both a DTD and an XML Schema without changing the file itself, which is useful when you are in the process of making the transition from DTDs to Schemas.

The menu option DTD/Schema | Assign DTD (Assign Schema), can only be selected when you are in the Enhanced Grid view.

Use the commands on the Project menu to manage your projects.


Entry Helper Windows

Entry Helper Windows

XML Spy helps you create valid XML documents by providing three palette-like windows that we call "entry helpers".

When you are working on an XML document based on a DTD or Schema, the built-in Intelligent Editing module constantly displays information on elements, attributes, and entities that can be inserted at the current cursor position, based on the information gathered from the Schema or DTD content model.


Element Entry-Helper

Element Entry-Helper

The element entry helper, allows you to insert a new element into your document by showing what elements are permissible at the current location.

You can choose to append an element, insert it before the selected element or add a child-element to the currently selected element. Depending on this context, the entry helper will automatically adjust its list of available choices.

Mandatory elements are automatically highlighted by an exclamation mark "!"

Elements that are allowed within the current parent element, but not at the position of the current selection, are shown in gray.

To insert an element:
· Double-click on the desired item.
The corresponding element is inserted into the XML document, and the entry helper is automatically updated to reflect your new options.

Should you create a sequence of elements that violate the content model specified by your schema or DTD, the built-in incremental validating parser automatically detects this violation and displays its error message directly in the entry helper window.

In the Schema Design View, this window is called the Component Navigator, and displays information on Global Components: elements, groups, complex types, simple types, attributes and attribute groups.

To display the content model of a component:
· Click the component type tab (Elm, Grp. etc.), and
· Double click on the desired component, in the respective tab.

The content model appears in the main window as a graphic.


Attribute Entry-Helper

Attribute Entry-Helper

A list of available attributes for the element you are currently editing, are shown in the second palette-window and offer the same functionality as the element entry helper.

Mandatory attributes are automatically highlighted by an exclamation mark "!"

Existing attributes that cannot be added to the current element a second time - are shown in gray.

In the Schema Design View, this window is called Details, and displays information on the currently selected element of the content model.

To change content model parameters:
1. Use the combo boxes to select different parameters, or
2. Double click into the respective row, and edit/enter text directly.


Entity Entry-Helper

Entity Entry-Helper

The entity entry helper presents a list of defined entities or parameter entities that you can insert within your document.

In the Schema Design View, this window displays further information on the currently selected element of the content model.

To change these content model parameters:
1. Use the combo boxes to select different parameters, or
2. Double click into the respective row, and edit/enter text directly


Info Window

Info Window

In addition to the entry helper windows, XML Spy provides a handy information window that shows the detailed information about the attribute or element that you are working on.

This information is available in all three editing views and can be a tremendous help in conjunction with the xsd:annotation feature of the new XML Schema draft, which allows a schema author to include comments or documentation on the use of each individual element or attribute into the schema itself.


Menus

Menus

XML Spy supports all standard Windows commands on the File and Edit menus to enable the user to quickly exploit all capabilities of the program.

Wherever appropriate, additional commands have been added to support special XML- or Internet-related features (e.g. such as opening documents directly from an URL).

In addition to the standard menus, XML Spy contains many XML-specific menus that cover the different aspects of XML editing tasks.


File Menu

File Menu

The File menu contains all commands relevant to manipulating files with XML Spy, in the order common to most Windows software products.

In addition to the standard New, Open, Save, Print, Print Setup, and Exit commands, XML Spy offers special commands:
· open a document directly from a URL
· reload a file that may have changed
· switch the character-set encoding used by a file, and
· send a file by e-mail (only available, if a MAPI-compliant mail system, such as Microsoft Outlook, is installed).
· save file to URL


New...

New...

The "New..." command is used to create a new document with XML Spy. You are presented a list of predefined document types that you can create:

Since XML is such a versatile and universal concept, there are many different kinds of XML documents that you can create and edit with XML Spy.

Creating files not available in the "Create new document" dialog box
If the document you want to create is not listed, simply select ".xml" and change the file extension when you save the file. You can also add new file types to this list using the Tools | Options | File types tab.

Creating new templates
You can create your own templates which will then appear in the "Create new document" dialog box when you select the File | New command.

1. Use MS Explorer or any other text editor to open one of the new.xxx template files in the ..\Altova\XML SPY Suite\Template folder. This file will act as the basis for your new XML template.
2. Make the necessary changes, declarations etc., to new template file.
3. Use Save as... option to save the file using the convention, Anyname.XXX
Anyname is the name of your personal template (e.g my-xml).
.XXX is the extension it should appear under in the dialog box (e.g. .XML). You can enter any type of XML extension here (.vml, .math etc.!)
4. Select File | New to select your new XML template.

Please note:
To delete a template, delete the template file you created.

Assigning a DTD / Schema to a new XML document
XML Spy contains built-in templates for most XML-based document types and automatically provides you with a meaningful starting point instead of a totally empty file (e.g. a ".xhtml" file automatically includes the correct DOCTYPE reference to the XHTML DTD as well as an empty <html> element to start with).

The predefined templates are placed in the \Template directory, automatically created one level below the XML Spy installation directory. You can only assign a DTC/Schema to a document from within the Enhanced Grid view.

If you select the ".xml XML Document" entry, (typically a new XML instance document) in the above dialog box, XML Spy prompts you for a DTD or Schema for the new file to be based upon:

To create an empty XML document:
· Select the File | New menu entry, and
· Click the "Cancel" button in the New file dialog box, which prompts for a DTD/Schema.

Defining the root element
If you want to assign a DTD / Schema and the content model of the Schema or DTD contains more than one potential root element candidate, XML Spy asks you to select a root element from the list of possible candidates:

The new document is created with this element as its document root.


Open...

Open...

The "Open..." command opens any XML-related document or text file from your PC. The familiar Windows "Open" dialog box appears and allows you to select one or more files.

Use the "Files of type" combo box to select which kind of files you want to be displayed in the dialog box (the list of available file types can be configured through the File Types tab on the Tools | Options dialog).

After the file has been read into memory, the character-set encoding used within the file will be auto-detected by XML Spy and the file decoded accordingly.
If the character-set used to encode the file, differs from the encoding-specification in the XML-declaration in the prolog, an error message is displayed and the file is automatically opened using the correct encoding.

Auto-checks on opening
You may get an error message if your file is either not well-formed or invalid, and you have selected to perform automatic validation upon opening.

In this case the document will be opened in the appropriate view, an error message popup will be displayed with the details about the error detected, and the offending item will be highlighted in the window.
In such a case simply fix the error and click on the [image] or [image] button to continue opening the file.

Opening Unicode files
If you are using the Windows 95/98 version of XML Spy and have chosen to open a Unicode file, XML Spy converts the file to a Windows 98 code-page to be used for viewing and editing, as Windows 95/98 do not support Unicode on the operating system layer (for further information please see the Unicode chapter in the background information section). The conversion is done automatically according to the settings you provide in the "Encoding" tab of the Tools | Options dialog.


Open URL...

Open URL...

The "Open URL..." command allows you to open non-local files from a URL (uniform resource locator) using http and WebDAV.

To open an URL address:
1. Enter the URL you want to access, in the "Server URL" field.
2. Enter your User-ID in the User and Password fields, if the server is password protected.
3. Click the Browse button to view and navigate the directory structure of the server.

4. Click the file you want to load into XML Spy.

The file URL appears in the "File URL" field. The OK button only becomes active at this point.
5. Click the OK button to load the file into XML Spy.
The file you open appears in the main window.

The Browse function is only available on servers which support the following protocols:
· FTP
· HTTP and HTTPS, if the server supports WebDAV
· or servers supporting WebDAV

File load:
To give you more control over the loading process, you can choose to load the file through the local cache or a proxy server (which considerably speeds up the process, if the file has been loaded before).

To reload the file anew in every case, select the Reload radio button - when you are working with an electronic publishing or database system for example, and wish to view the live output using XML Spy.

Repositories
Repositories supported by XML Spy come in three flavors:
· Generic version control systems, such as Microsoft Visual Source-Safe (or compatible products)
· Generic web servers, such as FTP or WebDAV servers; and
· Specialized XML or schema repositories, such as Tamino, TEXTML Server, Virtuoso, or XML Canon.

XML Spy currently supports Source-Safe, FTP and WebDAV servers, as well as Virtuoso through WebDAV. Other repository interfaces will be available in future versions.


Reload

Reload

The Reload command allows you to reload documents from the URL.

XML Spy automatically monitors all open files (on the local network) for changes made by other programs (or people), and automatically prompts you to reload such a file, if you have checked the corresponding box on the File tab of the Tools | Options dialog.

This option is useful for documents that you open through a URL, which are dynamically created. This command is rarely used when working on documents that are accessed as files on your local hard disk or through a network file server.


Encoding...

Encoding...

The "Encoding..." command lets you view the current encoding of a file and select a different encoding when saving the current document the next time.

If you select a different encoding than the one in use before, the encoding-specification in the XML-declaration in the prolog will be adjusted accordingly. For 16-bit and 32-bit per character encodings (UTF-16, UCS-2, and UCS-4) you can also specify the byte-order to be used for the file.

You can also enter the new encoding into the encoding-specification of the XML-declaration. When saving a document, XML Spy automatically checks the encoding-specification and opens a dialog box if it cannot recognize the encoding name entered by the user.

If your document contains characters that cannot be represented in the selected encoding, you will get a warning message as soon as you save your file.


Close

Close

The "Close" command closes the active document window. If the file was modified (the file name is appended with an asterisk "*" in the title bar ), you will be asked if you wish to save the file first.


Close All

Close All

The "Close All" command closes all open document windows. If any document has been modified (asterisk "*" appended to the file name in the title bar), you will be asked if you wish to save the file first.


Save

Save

The "Save" command saves the contents of the active document to the file it has been opened from.

When saving a document in XML Spy, the file is automatically checked for well-formedness. All XML documents must be well-formed - otherwise they could not be interpreted by any other XML application. The XML-Declaration is also checked for an encoding specification and it is applied to the document when the file is saved.

You can optionally have XML Spy automatically validate a document upon saving (this can be defined in the File tab on the Tools | Options dialog).

If a validation error occurs, XML Spy will bring up a popup message with a detailed error explanation and will highlight the offending item. You can then choose to fix the problem or save the document as is. In the latter case, you will be prompted to correct the error the next time you open the file with XML Spy.


Save As...

Save As...

The "Save As..." command shows the familiar Windows "Save as..." dialog box to prompt for the name and location of the file that is to be saved. The same checks and validations occur as for the "Save" command.


Save to URL...

Save to URL...

The "Save to URL..." command allows you to save non-local files to a specified URL (uniform resource locator) address.

To save an XML document to a URL address:
1. Make sure the file you want to save is active in the XML Spy main window.
2. Select the menu option File | Save to URL
3. Click the Browse button to see and navigate the directory structure of the server.
4. Enter the file name in the URL field, or mark the file in the "Available files" list box, if you want to overwrite it.

The Browse function is only available on servers which support the following protocols:
· FTP
· HTTP and HTTPS, if the server supports WebDAV
· or servers supporting WebDAV

Password protected servers
If the server you connect to is password protected, enter the required data and click the OK button to connect. You can also enter these data in the User and Password fields. The Save check box, supplies the password data for the logon attempt.

Repositories
Repositories supported by XML Spy come in three flavors:
· Generic version control systems, such as Microsoft Visual Source-Safe (or compatible products)
· Generic web servers, such as FTP or WebDAV servers; and
· Specialized XML or schema repositories, such as Tamino, TEXTML Server, Virtuoso, or XML Canon.

XML Spy currently supports Source-Safe, FTP and WebDAV servers, as well as Virtuoso through WebDAV. Other repository interfaces will be available in future versions.


Save All

Save All

The "Save All" command saves all modifications that have been made to any open documents. The command is useful if you edit multiple documentations simultaneously.

If a document has never been saved (e.g. after using the New command), the Save as... dialog box is presented for that document.


Send by Mail...

Send by Mail...

The "Send by Mail" command lets you create mail messages from any XML file, group of files (in the Project window), or selection within a file. To use this function you must be using a MAPI compliant e-mail system.

If you choose to send an entire file or group of files, they are always included as an attachment to the mail message:

Sending fragments or portions of documents
When you want to send a fragment of an XML file, select the elements you wish to send in either Enhanced Grid View or Text View.

XML Spy gives you the choice of either creating an attachment file that contains only your current selection or simply sending the selection as XML text in the contents of the mail message.

Sending URLs by mail
When you send an URL (from the project window) you are prompted if you want to first retrieve the document referred to by the URL and then send the file as an attachment, or if you wish to just include the URL so that the recipient of your message can access the document through the URL:


Print...

Print...

The "Print..." command opens the "Print" dialog box where you can control what appears on the printout. This dialog box contains different items, depending on the current view mode.

Enhanced Grid View options:

· The "Types" group box allows you to select the items you wish to appear in the output. You can hide comments as well as processing instructions or DTD items. For an explanation of the item types, please refer to the XML specification.
· The "What" group box allows you to print the entire file or just the current selection.
· The "Expand" group box allows you to print the document as is, or as a document with all child elements expanded fully.
· The "Contents" group box you can decide to print the contents of all elements in a document, or you may also print only those elements that form the hierarchical "tree" structure of the document.
This should, however, not be confused with the optional tree view on the left side of each document window, which is only used as a navigation aid on the screen and cannot be printed.
· In the "If contents are wider than page" group box you can decide what to do if the document is larger than one page of paper.
- The "Split pages" option, prints the entire document in its regular size and splits the contents on as many pages (both horizontally and vertically) as are required. These pages can later be glued together to form a poster.
- The "First page" option, is useful if your page is slightly narrow and most of the important information is contained on the left side, anyway. This will result in output that is split into vertical pages (as necessary). Only the first page is printed horizontally - the document is printed as one huge vertical strip.
- The "Shrink horizontally" option, reduces the size of the output, until it fits horizontally on the page. The output may, however, still span several pages vertically and is split accordingly.
- The "Shrink both" option, shrinks the document in both directions until it fits exactly on one sheet, thus making it useful for overviews.
· The "Print" button prints the document with the selected options.
· The "Preview" button opens a print preview window that lets you view the final output before committing it to paper.
· The "Print Setup" button opens the "Print Setup" dialog box and allows you to adjust the paper format, orientation, and other printer options for this print job only.

If you choose the Preview button, XML Spy will show a miniature image of the pages to be printed:

You can navigate within the preview mode using the "Next Page" and "Prev Page" buttons or "Zoom In" to take a close look at some details.

The "Print..." button lets you print the pages, whereas the "Close" button allows you to return to the previous dialog box without starting the print process.


Print Setup...

Print Setup...

The "Print Setup..." command, displays the printer-specific "Print Setup" dialog box, enabling you to set the paper format, orientation, and other printer options for all successive print jobs.

This is an example using an HP LaserJet 4 printer attached to the parallel port (LPT1:).


Most Recently Used Files

Most Recently Used Files

The list of most recently used files, shows the file name and path information for the nine most recently used files, which you can select with the mouse.

To access these files using the keyboard, press:
ALT+F,1 to open the File menu, and select the first file in the list.


Exit

Exit

The exit command is used to quit XML Spy when you are finished working with your documents. If you have any open files with unsaved changes, XML Spy will automatically prompt you to save these changes.

XML Spy also saves modifications you have made to program settings, as well as information about the most recently used files and projects to the Registry, a message box appears during this process.


Edit Menu

Edit Menu

The Edit menu contains all commands relevant to editing operations within XML Spy in the order common to most Windows software products.

In addition to the standard Undo, Redo, Cut, Copy, Paste, Delete, Select All, Find, Find next and Replace commands, XML Spy offers special commands to:

· copy the selection to the clipboard as XML-Text,
· Copy as structured text, or
· copy an XPath selector to the selected item to the clipboard.

All commands can be applied while editing text, as well as while operating on whole items or even discontinuous selections of more than one item.


Undo

Undo

Hotkey: CTRL + Z

The "Undo" command contains support for unlimited levels of Undo! Every action in XML Spy can be undone and it is possible to undo one command after another. The Undo history is retained after using the "Save" command, enabling you go back to a state the document was in before you saved your changes.

Please note:
when you have turned on dynamic syntax coloring updates in the Text View and your operating system is using RichEdit 2.0 (i.e. earlier versions of Windows 95/98 and Windows NT 4.0), syntax coloring changes appear as undoable operations. If you want to avoid this, please update to RichEdit 3.0 or disable the dynamic syntax coloring update feature (for further information please see the background information on the RichEdit Component).


Redo

Redo

Hotkey: CTRL + Y

The "Redo" command allows you to redo previously undone commands - thereby giving you a complete history of the work you have completed. You can step back and forward through this history using the Undo and Redo commands.


Cut

Cut

Hotkey: Shift + Delete, or CTRL + X

The Cut command copies the selected text or items to the clipboard and deletes them from their present location.


Copy

Copy

Hotkey: CTRL + C

The Copy command copies the selected text or items to the clipboard. This can be used to duplicate data within XML Spy or to move data to another application.

Please note:
XML Spy provides two different commands for copying elements to the clipboard in a textual form: Copy as XML-Text and Copy as Structured Text.

You can use the Editing tab on the Tools | Options dialog, to choose which operation should be performed when you use the copy command on the Edit menu or the Ctrl-C shortcut.


Paste

Paste

Hotkey: CTRL + V

The Paste command inserts the contents of the clipboard at the current cursor position.


Delete

Delete

Keyboard: Del.

The Delete command deletes the currently selected text or items without placing them in the clipboard.


Copy as XML-Text

Copy as XML-Text

The "Copy as XML-Text command lets you exchange data easily with other products that allow data manipulation on the XML source layer.

While editing your document in Enhanced Grid View, you may occasionally want to copy some elements to the clipboard in their XML-Text representation:

    <row>
        <para align="left">
            <bold>Check the FAQ</bold>
        </para>
        <para>
            <link mode="internal">
                <link_section>support</link_section>
                <link_subsection>faq30</link_subsection>
                <link_text>XML Spy 4.0 FAQ</link_text>
            </link>
            <link mode="internal">
                <link_section>support</link_section>
                <link_subsection>faq25</link_subsection>
                <link_text>XML Spy 3.5 FAQ</link_text>
            </link>
        </para>
    </row>

This command automatically formats text using the currently active settings for saving a file. These settings can be modified in the "Save File" section of the File tab of the Tools | Options dialog).


Copy as Structured Text

Copy as Structured Text

The " Copy as Structured Text" command copies elements to the clipboard as they appear on screen. This command is useful for copying table-like data from the Enhanced Grid View as well as the integrated Database/Table View.

The copied data can be used within XML Spy as well as third-party products, enabling you to transfer XML data to spreadsheet-like applications (e.g. Microsoft Excel).

If you copy this table and paste it into Excel, the data will appear in the following way:

Please note:
The results of this command depend on the way the information is currently laid out on screen. Using the same XML data (that served as an example for the Copy as XML-Text command) in the Enhanced Grid view with the Table view active, would result in the following:

    row
        para
            align    bold    link
            left     Check the FAQ
                link
                   mode       link_section    link_subsection   link_text
                   internal   support         faq30             XML Spy 3.5 FAQ
                   internal   support         faq25             XML Spy 2.5 FAQ

The same data would be copied to the clipboard in the following format, with the Table view deactivated in the Enhanced Grid View.

    row
        para
            align    left
            bold     Check the FAQ
        para
            link
                mode              internal
                link_section      support
                link_subsection   faq30
                link_text         XML Spy 3.5 FAQ
            link
                mode              internal
                link_section      support
                link_subsection   faq25
                link_text         XML Spy 2.5 FAQ


Copy XPath

Copy XPath

The "Copy XPATH" command copies the corresponding XPath Selector to the clipboard enabling you to paste it into XSLT documents or any other file that uses XPath.

When using XSLT it is very often necessary to enter so-called Selector strings that help in selecting an element or attribute from within another XML document. Selector strings are built according to the XPath definition, and XML Spy helps you to create XPath Selectors, by selecting the item you wish to address and choosing Copy XPATH from the Edit menu.


Pretty-Print XML Text

Pretty-Print XML Text

The "Pretty-Print XML Text command reformats your XML document in the text view, giving you a structured display. Note that the XML document must be well formed for this command to work.


Select All

Select All

Hotkey: CTRL + A

The "Select All" command selects all the text of an item or all the items in an XML document, enabling successive commands to operate on the entire text or document at once.


Find...

Find...

Hotkey: CTRL + F

The "Find" command allows you to search for any occurrence of a text string in your XML document. Depending on the view you are using, the Find command will have different options.

Enhanced Grid View find options:

· Enter the text string to be searched for in the "Find what" field, or use the combo box to select from one of the last 10 search criteria. The Find what field can be left empty, to search for elements, attributes etc.
· The "Types" group box, allows you to select what kind of items you wish to include in the search. This allows you to e.g. skip comments as well as processing instructions or DTD items. For an explanation of the item types, please refer to the XML specification.
· The "Search in" group box, allows you to define if you want to search for the specified text in the (element or attribute) names of items, in their contents, or in both.
· The "Settings" group box, allows you to define a case-sensitive and/or match string search.
· The "Where" group box, allows you to define your the scope of the search.
· The "Direction" group box, allows you to specify the search direction.
· The "Set all" button, activates all the check boxes in the Types group box, the "Clear all" deactivates them.


Find next

Find next

Hotkey: F3

The "Find next" command repeats the last Find command to search for the next occurrence of the requested text.


Replace...

Replace...

Hotkey: CTRL + H

The "Replace" command is only available in the Text and Enhanced Grid View, it features the same options as the Find... command and allows you to replace the target text by any other text string of your choice.

You can replace each item individually, or you can use the "Replace All" button to perform a global search and replace operation.

Please note:
As a security precaution, the "Replace all" command shows each individual replacement operation in the Enhanced Grid view. You can interrupt the operation by pressing the <ESC> key. Each replacement, is recorded as a single operation that can be undone individually.


Project Menu

Project Menu

XML Spy uses the familiar tree view to manage multiple files or URLs in XML projects. Files and URLs can be grouped into folders by common extension or any arbitrary criteria, allowing for easy structuring and batch manipulation.

Please see the description of the Project Window for a general introduction to the XML Spy project management.

Please note:
most project-related commands are also available on the context-menu, when you right-click on any item in the project window.


New Project

New Project

This command creates a new project in XML Spy.

If you are currently working with another project, a prompt appears asking if you want to close all documents belonging to the current project.


Open Project...

Open Project...

This command opens an existing project in XML Spy.

If you are currently working with another project, the previous project is closed first.


Reload Project

Reload Project

This command reloads the current project from disk.

If you are working in a multi-user environment, it can sometimes become necessary to reload the project from disk, as other users might have made changes to the project.

Please note:
XML Spy project (.spp) files are actually XML documents that you can edit like any regular XML File. This should only be attempted by advanced users!


Close Project

Close Project

This command closes the active project.

If the project has been modified, you will be asked if you want to save the project first.

When a project, or XML file is modified, an asterisk "*" is automatically appended to the file name in the title bar.


Save Project

Save Project

This command saves the current project.


Source control

Source control

XML Spy supports Microsoft Source-Safe and other compatible repositories.

A source control project is, however, not the same as a XML Spy project. Source control projects are extremely directory dependent, whereas XML Spy projects are logical constructions without direct directory dependence.

The following text uses Microsoft Source-Safe as the Source Control provider.


Open project

Open project

The Open Project command mirrors (or creates) an existing source control project locally. This command can only take effect if an XML Spy project has previously been added to source control provider using the menu option Add to Source Control.

1. Select a source control provider from the list of those installed on your PC, and confirm with the OK button.

2. Enter your login data in the Source Control Login dialog box, and confirm with OK.

3. Define the directory to contain the local project.
4. Select the Source control project you want to download.
If the folder you define does not exist at the location, a dialog box opens prompting you to create it there. Click Yes to confirm the new directory.
5. Click the OK button to download the source control project.

6. XML Spy now displays the Open dialog box, and attempts to find the XML Spy project file (*.spp) in the local directory. Click the project file you want to create, if there are several to choose from.

A message box might appear at this point stating that the directory is under source control, offering you the option of checking it out or not.
7. Click the OK, if you want source control to be enabled.
The Check out dialog box opens, allowing you to check out the *.spp file.
8. Add any comments to the file in the Comment text box and Click OK, to check out the XML Spy project file. Depending on your source control provider, the dialog box might contain extra command buttons. In this case the Advanced... button opens the Advanced Check Out Options dialog box.

The *.spp file is checked out, and all the XML files contained in the XML Spy project, are copied to the local directory.

Result in XML Spy:
The AltovaTest directory has been created locally, and all files included in the XML Spy project are made available in the project window. You can now work with these files as you normally do.

Source control symbols in XML Spy

The red check mark denotes checked out, i.e. the AltovaTest project file has been checked out.
The asterisk denotes that changes have been made to the file, and you will be prompted to save it when you exit.

The lock symbol, at the top right corner the XML symbol, denotes that the file is under source control, but is currently not checked out.

This URL document is part of the AltovaTest project but is not under source control. Documents opened via URL, cannot be placed under source control.


Enable Source code control

Enable Source code control

This command allows you to enable or disable source control for a project.

To disable source control for a project:
1. Click on the project file or any other file in the project window.
2. Select the menu option Project | Source control and deactivate the Enable Source Code Control check box.

To provisionally disable source control for the project select YES.

To permanently disable source control for the project select NO.


Get Latest Version

Get Latest Version

This command gets the latest source control version of file you select.

The file is a copy of the source control file and is placed in your local working directory.


Check Out

Check Out

This command checks out the latest source control version of file(s) you select, and flags it as "checked out" for all other users.

Shortcut: Right click an item in the project window, and select "Check out" from the context menu.

The following items can be checked out:
· Single files, click on the respective files (CTRL + click, for several)
· XML Spy project folders, click on the folders (CTRL + click, for several)
· XML Spy project, click on the project file icon.

The red check mark denotes that the file has been checked out.


Check In

Check In

This command checks in the previously checked out files, i.e. your locally updated files, and places them in the source control project.

Shortcut: Right click a checked out item in the project window, and select "Check in" from the Context menu.

The following items can be checked in:
· Single files, click on the respective files (CTRL + click, for several)
· XML Spy project folders, click on the folders (CTRL + click, for several)
· A complete XML Spy project, click on the project file icon.

The lock symbol denotes that the file is under source control, but is currently not checked out.


Undo Check Out...

Undo Check Out...

This command rejects changes made to previously checked out files, i.e. your locally updated files, and retains the old files in the source control project.

Shortcut: Right click a checked out item in the project window, and select "Undo Check out" from the Context menu.

The Undo check out option can apply to the following items:
· Single files, click on the respective files (CTRL + click, for several)
· XML Spy project folders, click on the folders (CTRL + click, for several)
· XML Spy project, click on the project file icon.


Add to Source Control

Add to Source Control

This command adds an XML Spy project to your Source Control provider.

To add an XML project to the source control provider:
1. Click the XML Spy project icon and select the menu option Project | Source control | Add to Source control.
2. Select your source control provider from the list box.
3. Enter the source control login data.
4. Select the source control project (directory) to which your XML project should be added, and confirm with the OK button.

If the project does not exist, the following dialog box opens, prompting for more information.

5. Select Yes to create the new project and NO to cancel.

6. Select the XML Spy project files that you want to be placed under control of the source control provider, and confirm with OK.

The files are transferred to the source control provider and are now under source control. These files are marked with the "lock symbol" in the project window. The files you did not transfer do not have the lock symbol (datatypes.dtd and XMLschema.dtd in this example).


Remove from Source Control

Remove from Source Control

This command removes previously added files, from the source control provider.

The following items can be removed from source control:
· Single files, click on the respective files (CTRL + click, for several)
· XML Spy project folders, click on the folders (CTRL + click, for several)
· A complete XML Spy project, click on the project file icon.


Show History

Show History

This command displays the history of a file, it can only be used on single files.

To show the history of a file:
1. Click on the file in the project window
2. Select the menu option Project | Source control | Show history.

A dialog box prompting for more information may appear at this time (this example uses MS Source-Safe).

3. Select the appropriate entries and confirm with OK.


Show Differences

Show Differences

This command displays the differences between the file currently in the source control repository, and the file of the same name that you have checked out.

This command can only be used on single files.

To show the differences between two files:
Having checked out a file from your project,
1. Click on the file in the project window.
2. Select the menu option Project | Source control | Show Differences.
A dialog box prompting for more information may appear at this time.

3. Select the appropriate entries and confirm with OK.

The differences between the two files are highlighted in both windows (this example uses MS Source-Safe).


Properties

Properties

This command displays the properties of the currently selected file, and is dependent on the source control provider you use.

This command can only be used on single files.


Refresh Status

Refresh Status

This command refreshes the status of all project files independent of their current status.


Run Native Interface

Run Native Interface

This command starts your source control software with its usual user interface.


Add Files to Project...

Add Files to Project...

This command adds files to the current project.

Use this command to add files to any folder in your project. You can either select a single file or any group of files (using CTRL + click) in the Open dialog box.

If you are adding files to the project, they will be distributed among the respective folders based on the File Type Extensions defined in the Project Properties dialog box.


Add URL to Project...

Add URL to Project...

This command adds an URL to the current project.

XML Spy also allows you to add URLs to a project. Whenever a batch operation is performed on a URL or on a folder that contains a URL item, XML Spy will retrieve the document from the URL , and perform the requested operation.


Add Active File to Project

Add Active File to Project

This command adds the active file to the current project.

If you have just opened a file from your hard disk or through an URL, you can add the file to the current project using this command.


Add Active And Related Files to Project

Add Active And Related Files to Project

This command adds the currently active XML document and all related files to the project.

When working on an XML document that is based on a DTD or Schema, XML Spy also lets you add both the XML document and all related files (e.g. the DTD and all external parsed entities it refers to) to the current project.


Add Project Folder to Project...

Add Project Folder to Project...

This command adds a new folder to the current project.

Use this command to add a new folder to the current project. You can also access this command from the context-menu when you right-click on a folder in the project window.


Add External Folder to Project...

Add External Folder to Project...

This command adds a new external folder to the current project.

Use this command to add a local or network folder to the current project. You can also access this command from the context-menu when you right-click a folder in the project window.

To add an external folder to the project
1. Select the menu option Project | Add External Folder to project.
2. Select the folder you want to include from the "Browse for Folder" dialog box, and click OK to confirm.

The selected folder now appears in the project window.

3. Click the plus icon to view the folder contents.

To filter the folder contents:
1. Right click the local folder, and select the popup menu option Properties.
This opens the Properties dialog box.

2. Click in the File extensions field and enter the file extensions of the file types you want to see. You can separate each file type with a semicolon to define multiple types (XML and Schema XSDs in this example).
3. Click OK to confirm the selection.

The Project window now only shows the XML and XSD files of the tutorial folder.

Validating and checking a folder for well-formedness:
Having selected the file types you want to see or check, from the external folder,
1. Click the folder and click the "Check well-formedness" or "Validate" icon, (hotkeys F7 or F8).
All the files visible under the folder are checked.

If a file is malformed or invalid, then this file is opened in the main window, allowing you to edit it. In this case the CompanyLast file is opened because the PhoneExt value does not match the facet defined in the underlying schema file. This schema only allows only two digit numbers.

2. Correct the error and restart the process to recheck the rest of the folder.

Please note
You can select discontinuous files in the folder, by holding down CTRL and clicking the files singly. Only these files are then checked when you click F7 or F8.

To update the project folder contents:
You might add or delete files in the local or network directory at any time. To update the folder view,
· Right click the external folder, and select the popup menu option Refresh external folder.

Deleting files or folders:
· Right click a folder and hit the Del. key, to delete the folder from the Project window. This only deletes the folder from the Project view, and does not delete anything on your hard disk or network.
· Right clicking a single file and hitting Del. does not delete a file from the Project window. You have to delete it physically and then Refresh the external folder contents.


Add External Web Folder to Project...

Add External Web Folder to Project...

This command adds a new external web folder to the current project.

Use this command to add a web folder to the current project. You can also access this command from the context-menu when you right-click a folder in the project window.

To add an external web folder to the project
1. Select the menu option Project | Add External Web Folder to project.
This opens the "Add Web folder to project" dialog box.

2. Click in the Server URL field to enter the server URL, and enter the login ID in the User and Password fields.
3. Click the Browse button to connect to the server and view the files available there.

4. Click the folder you want to add to the project view. The OK button only becomes active once you do this. The Folder name and http: server address now appear in the File URL field.
5. Click OK to add the folder to the project.

6. Click the plus icon to view the folder contents.

To filter the folder contents:
1. Right click the web folder, and select the popup menu option Properties.
This opens the Properties dialog box.
2. Click in the File extensions field and enter the file extensions of the file types you want to see. You can separate each file type with a semicolon to define multiple types (XML and Schema XSDs for example).
3. Click OK to confirm the selection.
The Project window now only shows the XML and XSD files of the web folder.

Validating and checking a folder for well-formedness:
1. Click the folder and click the "Check well-formedness" or "Validate" icon, (hotkeys F7 or F8).
All the files visible under the folder are checked.

If a file is malformed or invalid, then this file is opened in the main window, allowing you to edit it.
2. Correct the error and restart the process to recheck the rest of the folder.

Please note
You can select discontinuous files in the folder, by holding down CTRL and clicking the files singly. Only these files are then checked when you click F7 or F8.

To update the project folder contents:
Files may be added or deleted from the web folder at any time. To update the folder view,
· Right click the external folder, and select the popup menu option Refresh external folder.

Deleting files or folders:
· Right click a folder and hit the Del. key, to delete the folder from the Project window. This only deletes the folder from the Project view, and does not delete anything on the web server.
· Right clicking a single file and hitting Del. does not delete a file from the Project window. You have to delete it physically and then Refresh the external folder contents.


Project Properties...

Project Properties...

The Properties command lets you define important settings for any of the specific folders in your project.

To define the Project Properties for a folder:
1. Right click on the folder you want to define the properties for, and
2. Select the Properties... command from the context menu.

Please note:
if your project file is under source control, a prompt appears asking if you want to check out the project file (*.spp). Click OK, if you want to edit settings and be able to save them.

File extensions
The File extensions help to determine the automatic file-to-folder distribution that occurs when you add new files to the project (as opposed as to one particular folder).

Validate
Define the DTD or Schema document that should be used to validate all files in the current folder (Main Pages in this example).

XSL transformation of XML files
You can define the XSL Stylesheet to be used for XSL Transformation of all files in the folder.

If you are developing XSL Stylesheets yourself, you can also assign an example XML document to be used to preview the XSL Stylesheet in response to an XSL Transformation command issued from the stylesheet document, instead of the XML instance document.

Destination files of XSL transformation
For batch XSL Transformations, you can define the destination directory the transformed files should be placed in.

If you have added one file or URL to more than one folder in your project, you can use the properties command to set the default folder, whose settings should be used when you choose to validate or transform the file in non-batch mode.

Document Editor
The "Use config." option allows you to select an SPS file when editing XML files using Document Editor, in the current folder. Please see the Document Editor manual for more information.


Most Recently Used Projects

Most Recently Used Projects

This command displays the file name and path for the nine most recently used projects, allowing quick access to these files.

Also note, that XML Spy can automatically open the last project that you used, whenever you start XML Spy. (Tools | Options| File tab, Project | Open last project on program start)


XML Menu

XML Menu

The XML menu contains all commands necessary for manipulating XML documents with XML Spy. You will find commands to insert or append elements, modify the element hierarchy, and set a namespace prefix for items.

You can also check documents for well-formedness or validate them against any Schema or DTD.


Insert

Insert

The Insert command inserts a new item directly before the currently selected one. In case of an attribute, it may appear a few lines before the current item, as all attributes must immediately follow their parent element.


Insert Attribute

Insert Attribute

Hotkey: CTRL+SHIFT+I

This command inserts a new attribute before the selected item.

If the current selection is any element other than the first element, the attribute is inserted before the first element to satisfy the well-formedness constraints of XML.


Insert Element

Insert Element

Hotkey: CTRL+SHIFT+E

This command inserts a new element before the selected item.

If the current selection is an attribute, the new element is inserted before the first element to satisfy the well-formedness constraints of XML.


Insert Text

Insert Text

Hotkey: CTRL+SHIFT+T

This command inserts new text content before the selected item.

If the current selection is an attribute, the text is inserted before the first element to satisfy the well-formedness constraints of XML.


Insert CDATA

Insert CDATA

Hotkey: CTRL+SHIFT+D

This command inserts a new CDATA block before the selected item.

If the current selection is an attribute, the CDATA is inserted before the first element to satisfy the well-formedness constraints of XML.


Insert Comment

Insert Comment

Hotkey: CTRL+SHIFT+M

This command inserts a new comment before the selected item.

If the current selection is an attribute, the Comment is inserted before the first element to satisfy the well-formedness constraints of XML.


Insert XML

Insert XML

This command inserts new XML declaration
<?xml version="1.0" encoding="UTF-8"?> before the selected item.

Please note:
Each XML document may only contain one XML declaration and it must appear at the very top of the file.


Insert Processing Instruction

Insert Processing Instruction

This command inserts a new Processing Instruction (PI) before the selected item.

If the current selection is an attribute, the PI is inserted before the first element to satisfy the well-formedness constraints of XML.


Insert DOCTYPE

Insert DOCTYPE

This command inserts a Document Type Declaration - or more precisely, the DOCTYPE block for the internal subset of a Document Type Declaration (DTD) - before the selected item.

Please note:
The DOCTYPE block may only appear at the top of an XML instance document between the XML Declaration and the root element of the XML document.

You could also use the Assign DTD command instead, which lets you create a DOCTYPE statement that refers to an external DTD document.


Insert ExternalID

Insert ExternalID

This command inserts an external ID (SYSTEM or PUBLIC) into a DOCTYPE declaration, before the selected item.


Insert ELEMENT

Insert ELEMENT

This command inserts an element declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD), before the selected item.


Insert ATTLIST

Insert ATTLIST

This command inserts an attribute list declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD), before the selected item.


Insert ENTITY

Insert ENTITY

This command inserts an entity declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.


Insert NOTATION

Insert NOTATION

This command inserts a notation declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.


Append

Append

The Append command appends an item as the last item inside the parent of the currently selected item. This is useful whenever you want to add more than one item in sequence.


Append Attribute

Append Attribute

Hotkey: CTRL+I

This command appends a new attribute after the last element within the same parent.


Append Element

Append Element

Hotkey: CTRL+E

This command appends a new element after the last element within the same parent.


Append Text

Append Text

Hotkey: CTRL+T

This command appends a new text content block after the last element within the same parent.


Append CDATA

Append CDATA

Hotkey: CTRL+D

This command appends a new CDATA block after the last element within the same parent.


Append Comment

Append Comment

hotkey: CTRL+M

This command appends a new comment after the last element within the same parent.


Append XML

Append XML

This command inserts a new XML declaration
<?xml version="1.0" encoding="UTF-8"?> as the first item in a document.

Please note:
Each XML document may only contain one XML declaration and it must appear at the very top of the file.


Append Processing Instruction

Append Processing Instruction

This command appends a new Processing Instruction (PI) after the last element within the same
parent.


Append DOCTYPE

Append DOCTYPE

This command appends a new Document Type Declaration - or more precisely, the DOCTYPE block for the internal subset of a Document Type Declaration (DTD) - after the last element within the same parent.

Please note:
A DOCTYPE block may only appear at the top of an XML instance document between the XML Declaration and the root element of the XML document.


Append ExternalID

Append ExternalID

This command appends an external ID (SYSTEM or PUBLIC) in a DOCTYPE declaration after the last element of the same parent.


Append ELEMENT

Append ELEMENT

This command appends an element declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Append ATTLIST

Append ATTLIST

This command appends an attribute list declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Append ENTITY

Append ENTITY

This command appends an entity declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Append NOTATION

Append NOTATION

This command appends a notation declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Add Child

Add Child

The Add Child command adds a child item to the currently selected element. This is useful for adding attributes to an item, or creating child elements.


Add Child Attribute

Add Child Attribute

Hotkey: CTRL+ALT+I

This command inserts a new attribute as a child of the selected item.


Add Child Element

Add Child Element

Hotkey: CTRL+ALT+E

This command inserts a new element as a child of the selected item.


Add Child Text

Add Child Text

Hotkey: CTRL+ALT+T

This command inserts new text content as a child of the selected item.


Add Child CDATA

Add Child CDATA

Hotkey: CTRL+ALT+D

This command inserts a new CDATA block as a child of the selected item.


Add Child Comment

Add Child Comment

Hotkey: CTRL+ALT+M

This command inserts new Comment as a child of the selected item.


Add Child XML

Add Child XML

This command is only available, when you are looking at a totally empty file...

This command inserts a new XML declaration
<?xml version="1.0" encoding="UTF-8"?> as a child of the selected item.


Add Child Processing Instruction

Add Child Processing Instruction

This command inserts a new Processing Instruction (PI) as a child of the selected item.


Add Child DOCTYPE

Add Child DOCTYPE

This command is only available, if you are looking at a total empty file.

This command inserts a Document Type Declaration - or more precisely, the DOCTYPE block for the internal subset of a Document Type Declaration (DTD) - as a child of the selected item.

Please note:
A DOCTYPE block may only appear at the top of an XML instance document between the XML Declaration and the root element of the XML document.


Add Child ExternalID

Add Child ExternalID

This command inserts an external ID (SYSTEM or PUBLIC) into a DOCTYPE declaration as a child of the selected item.


Add Child ELEMENT

Add Child ELEMENT

This command inserts an element declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.


Add Child ATTLIST

Add Child ATTLIST

This command inserts an attribute list declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.


Add Child ENTITY

Add Child ENTITY

This command inserts an entity declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.


Add Child NOTATION

Add Child NOTATION

This command inserts a notation declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.


Convert To

Convert To

The convert to command converts an item to a different item type. Depending on the location of the item (not on its current kind), some or all options on the item type submenu may or may not be available. This operation can only be performed on one individual item, not on an element that contains any child elements.

If the operation would result in the loss of data (e.g. converting an attribute to a comment looses the attribute name), a brief warning dialog box will appear.


Convert To Attribute

Convert To Attribute

This command converts the selected item into a new attribute.


Convert To Element

Convert To Element

This command converts the selected item into an element.


Convert To Text

Convert To Text

This command converts the selected item into text content.


Convert To CDATA

Convert To CDATA

This command converts the selected item into a CDATA block.


Convert To Comment

Convert To Comment

This command converts the selected item into a comment.


Convert To XML

Convert To XML

This command converts the selected item to an XML declaration
<?xml version="1.0" encoding="UTF-8"?>.

Please note:
Each XML document may only contain one XML declaration and it must appear at the very top of the file.


Convert To Processing Instruction

Convert To Processing Instruction

This command converts the selected item to a new Processing Instruction (PI)


Convert To DOCTYPE

Convert To DOCTYPE

This command converts the selected item to a Document Type Declaration - or more precisely, the DOCTYPE block for the internal subset of a Document Type Declaration (DTD).

Please note:
A DOCTYPE block may only appear at the top of an XML instance document between the XML Declaration and the root element of the XML document.


Convert To ExternalID

Convert To ExternalID

This command converts the selected item to an external ID (SYSTEM or PUBLIC) in a DOCTYPE declaration.


Convert To ELEMENT

Convert To ELEMENT

This command converts the selected item to an element declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Convert To ATTLIST

Convert To ATTLIST

This command converts the selected item to an attribute list declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Convert To ENTITY

Convert To ENTITY

This command converts the selected item to an entity declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Convert To NOTATION

Convert To NOTATION

This command converts the selected item to a notation declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Table

Table

The Table menu command contains all commands relevant to the Database/Table View in XML Spy.

The Database/Table commands can only be selected if the Enhanced Grid view is active!


Display as Table

Display as Table

Hotkey: F9

This command allows you switch between two views of repeated elements in the Enhanced Grid view. The Grid view (default view, in the Enhanced Grid view) and the Database/Table view.

1. Select one of the repeated elements in the grid view.
The Displays as Table icon is only made active when you make the correct selection.

2. Click the icon or press the F9 Hotkey.

This effectively breaks out all attributes and sub-elements, and show them as columns similar to any spreadsheet- or database-like application.


Insert Row

Insert Row

Hotkey: SHIFT+F9

This command inserts new rows to the table in the Database/Table View:

1. Click a row number in the table (or one of the cells), and
2. Select the menu option XML | Table | Insert row (or Shift+F9).

This inserts a new row (i.e. a new element) before the currently selected row.


Append Row

Append Row

Hotkey: CTRL+F9

This command appends new rows to the table in the Database/Table View

1. Click a row number in the table (or one of the cells), and
2. Select the menu option XML | Table | Insert row (or Ctrl+F9)

This appends a new row (i.e. a new element) to the end of the table.


Ascending Sort

Ascending Sort

This command sorts column elements in ascending order (in the table) in the Database/Table View:

1. Click a column header in the table, and
2. Select the menu option XML | Table | Ascending sort (or clicking on the A-Z icon)

XML Spy will automatically try to determine what kind of data you are using in the selected column, and choose an alphabetic or numeric sort method accordingly.

If XML Spy is not sure which sort order to use, it opens this dialog box to prompt for help:


Descending Sort

Descending Sort

This command sorts column elements in descending order (in the table) in the
Database/Table View

1. Click a column header in the table, and
2. Select the menu option XML | Table | Descending sort (or clicking on the Z-A icon)

XML Spy will automatically try to determine what kind of data you are using in the selected column, and choose an alphabetic or numeric sort method accordingly.

If XML Spy is not sure which sort order to use, it opens a dialog box to prompt for help.


Move Left

Move Left

Hotkey: CTRL+L

This command moves the current element to the left by one level, thereby changing a child element into a sibling of its parent. This is also often referred to as the "Promote" command.


Move Right

Move Right

Hotkey: CTRL+R

This command moves the current element to the right by one level, thereby turning it into a child element of the element directly above. This is also often referred to as the "Demote" command.


Enclose in Element

Enclose in Element

When editing textual data, it is often convenient to insert a new sub-element that contains some text, which is already present in the document.

The Enclose in Element command lets you accomplish this with any text selection within another element. Once you select this command from the menu or toolbar, the currently selected text is cut from its parent element and inserted into a newly created child element.

If you are editing a document based on a Schema or DTD, you will automatically be presented with a list of valid choices for the kind of element you are allowed to insert in this position.


Evaluate XPath

Evaluate XPath

XML Spy includes an XPath Visualizer that allows you to define/check XPath expressions in your XML documents and display the results immediately.

XPath provides a method to find elements, attributes, and other specific items in any type of XML document. The XML Spy XPath Visualizer allows you to enter an XPath into a field and have it evaluated immediately, with the resultant (node set) displayed in a window. Clicking one of these nodes, displays that specific node in the currently active XML Document. The XPath expression is also automatically checked to see if it is valid when you enter it.

The XPath Visualizer is available in the Enhanced Grid and Text view.

Please see the XPath specifications at http://www.w3.org/TR/xpath for more information.

XPath uses in XML Spy
· When creating Identity Constraints
· Setting breakpoints using the SOAP debugger
· Checking XSLT code

To evaluate an XPath expression:
1. Open an XML document in XML Spy (e.g. CompanyLast).
2. Select the menu option XML | Evaluate XPath or click the Evaluate XPath [image] icon.
3. Type an XPath expression in the XPath field (e.g. //First).

The resultant node set, all "First" elements under the Document Root, appears in the node set window.
4. Click one of the "First" elements in the node set window.
5. The corresponding element appears in the currently active XML document.


XPath Visualizer options

XPath Visualizer options

XPath syntax
This option group allows you to select which syntax you want to use when evaluating an XPath. When entering an XPath, the expression is constantly monitored for adherence to these syntax rules. An invalid expression automatically appears in red. As soon as the expression becomes valid the expression changes from red into black.

Allow Complete XPath:
This is the default option and checks against the complete XPath syntax.

XML Schema Selector:
This option checks the XPath against the XML Schema Selector syntax.

XML Schema Field:
This option checks the XPath against the XML Schema Field syntax.

XPath origin
This option group lets you define from where in the XML document you want to start your search. The option you select here remains active the next time you search for an XPath.

From Document Root:
This is the default option, and starts the search from the beginning of the XML document.

From Selected Element:
Select this option if you want to start your search from the currently selected element, attribute etc. in the XML document. Note that the current element position does not change if you click one of the node set results in the node set window.

Real-time evaluation
Evaluate when typing:
This is the default option, and presents results in the node set window while you are typing in the expression.

Evaluate on button click:
This option defers the XPath evaluation until you click the Evaluate button.

Node set window
This window displays the results of the evaluated XPath expression. The XPath results in this window can appear as nodes, numbers, boolean expressions, or error messages.


XPath examples

XPath examples

A few examples of XPath expressions and their results are shown below. These examples use the CompanyLast.xml file available in the ..\Examples\Tutorial folder supplied with XML Spy.

Find all the elements in the first occurence of the person child element.

Find all the person elements, where the Manager attribute value is true.

Find the total value of all the PhoneExt elements.

Entering the SUM-Function in CAPS displays an error message in the node set window. All XPath expressions are case sensitive, this includes function names as well as node names.


Check Well-Formedness

Check Well-Formedness

This command checks the document for well-formedness by the definitions of the XML 1.0 specification.

Every XML document must be well-formed and therefore XML Spy automatically checks for well-formedness whenever a document is opened, saved, or the view mode is switched from Text to any other view.

If the well-formedness check succeeds, a brief message is displayed at the bottom of the main window:

If any error is encountered during the well-formedness check, the source of the problem is highlighted and a corresponding error message is shown:

It is generally not permitted to save a malformed XML document, but XML Spy gives you a "Save anyway" option when the automatic well-formedness check upon saving fails. This is useful, when you want to suspend your work temporarily and resume it later, without being able to make the intermediate version of the file well-formed.

The Check well-formedness command normally operates on the active main window. You can also use the Check well-formedness command on any file, folder, or group of files in the active project window. Click on the respective folder, and then on the "Check well-formedness" icon.


Validate

Validate

This command validates an XML document against the rules set forth in its Schema or Document Type Definition (DTD) or it can validate any XML Schema or DTD against the rules set forth in the corresponding specification.

XML Spy uses its built-in incremental validating parser that supports all major Schema dialects, such as DTD, DCD, XDR, XML-Data, BizTalk, and the new W3C XML Schema Definition Language (XSD) .

If the validation succeeds, a brief message is displayed at the bottom of the main window:

valid

If an error is encountered during the validation, the source of the problem is highlighted and a corresponding error message is shown:

The Validate command also automatically includes a well-formedness check, so there is no need to first use the Check well-formedness command manually before validating a file.

Please note that you can use this command to validate XML instance documents and for validating XML schemas or DTDs.

This command normally operates on the active main window, but you can also use the Validate command on any file, folder, or group of files in the active project window, where you can also define the Schema or DTD to validate with on a per-folder basis in the project properties. Click on the respective folder, and then on the "Validate" icon.


Validate XML

Validate XML

When you validate an XML document, XML Spy first tries to locate any reference to a supported schema dialect within the document. It then loads the corresponding schema or DTD into memory, and uses its definitions to validate your XML instance document.

Once the Schema or DTD has been loaded into memory, XML Spy also provides you with intelligent editing functions in the Info Window and Entry-Helpers.

As long as the XML instance document is open, XML Spy will also keep the Schema or DTD in memory (see the Flush Memory Cache command on the DTD/Schema menu).


Validate Schema

Validate Schema

XML Spy supports all major Schema dialects, such as DTD, DCD, XDR, XML-Data, BizTalk, and the new W3C XML Schema Definition Language (XSDL)

Validate these schemas against their specification by clicking on the Validate button. You can then be sure that they can be used to create, edit, and validate XML instance documents that are based on these schemata.


Update Entry-Helpers

Update Entry-Helpers

This command updates the Entry-Helper windows, by reloading the underlying DTD or Schema.

If you have modified the Schema or DTD that an open XML document is based upon, it is advisable to reload that Schema or DTD to update the intelligent editing information (such as the Entry-Helper and Info windows) presented in the XML document, to reflect your changes.


Namespace Prefix...

Namespace Prefix...

This command lets you set the namespace prefix (identifier) for a group of selected elements (including their child elements).

You can choose to set the namespace prefix on either elements, attributes, or both.

Please note:
Attributes don't need to have the same prefix as their parent elements, since attributes always inherit the element's namespace, if no prefix is given.


DTD/Schema Menu

DTD/Schema Menu

XML Spy contains many commands that let you operate with Schemas and Document Type Definitions (DTDs) efficiently.

You can:
· Assign DTDs or Schemas to be used for validation with any XML instance document
· Generate a Schema from an example XML document (or from a group of files in the project window)
· Convert between all major schema dialects, and
· Locate the definition of any element or attribute in the corresponding schema while editing your XML documents.
· Generate a sample XML file based on an existing schema.


Assign DTD...

Assign DTD...

This command assigns a Document Type Definition (DTD) to an XML document to enable Validation and Intelligent editing.

The command opens the Assign File dialog to let you specify the DTD file you wish to assign, and inserts the required DOCTYPE statement into your XML document:

<!DOCTYPE main SYSTEM "http://link.xmlspy.com/spyweb.dtd">


Assign Schema...

Assign Schema...

This command assigns a Schema to an XML document to enable Validation and Intelligent editing.

The command opens the Assign File dialog to let you specify the XSD, XDR, or BizTalk schema file you wish to assign, inserts the required namespace declaration attributes into your XML document:

xmlns="http://www.xmlspy.com/schemas/icon/orgchart"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:schemaLocation="http://www.xmlspy.com/schemas/icon/orgchart http://schema.xmlspy.com/schemas/icon/orgchart.xsd"

The declarations generated by XML Spy depend on the Schema kind and - in case of the new W3C XML Schemas - also on the potential use of a targetNamespace in the Schema document.


Include another DTD...

Include another DTD...

This command allows you to include another Document Type Definition (DTD) or external parsed entity into the internal subset of a document type definition, or in any DTD document. This is done by defining a corresponding external parsed entity declaration and using that entity in the following line:

<!ENTITY % navigation.dtd SYSTEM "S:\xml\navigation.dtd">
%navigation.dtd;

The command opens the Assign File dialog to let you specify the DTD file you want to include in your DTD.


Go to DTD

Go to DTD

This command opens the Document Type Definition document (DTD) on which the current XML document is based.


Go to Schema

Go to Schema

This command opens the Schema document (XSD) on which the current XML document is based.


Go to Definition

Go to Definition

.

This command displays the exact definition of an element or attribute in the corresponding Document Type Definition or Schema document.

To see the item definition in Enhanced Grid view:
1. Click left on the item.
2. Select the menu item DTD/Schema | Go to Definition, or click on the icon.

To see the item definition in Schema design view:
1. Use CTRL + Double click on the item you want to see the definition of, or
2. Click the item and select menu option DTD/Schema | Go to Definition, or click on the icon.

In both cases, the corresponding DTD or Schema file is opened, and the item definition is highlighted.


Generate DTD/Schema...

Generate DTD/Schema...

This command generates a new DTD or Schema from an XML document (or from a set of documents in the project window).

Use this function when you are defining a new schema or DTD, as it is often helpful to use an example XML document as a starting point.

If you are targeting one of the modern schema kinds (e.g. XSD or BizTalk), XML Spy can automatically detect datatypes (such as date, time, number, URI, etc.) being used in your XML documents and create the corresponding restrictions in the schema.

XML Spy will also optionally detect typical enumeration scenarios, where an element or attribute can only contain items from a predefined list of values. You can also decide how to represent complex elements and how elements that only appear only once should be treated.

This command normally operates on the active main window, but you can also use the Generate DTD/Schema command on any file, folder, or group of files in the active project window.


Convert DTD/Schema...

Convert DTD/Schema...

This command converts an existing DTD (or Schema) into an XML Schema compliant with the May 2nd 2001 Recommendation, or any of the other available schema dialects.


Generate sample XML file

Generate sample XML file

This command generates an XML file based on the currently active schema in the main window.

Generate non-mandatory attributes
Activating this option generates all mandatory and non-mandatory attributes defined in the schema.

Generate non-mandatory elements
Activating this option generates all mandatory and non-mandatory elements defined in the schema.

Generate first choice of mandatory choice
Activating this option generates/inserts the first choice of a mandatory choice.

Generate "1" elements if marked repeatable in Schema/DTD
Activating this option generates the number of repeatable elements you enter in the text box.

Fill elements and attributes with data
Activating this option inserts the data type descriptors/values for the respective elements/attributes. Eg. Boolean = 1, xsd:string = string, Max/Min inclusive = the value defined in the schema.


Flush Memory Cache

Flush Memory Cache

This command flushes all cached Schema and DTD documents from memory.

To speed up validation and intelligent editing, XML Spy caches all recently used DTD, external parsed entity, and Schema documents in memory. Information from these documents is also displayed, when you are using the Go to Definition command.

Use this command if memory is tight on your system, or if you have been using many different documents based on different schemas recently.


Schema design Menu

Schema design Menu

The Schema design menu allows you to:
· Define your schema settings
· Save a component diagram
· Generate Schema documentation in as much detail as you wish, and
· Define how much element information you want to display during editing.


Schema settings

Schema settings

This command lets you define the global schema settings.

You set the Default Element Form to Qualified or Unqualified. The same can be defined for the Default Attribute form. These defaults can be changed for each element or form in the Details entry helper.

Enter the Block and Final defaults in the respective text boxes, and enter the schema version number in the Version field.

Click on the "Target namespace" radio button, and enter the namespace if you want to include it.

You can see these settings if you switch to the Text view of XML Spy.


Save Diagram...

Generate Documentation...

This command saves the component graphic (content model in the main window) in PNG format.


Generate Documentation

Generate documentation

This command generates detailed documentation about your schema.

Documentation is generated for each element using the settings you define in the dialog box. Related elements (child elements, complex types etc.) are hyperlinked, enabling you to navigate from element to element. The element symbols in the content model diagrams are also hyperlinked, enabling you to see their definitions by clicking on them.

Schema documentation is also generated for schema components included in a schema document.

Output format:
You can output your schema documentation in HTML or Word format.

Include:
Select which items you want to include in the documentation: index (if you include other schemas components) global elements, groups, complex types etc.

Details:
Select the details you want to include in the documentation: diagram, attributes, facets, source code etc. The Diagram option includes the graphical representation of each schema item in the document.

Show result after export:
Activating this option generates the documentation and displays it immediately after the export process is complete. If you select HTML, the HTML document appears in the Browser view of XML Spy. Selecting Word creates and displays the Word document.

Example 1:

Example 2:
Schema documentation showing the index and the included schema components from the address.xsd schema.


View config

View config

This command allows you to configure the content model view.

The dialog box opens at the bottom right of the XML Spy window, giving you room to see changes reflected in the content model immediately.

The settings you define here, apply to the schema documentation output as well the printer output.

To define the data to appear in the content model:
1. Click the Append [image] or Insert [image] icon to add a line.
2. Select the parameter you want to display from the combo box.

The content model view is updated, showing the parameter(s) you selected.

To delete a line/parameter from the content model:
1. Select the line you want to delete.
2. Click the Delete icon [image].

Single line settings:
You can define if the lines are to contain single or double content, and the parameters to be displayed in each case. You can also define if the line is mandatory or only visible if it contains data.

Please note:
You can define the single/double setting for each line. Select the line you want to configure and click the single or double content radio button.

Common line settings
This option toggles the line descriptions on and off.

Widths
These sliders enable you to set the min. and max. size of the element rectangles in the content model view. Change the sizes if parameter text is not fully visible, or you want to standardize your display.

Distances
These sliders let you define the horizontal and vertical distances between various elements on screen.

Show in diagram
The Annotations check box toggles the display of annotation text on or off, as well as the annotation text width with the slider. You can also toggle the display of the substitution groups on or off.

Draw direction
These options define the orientation of the element tree on screen, horizontal or vertical.

The Load/Save button allows you to load and retrieve the settings you make here.
The Predefined button, resets the display configuration to default values.
The Clear all button empties the list box of all entries.

Content model editing
You can change element parameters/values directly in the content model.

· Double click the cell of the element (table) you want to edit and start entering data. If a selection is possible, a drop down list appears if not, enter the parameter or value and confirm the entry with the Return key.

The entry helpers will be updated at this point, reflecting the data you entered.


Zoom

Zoom

This command controls the zoom factor of the content model view.

Drag the slider to see to change the zoom factor directly, or click in the entry box and enter the numeric value.


Display all Globals

Display all Globals

This command displays the global components in the Schema overview, and is only available when you are viewing the content model of a component.

Alternatively:
· Click the "Show Globals" icon [image] to return to the Schema Overview.


Display Diagram

Display Diagram

This command displays the content model of the currently selected component.

To see the content model of a component:
· Click on the [image] icon next to the component you want to display, or
· Select the menu option Schema design | Display Diagram, or
· Double click on a component name in the "Component Navigator" (Top right entry helper).


Enable Oracle Schema extensions

Enable Oracle Schema extensions

XML Spy provides preliminary support for Oracle schema extensions for use with "Project XDB".

Using these extensions will allow you to configure and customize how the Project XDB version of Oracle 9i, will store XML documents internally. These XML documents are then accessible from an XML perspective as well as through SQL queries and legacy tools.

Please see the Oracle.com website for more information.

Selecting this menu option inserts an Oracle.com/xdb namespace into the schema file

and makes an Oracle tab available in the Details entry helper.

Oracle extensions can be defined for elements, attributes and complex types. Use the entry helpers to define the schema settings in the same was as you normally would with XML Spy.

Please note:
Disabling this menu option deletes all the Oracle schema extension information from your schema file. A warning message appears, allowing you to reconsider. Confirming this action with OK, deletes all the info. This action cannot be undone!


Oracle Schema settings

Oracle Schema settings

This command allows you to define the global settings for Oracle schema extensions.

You have to have previously enabled the Oracle schema extensions, using the menu option "Enable Oracle schema extensions", to be able to access this menu option.


Enable Microsoft SQL Server Schema Extensions

Enable Microsoft SQL Server Schema Extensions

XML Spy provides support for Microsoft SQL Server 2000 Schema Extensions.

Using these extensions will allow you to configure and customize how SQL Server stores XML documents internally. These XML documents are then accessible from an XML perspective as well as through SQL queries and legacy tools.

Please see the microsoft.com website for more information on SQL Schema Extensions.

Selecting this menu option inserts a SQL namespace into the schema file

and makes a SQL Server tab available in the Details entry helper.

SQL extensions can be defined for elements, attributes and complex types. Use the entry helpers to define the schema settings in the same was as you normally would with XML Spy.

Please note:
Disabling this menu option deletes all the SQL Server schema extension information from your schema file. A warning message appears, allowing you to reconsider. Confirming this action with OK, deletes all the info. This action cannot be undone!


Named Schema Relationships...

Named Schema Relationships...

This command allows the definition of named relationships to provide the information needed to create the document hierarchy. You have to have previously enabled the SQL Server schema extensions, using the menu option "Enable SQL Server Schema Extensions", to be able to access this menu option.

To create a named schema relationship:
1. Click the insert [image] or append icon [image], to add a new row to the dialog box.
2. Click the field and enter the corresponding relationship name.
3. Click OK to confirm the entries.

This generates a SQL relationship element, placing it just after the namespace declaration.

Please note:
Click the delete icon [image], to delete a row from the dialog box.


Unnamed Element Relationships...

Unnamed Element Relationships...

This command allows the definition of unnamed relationships to provide the information needed to create the document hierarchy. You have to have previously enabled the SQL Server schema extensions, using the menu option "Enable SQL Server Schema Extensions", to be able to access this menu option.

To create an unnamed schema relationship:
1. Click the insert [image] or append icon [image], to add a new row to the dialog box.
2. Click the field and enter the corresponding relationship name.
3. Click OK to confirm the entries.

This generates a SQL relationship element for the currently selected schema element.

Please note:
Click the delete icon [image], to delete a row from the dialog box.


XSL Menu

XSL Menu

The eXtensible Stylesheet Language (XSL) and in particular the XSL Transformation (XSLT), lets you specify let you specify how an XML document should be converted into other XML documents or text files, such a HTML, XHTML, or WML pages.

XML Spy supports XSL and XSLT through both its Intelligent editing features in the Text and Enhanced Grid Views, as well as through a set of commands that lets you perform common XSL-related operations.

Please see the technical background information on XSLT Processors for further details.


XSL Transformation

XSL Transformation

Hotkey: F10

This command performs an XSL Transformation of any XML document.

XML Spy can either use the Microsoft-supplied MSXML module or you can specify an external XSLT processor in the XSL tab on the Tools | Options dialog. You can also download other XSLT processors using the Help | Components Download menu option.

If your XML document contains a reference to an XSL stylesheet, which can be assigned using the Assign XSL command, the it is automatically used by the XSLT transformation command. Alternatively, you can also define the XSLT stylesheet to transform from, on a per-folder basis in the project properties (Select Project | Project Properties to open this dialog).

This command generally operates on the currently active main window, but you can also use the XSL Transformation command in batch-processing mode on any file, folder, or group of files in the active project window.

Please see the technical background information on XSLT Processors for further details.


XSL:FO Transformation

XSL:FO Transformation

Hotkey: CTRL+F10

This command performs an XSL: FO Transformation of an XML document containing XSL Formatting Object markup. XSL Formatting Objects let you specify document layout: margins, text direction, pagination etc. of your XML documents.

XML Spy uses Apache Software Foundation's FOP tool to transform the FO file.

You can output the FO file:
· Directly onto screen using the built-in FOP viewer
· or generate an output file enabling you to create a PDF file, a TXT file, an Area tree (XML), a MIF file, a PCL or PS (postscript) file.

You can download the Apache FOP processor using the Help | Components Download menu option.

The FOP batch file path needed to start the FOP processor can be edited in the XSL tab on the Tools | Options dialog.

This XSL:FO command generally operates on the currently active main window, but you can also right click any file, folder, or group of files in the active project window and select the XSL:FO Transformation command to transform and display or output the document.


Transforming with XSL:FO

Transforming with XSL:FO

As an XSL FO file is an XML document, it must begin with the standard XML processing instruction and the FO root element.

To create a new FO document:
1. Select the Menu option File | New.
2. Click the .fo Formatting Objects entry, and confirm with OK.

This creates an empty FO document containing the XSL FO declaration.

3. Enter the FO markup between the <fo:root> start and </fo:root> end tag.

To transform an existing FO document:
1. Open a FO document in XML Spy. This example uses the tiger.fo document in the tutorial folder:
2. Select the menu option XSL | XSL:FO or click the FO icon in the title bar.
This opens the "Choose XSL:FO output" dialog box.

3. Clicking OK, causes the FO document to be transformed and displayed in the FOP viewer. Click the Next icon in the viewer, to see the next page of this document.
4. Close the window viewer window when you want to return to XML Spy. Click the print icon to print icon if you want to print the document.

5. Clicking the "Generate output file" radio button enables you to select the specific type of output you want to create. Confirming with OK creates the output you choose.


Assign XSL...

Assign XSL...

This command assigns an XSL stylesheet to an XML document, enabling XSL Transformation or rendering by an XML-compatible browser.

The command opens the Assign File dialog to let you specify the XSL or XSLT file you want to assign, and inserts the required processing instruction into your XML document:

<?xml-stylesheet type="text/xsl" href="http://link.xmlspy.com/main.xsl"?>


Go to XSL

Go to XSL

This command opens the corresponding XSL or XSLT document, if your XML document contains a reference to an XSL stylesheet.


Document Editor Menu

Document Editor Menu

XML Spy Document Editor enables you to edit XML documents based on templates created in XSLT Designer! The templates in XSLT Designer are saved as *.sps files, and supply all the necessary information needed by Document Editor.

Templates are opened by Selecting the File | New command and then clicking the "Select a Document Editor template..." button. Please see the Document Editor documentation for further information.

XML Spy Document Editor is available in three versions:
· As a stand-alone application,
· Integrated as a separate view within the XML Spy IDE user-interface (if you purchase the XML Spy Suite product), or
· As a Browser Plug-In for Internet Explorer.


Assign configuration file...

Assign configuration file...

This command assigns a Spy Structure file (SPS) to an XML document to enable viewing and editing in the Document Editor view.

The command opens a dialog box enabling you to specify the SPS file you wish to assign, and inserts the required SPS statement into your XML document.


Hide markup

Hide markup

This command hides markup symbols in the Document Editor view.


Show small markup

Show small markup

This command shows small markup symbols in the Document Editor view.


Show large markup

Show large markup

This command shows large markup symbols in the Document Editor view.


Show mixed markup

Show mixed markup

This command shows mixed markup symbols in the Document Editor view.


Append row

Append row

This command appends a row to the current table in the Document Editor view.


Insert row

Insert row

This command inserts a row into the current table in the Document Editor view.


Duplicate row

Duplicate row

This command duplicates the current table row in the Document Editor view.


Move row up

Move row up

This command moves current row up by one row in the Document Editor view.


Move row down

Move row down

This command moves the current row down by one row in the Document Editor view.


Delete row

Delete row

This command deletes the currently active row in the Document Editor view.


Convert Menu

Convert Menu

XML Spy provides powerful data exchange functions that allow you to convert back and forth between text, word processor, database, and XML files. You can also create a schema from an existing database as well as create a database, based on an existing schema.


Import Text file...

Import Text file...

This command lets you import any structured text file into XML Spy and convert it to XML format immediately. This is useful when you want to import legacy data from older systems, as most software products support a text export interface of some kind.

Unicode conversion
In order to convert the data into Unicode (the basis of all XML documents), you need to specify which character-set the file is currently encoded in.

For US or Western European Windows systems this will most likely be Codepage 1252, also referred to as the ANSI encoding. If you are importing 16-bit or 32-bit Unicode (UCS-2, UTF-16, or UCS-4) files, you can also switch between little-endian and big-endian byte order.

Field Delimiter
To successfully import a text file, you need to specify the field delimiter that is used to separate columns or fields within the file. XML Spy will auto-detect common row separators (CR, LF, or CR+LF).

Text enclosed in
Text files exported from legacy systems sometimes enclose textual values in quotes to better distinguish them from numeric values. If this is the case, XML Spy lets you specify what kind of quotes are being used in your file, and removes them automatically when the data is imported.

First row contains field names
It is also very common for text files to contain the field names in the first row within the file. XML Spy allows you to define your XML element or attribute names according to this information.

Choose file
Click on the "Choose file" button to select the specific file to be imported, after having defined the import parameters. The file name will be retained the next time you use this dialog box, allowing you to change settings and re-import the same file if the resulting XML file does not match your expectations.

Having selected the file to be imported, XML Spy provides a preview of the data import. Any changes in the above options will be reflected in the preview immediately.

Renaming field or column names
Rename a field or column name by clicking on its title and editing the name.

Attribute, Element, or no columns
XML Spy lets you choose if you want to import a column as an attribute, element, or if you'd rather skip the column entirely.

Click on the icons to the left of the column titles to, toggle between these three options. In the example above,
ContactID and CallDate - are imported as attributes
CallTime - is not imported
Subject - is imported as an element.


Import Database data...

Import Database data...

This command lets you import database data from many sources.

You can select:
· an existing database: such as Microsoft Access (i.e. Jet Engine), SQL Server, Oracle, or any other ODBC or ADO-conformant database).

Source database
Once you have selected your data source, you can choose the database table to be imported from a list. If you need help in entering an ADO connection string, click the Build button, which opens the ADO Data Link properties dialog box.
To define the ODBC connection string, please see: Setting up the ADO or ODBC connection string using the Data Source Administrator.

Selection statement
Click on the "Choose database table" button, to select the database, or enter an arbitrary SELECT statement to create the record-set you intend to import. You can also enter a ADO shape string (selection statement) if you selected the ADO connection string radio button.

Having configured the data source, click the Preview button to verify that this is indeed the correct data that you wish to import. For security reasons, the OK button is only enabled after you have previewed the data.

Please note:
If you used the menu option Convert | XML Import based on DB Schema prior to opening this dialog box, the automatically generated select statement (used in that process) will appear in Select statement text box. You can now reuse or edit the select statement and start a new import.

Format of Number, Date and Time values
XML Spy lets you choose different representations for date and number formats - depending on whether you intend to use the resultant XML file in conjunction with the new unified datatypes proposed by the most recent XML Schema draft, or if you want to keep those formats corresponding to the locale in use in your country.

Import data as Elements/Attributes
These options let you specify how you want the parent and child elements to be imported: as elements or attributes. The preview is updated when you select one of these options.

Exclude Primary/Foreign keys
This option enables you to exclude the primary or foreign keys for all the tables you are importing.

Please note:
This option only affects the keys of database tables that have been exported using the XML Spy Conversion option "Export to Text files / Database...", with the "Create Primary/Foreign keys" being active. The key names are PrimaryKey and ForeignKey respectively.

Create empty elements from empty fields
This option lets you create empty elements for all the empty fields that exist in the tables you import.

Attribute, Element, or no columns
XML Spy lets you choose if you want to import a parent column as an attribute, element, or if you'd rather skip the column entirely.

Click on the icons to the left of the column titles, to toggle between these three options. In the example above,
ContactID - is imported as an attribute
Contacts.Company - is not imported
FirstName, LastName - are imported as elements.

Please note:
The selections you make here initially apply to the parent items as well. Changing parent items directly, takes precedence over these settings, but only applies to the parent elements and not to any child elements.
Clicking the Preview button, resets any changes made to the parent elements in the Preview view.


ADO connection string

ADO connection string

If you need help in entering an ADO connection string, click the Build button, which opens the ADO Data Link properties dialog box.

ADO Data Link properties dialog box:

Select the corresponding OLE DB Provider from the list and click on the Next button to enter the connection properties:

XML Spy relies on the ActiveX Data Object (ADO) interface for much of the basic database connectivity. ADO is included with Windows 2000 and Microsoft Office 2000, but you may need to install it if you are using an older version of Windows or Office.

Please see the Setting up the ADO or ODBC connection... for an alternative method of doing the same thing.

Please note:
Activate the "Allow saving password" check box, to enter your password info into the connection string, and avoid an error message when the connection takes place.

Please refer to our FAQ for more information on ADO and to download the Microsoft Data Access Components (MDAC) which allow you to upgrade to the latest ADO version. We also recommend that you visit the Microsoft Universal Data Access site on the Internet.

After you have imported your data and converted it to XML format, you may also want to use the Generate DTD/Schema function to get all the datatype information you need from your database into your XML documents.

XML Spy now makes it possible for you to convert a database into a schema. MS Access and several other databases are able to automatically provide the key and keyref information for the ADO driver, used to create the database hierarchy.

Please see the section under the Convert menu | Create Database Schema for more information.


Import Microsoft Word document...

Import Microsoft Word document...

This command enables the direct import of any Word document and conversion into XML format, if you have been using paragraph styles in Microsoft Word. This option requires Microsoft Word or Microsoft Office (Version 97 or 2000).

When you select this command, the Open dialog box appears. Select the Word document you want to import.

XML Spy automatically generates an XML document with included CSS stylesheet. Each Word paragraph generates an XML element, whose name is defined as the name of the corresponding paragraph style in Microsoft Word.


Create Database Schema

Create Database Schema

XML Spy enables you to create a schema based upon an external database file. Microsoft Access databases, as well as ADO and ODBC compatible databases, are supported.

To create a schema from a database file:
1. Select the menu option Convert | Create Database Schema.

2. Select Microsoft Access database, and click the Choose file button.
3. Select the DB2schema.mdb file supplied with XML Spy, and click the Open button.
4. Click the OK button of the Create Database Schema dialog box, to start the conversion process.

The generated schema appears in the Schema Design View. Click the "Identity constraints" tab, to see the keyref and key fields of the respective elements.

5. Click the component icon [image] next to the Altova global element, to see the content model.

6. Select the menu option File | Save as, and save the new schema e.g. DB2schema.xsd.
7. Click the Display all globals icon [image], to return to the schema overview.

Please note:
When generating the schema, all namespace prefix colons are automatically converted into underscore characters.

Databases currently supporting the key and keyref fields:
MS Access and several other databases are able to automatically provide the key and keyref information for the ADO driver, used to create the database hierarchy.

To create relationships for NON MS Access databases:
1. Click the "ADO connection string" radio button in the Create Database Schema dialog box.

2. Click the Build button that has now become active.
This opens the Data Link Properties dialog box.
3. Select the corresponding Microsoft OLE DB Provider (or vendor specific provider) for the database you use, do not select one of the generic drivers.

4. Click the Next button to switch to the Connection tab and fill in the required information: the data source, the user name and password, and activate the Allow saving password check box.
5. Click the Test Connection button to test the connection, and Click OK to confirm the settings.

6. Click OK in the Create Database Schema dialog box, to create the schema.

To convert from... SQL server databases:
· Select the Microsoft OLE DB provider for SQL server provider.

To convert from Oracle... databases:
· Select the Microsoft OLE DB provider for Oracle provider.

To convert from... MS Access:
· Click the Microsoft Access Database radio button in the Create Database Schema dialog box. This selects the correct provider, there is no need to use the ADO connection string and Data Link Properties dialog box.
· If however, you want to build the connection string yourself, please use the MicrosoftJet 4.0 OLE DB provider.

To convert from... Other databases:
· Select the corresponding Microsoft OLE DB, or vendor specific provider, from the Data Link Properties dialog box.

To convert from... databases without a specific provider:
Other databases will create a flat structured schema, including all tables and their corresponding datatypes.

· Use drag and drop in the schema overview, to create the necessary relations between the imported elements.

· To create an element hierarchy you have to directly edit the key and keyref fields, visible in the Identity constraints tab. Please see "Creating Identity Constraints" in the Reference manual for more information.


XML Import based on DB Schema

XML Import based on DB Schema

XML Spy allows you to create an XML document containing database data based on an existing XML Schema. You must currently create the schema (on which the import is based) using the menu option Convert | Create Database schema.

In the case of an MS Access database the Identity constraints, which define the database hierarchy, are automatically created in the generated schema. For other databases you have to define the identity constraints in the schema file yourself, please see Creating identity constraints.

Specifying the data you want to import
You can specify the data set you want to import, by defining which table is to act as the root table of the imported data set. This then automatically creates a shape string which is placed in the Selection statement text box. The database data is then imported into XML Spy with all hierarchical relationships intact.

The source database can be a Microsoft Access database or you can build an ADO connection string to connect to the database of your choice.

To import XML data from a Microsoft Access database:
1. Open the DBschema2xml.xsd schema file supplied with XML Spy (Tutorial folder).

2. Select the menu option Convert | XML Import based on DB Schema.
This opens the "Select root table from database schema" dialog box. This is where you define which tables you want to import. The root table becomes the top level table in the table hierarchy you import.

3. Click the OK button when you have selected the root table.
The "Database import based on Schema" dialog box opens. The select statement, based on your root element choice, is automatically generated and placed in the Select statement text box.

Please note:
You cannot edit the select statement here! You can however, start a new import using the Convert | Import database data... command. The same shape string will then appear in the Select statement text box, where it can be edited.
4. Click the Microsoft Access database radio button.

5. Click the Choose file button, and select and select the "DB2schema.mdb" file as the source of the database data (in the Tutorial folder).
6. Click the OK button to import the database data.
The XML document appears as an "Untitledx.xml" file in the main window.

7. Click the Altova element and select the menu option XML | Table | Display as table, or press the F9 function key, to remove the table formatting and display the data vertically. The Division elements were treated the same way to produce the screen shot below.

In this case the complete database was imported, the root table being Altova. The item Altova Name, was imported as an attribute in keeping with the schema definition DBschema2xml.xsd (visible in the attribute tab of the schema at the beginning of this section).

Importing a partial data set:
1. Repeat the above sequence and select Division as the root table.
2. Use the DB2schema.mdb file as the data source.
The screen shot shows the resulting XML document. The Person table is expanded and the Division table formatting is disabled for a better overview.


Create DB Structure based on Schema

Create DB Structure based on Schema

XML Spy allows you to create an empty database (or skeleton database) based on an existing schema file. The schema structure, defined by the identity constraints, is mirrored in the resulting database.

To create a Database based on a schema:
1. Open the schema file DB2Schema.xsd in the Tutorial folder.
2. Select the menu option Convert | Create DB Structure based on Schema.
3. Click the "Create a new MS Access database" radio button and confirm with OK.

4. Enter the database name in the Save as... dialog box (eg. DB-based-xsd.mdb).
The message "Export has been successfully completed" appears when the export has been completed successfully, confirm with OK.

Viewing the generated Database:
1. Double click the DB-based-xsd.mdb file in Explorer, or open the file in MS Access.

2. Double click the Division entry to see the Division Table.

3. Select the menu option View | Design view, or click the "View" icon to change into the Design view.

The Design view supplies information on the field properties of the database table: the field names, data types, etc. The parameter settings you see here have been transferred from the schema definition.


Export to Text files / Database...

Export to Text files / Database...

This command exports XML data into other formats for exchange with databases or legacy systems.

Depending on the output data format required, you may want to use either XSLT Transformations or this Export command to export your XML data.

You first need to define the structure of the data to be exported. Since XML is structured hierarchically and most database and legacy systems use the relational model, XML Spy will help you in producing output that can be interpreted in a relational context.

Start point of export
You can choose to export the entire XML document or restrict your export to the data starting from the currently selected element (and its child items).

Export fields
Depending on your XML data, you may want to export only elements, attributes, or the textual content of your elements into the fields common to structured text files or databases.

The list of available element types, in the preview window, lets you choose which elements you want to export, and also displays you how many records and fields this will produce once the export operation is started.

Export depth
You can choose to export all sub-elements, or limit the number of sub-element levels.

Automatic fields
XML Spy will produce one output file or table for each element type selected. You can choose to automatically create primary/foreign key pairs to link your data in the relational model, or define a primary key for each element.

When you are finished defining the scope of your export operation, click one of the two "Export" buttons, to export your data to a set of text files or to a database.


Export Database

Export Database

This command button allows you to specify the type of database you want to export your data to.

You can select the destination database and the action to be performed:
· Create a new Microsoft Access (Jet Engine) database file
· Add the data to the tables in an existing Access file, or
· Export the data to any other ODBC or ADO-compliant database system (such as SQL Server or Oracle).
· The Namespace options allow you to either exclude the namespace prefix, or replace the namespace prefix colon with an underscore character.

The Build button lets you create the necessary ADO connection string - for more information see the Import Database command and ADO connection string.


Export Text File

Export Text File

This command button allows you to specify the formatting of the text files to be exported.

If you are exporting XML data to text files, you must specify the desired character-set encoding to be used. The same options are also available in the Import text file dialog box.

The set of text files will be generated in the folder you specify, and each file name will be generated from the corresponding element name. You can also specify the file extension to be used.


Convert - How to...

Convert - How to...

The How to... sections in this manual go into more detail about a specific subject in a task oriented way, and are generally sequential in nature. Tasks may build upon previous ones and may also use their data (or files) further on in the section.

In this section you will learn how to:

· Export hierarchical XML data, using the Data_shape.xml file supplied with XML Spy, and create a MS Access database called "Data_shape.mdb".

· Define an ODBC (and ADO) connection to the "Data_shape.mdb" database.

· Import a single table using the ODBC connection.

· Import specific (hierarchical) portions of the database data, using ADO data shape commands.
· Create Identity constraints in a schema, enabling you to import database data hierarchically - or create an XML document based on a database schema.

Files used in this How to... section:

· Data_shape.xml file, from which you will create a MS Access database
· Shapes.txt file, a file containing all the shape strings used in this section to import data using the ADO shape string function
· No-constraints.xsd file, for which you will create Identity constraints, enabling you to import specific data sets hierarchically.


Exporting hierarchical data

Exporting hierarchical data

To export hierarchical data:
1. Open the Data_shape.xml file supplied with XML Spy.

2. Select the menu option Convert | Export to Text files / Database.

Retain the default settings as they are, all check boxes are active.
3. Click the "Export to database" button, and select the Create a new Microsoft Access Database radio button. Confirm with OK.

4. Enter the name of the new database in the "Save as..." dialog box (eg. Data_shape.mdb), and confirm by clicking on the Save button.
5. Once the export process has been successfully completed, click OK to confirm.

· Double clicking the Data_shape.mdb file, opens it in MS Access. The exported database appears in this form:


Setting up the ADO or ODBC connection using the ODBC Data Source Administrator

Setting up the ADO or ODBC connection using the ODBC Data Source Administrator

This example uses Microsoft Access as the target database. The exported data can be imported using either an ODBC or an ADO data connection.

To set up a Database connection:
1. Click the Start button and select Settings | Control Panel. Then double click the Administrative tools folder.

2. Double click the Data Sources (ODBC) icon, to open the ODBC Data Source Administrator dialog box.

3. Click the Add... button to define a new data source.

4. Select the Microsoft Access Driver (*.mdb) driver for the data source, and click the Finish button.

5. Enter "shape" as the Data Source Name, and enter a description in the Description field.
6. Click the Select button and select the previously exported database (Data_shape.mdb). Confirm the selection with OK.
The file name and path appear above the Select button.
7. Click the OK button to confirm these settings. The Data Source Name "shape" appears in the User Data Sources list.

8. Click the OK button to complete the connection setup, and close or minimize the Administrative Tools folder.
You are now ready to import MS Access table data hierarchically into XML Spy.
9. Switch back to XML Spy to start the import process.


Importing a table using ODBC

Importing a table using ODBC

ODBC currently only supports the importing of a single database table, hierarchical data cannot be imported using this method.

To import a table using ODBC:
1. Select the menu option Convert | Import Database data...

2. Click the ODBC connection string radio button, and then the Build button.

3. Click the Machine Data Source tab, select the previously defined "shape" data source, and click the OK button. The ODBC connection string now appears in the text box.
If a User name and Password dialog box is opened at this point, enter the information as requested.

4. Click the Choose database table button and select the database table you want to import (in this case Person). The select statement SELECT * FROM "Person", appears in the Selection statement text box.
5. Click the Preview button to see the database data.
6. Activate the Exclude Primary/Foreign Keys check box, to avoid importing the key fields (this only applies to key fields that were created by XML Spy during the export process).

Defining which fields to import:
The preview window allows you to directly select and define the field data you want to import.
Clicking repeatedly on the element symbol [image] to the left of the element name, cycles through the available possibilities:

Define and import this field as an Element.
Define and import this field as an Attribute.
Skip, do not import this field.

Starting the data import:
1. Click the OK button of the database import dialog box, when you have decided which fields you want to import (no changes in this example).

XML Spy creates an untitled XML file containing the Person table data. The root element is called Import, and each Person element is a table row.


Importing hierarchical data - Data shaping (ADO)

Importing hierarchical data - Data shaping (ADO)

XML Spy allows you to import hierarchical database data using the ADO data shaping function. This allows you to re-import specific parts of external databases.

You can either write your own selection strings or have XML Spy automatically create them using the Create Database schema and then the XML Import based on DB Schema commands.

To be able to use data shaping you have to use:
· The MSDataShape provider
· The special Data shape language, which is a subset of SQL

Both these modules are available if you have installed Microsoft Data Access Components Version 2.6 or later.

To import hierarchical data into XML Spy:
1. Select the menu option Convert | Import Database data...

2. Click the ADO connection string radio button, and then the Build button.

3. Double click the MSDataShape entry in the list box.
This automatically switches you to the Connection tab.

4. Enter "shape" in the Data Source field.
5. Click on the "Test Connection" button (at the bottom of the dialog box), if you want to make sure you can connect to the database - and then click OK to close the Test connection message box.
6. Click OK to close the Data Link Properties dialog box.

The ADO connection string now appears in the text box.
7. Open the shape.txt file supplied with the tutorial; copy the first Shape select statement, and paste it into the Selection statement text box.

8. Click the "Preview" button to see a portion of the database data.

· Only the top level (parent) of the database data, defined by the shape command, is visible in the preview window.

Defining how the parent elements will be imported
The preview window allows you to directly select and define the field data you want to import.

Clicking repeatedly on the element symbol [image] to the left of the element name, cycles through the available possibilities:

Define and import this field as an Element.
Define and import this field as an Attribute.
Skip, do not import this field.

Please note:
You can only directly influence the parent elements that you see here. You cannot change or choose to skip any elements below these ones (i.e. child elements).

Defining how the child elements will be imported
While the shape string allows you to import child objects, you can only define that all child items are to be imported as Elements or Attributes.

· Select either the Elements by default or Attributes by default option, to define how you want to import the child elements. The preview is updated when you select one of these options.
· Activate or deactivate the "Exclude Primary/Foreign keys" check box, to define if you want to import the data with or without primary or foreign keys.
· Activate or deactivate the "Create empty elements from empty fields" check box, to define if you want empty elements to be created for those fields that do not contain any data.

Please note:
The selections you make here initially apply to the parent items as well. Changing parent items directly, takes precedence over these settings, but only applies to the parent elements and not to any child elements.
Clicking the Preview button, resets any changes made to the parent elements in the Preview view.

Starting the data import
1. Click the OK button of the Database import dialog box, when you have completed your definition of the data you want to import.

XML Spy creates an untitled XML file containing the Division and Person table data. The root element is called Import, and each Division element is a table row. Each Division element also contains the Person child elements, displayed in table form.

Click the Row element and press F9 (or click the Display as Table icon [image] ) to remove the table formatting. Each Division element is now displayed separately.


Shape strings

Shape strings

Data shaping is one of the new features of ADO 2.6. The basic idea behind data shaping, is the hierarchical record set. Data shaping allows a column of a master record set to itself contain another record set - a child record set.

It is important to distinguish between hierarchical record sets and hierarchical databases.
· Hierarchical record sets are standard record sets, where the data is represented hierarchically by parent, child or even grandchild tables.
· Hierarchical databases actually store data in an hierarchical format.

Please note:
To be able to use the Shape language, you must have Microsoft Data Access Components Version 2.1 or later, installed on your computer. Please contact your IT-department for help if this is not the case.

Please see: the link http://support.microsoft.com/support/kb/articles/Q189/6/57.ASP for more information on Shape commands in general.

Importing hierarchical data
To import hierarchical data you can construct you own shape commands manually and enter them into the Selection statement text box, or have XML Spy automatically create them using the Create Database schema and then the XML Import based on DB Schema commands. The Shape commands are included in the Shapes.txt file, and on the following pages.

Please note:
· The Data_shape.mdb file was created by exporting to an Access database from the Data_shape.xml file (this XML file is included with XML Spy)
· All these examples are imported without external primary and foreign key values
· All the imported data are defined as Elements by default
· The "Create empty elements from empty fields" check box is inactive
· The preview window of the Database import dialog box of the data is included
· The resulting import file is displayed vertically, allowing you to see the data structure more clearly (the Display as table function is deactivated for the respective row element)
· Child elements (eg. Persons) are expanded

Shape string to import Division and Persons
Shape {SELECT * FROM Division} as Division
APPEND ({SELECT * FROM Person} as Person
RELATE PrimaryKey to ForeignKey) as Person

Preview window:

Result on import into XML Spy

Shape String to import Company, Division and Persons
SHAPE {SELECT * FROM Company} as Company
APPEND((Shape {SELECT * FROM Division} as Division
APPEND ({SELECT * FROM Person} as Person
RELATE PrimaryKey to ForeignKey) as Person) as Division
RELATE PrimaryKey to ForeignKey) as Division

Preview window:

Please note:
The name space prefix has been suppressed in these examples because the option "Exclude Namespace" was activated during the export process. Thus xmlns:xsi becomes xsi, and xsi:SchemaLocation becomes SchemaLocation.

Result on import into XML Spy

Shape string to import Company, Address and Division
SHAPE {SELECT * FROM Company} as Company
APPEND ({SELECT * FROM Address} as Address
RELATE PrimaryKey to ForeignKey) as Address,
({SELECT * FROM Division} as Division
RELATE PrimaryKey to ForeignKey) as Division

Preview window:

Result on import into XML Spy

Shape string to import Company, Address, Division and Persons
SHAPE {SELECT * FROM Company} as Company
APPEND({SELECT * FROM Address} as Address
RELATE PrimaryKey to ForeignKey) as Address,
((SHAPE{SELECT * FROM Division} as Division
APPEND ({SELECT * FROM Person} as Person
RELATE PrimaryKey to ForeignKey) as Person) as Division
RELATE PrimaryKey to ForeignKey) as Division

Preview window:

Result on import into XML Spy


Creating Identity constraints

Creating Identity constraints

MS Access databases automatically generate Identity constraints when you use the Convert | Create Database Schema command to create a schema.

Defining identity constraints:
The aim of this section is to be able to import XML data based upon a schema, using the Convert | XML Data Import based on DB Schema. This command uses the active schema file as a base for importing data from an external database. The schema file delivers some of the necessary information needed to automatically generate a select statement string.

1. Open the No-constraints.xsd file in the Tutorial folder of XML Spy.
2. Click the Altova element to select it and click the Identity constraints tab.
3. Click the Append icon and select the Key entry.

4. Enter Altova-Primary in the Name field and hit the Tab key.
5. Enter a period character "." in the Selector field and hit the Tab key again.
6. Enter PrimaryKey in the Field(s) cell and hit Return to confirm.

This has defined the Altova element as the top-level table.
7. Click the Division element in the schema overview, click the Append icon and select the Keyref entry.
8. Enter Division-Foreign in the Name field, hit the Tab key and select Altova-Primary from the combo box and hit the Tab key.

9. Enter a period character "." in the Selector field and hit the Tab key again.
10. Enter ForeignKey in the Field(s) cell and hit Return to confirm.
11. Click the Append icon and select the Key entry. Use the same method to enter the following data: Name=Division-Primary, Selector=".", and Field(s)=PrimaryKey.

You have now created a relationship between the Altova and Division tables/elements, where the Division table is linked to the Altova table.

Checking the relationship
1. Select the menu option Convert | XML import based on DB Schema.
2. Select Altova as the root table in the dialog box that opens.
This opens the "Database import based on Schema" dialog box. The automatically generated shape string appears in the Select statement text box. The select string shows that the Altova table is related to the Division table.

3. Click the Cancel button to close the dialog box for the moment.

Completing the identity constraints
We now have to define the rest the remaining identity constraints for the Person and VIP tables (elements in the schema). Use the method outlined above to add Key and Keyref fields to the Person and VIP elements.

Person element:

VIP element:

Importing data using a schema (with identity constraints)
1. Select the menu option Convert | XML import based on DB Schema.
2. Select Altova as the root table in the dialog box that opens. (You can choose any one of the entries as the root table, Division, Person or VIP.)
This opens the "Database import based on Schema" dialog box. The automatically generated shape string appears in the Select statement text box.

3. Click the "Choose file" button, select the DB2schema.mdb file in the Tutorial folder, and click the Open button. This enables the OK button in the Database import... dialog box.
4. Click the OK button to start the data import.
The XML document appears as an "Untitledx.xml" file in the main window. Scroll right to see the complete structure.

Please note:
If you want to edit the select statement, start a new data import using the menu option Convert | Import database data. The select statement is automatically made available to Select statement text box after having used the Convert | XML Import based on DB Schema. You can now edit the select statement and import the data from here.


View Menu

View Menu

The View menu controls the display of the active Main window and allows you to change the way XML Spy displays your XML documents.


Enhanced Grid View

Enhanced Grid View

This command switches the current document into Enhanced Grid View.

This view includes an (optional) tree and structured grid display and is the preferred view for editing XML documents. If the previous view was the Text View, the document is automatically checked for well-formedness.

Embedded Database/Table view
XML Spy allows you to display recurring elements in a Database/Table view from within the Enhanced Grid view. This function is available wherever the Enhanced Grid view can be activated, and can be used when editing any type of XML file - XML, XSD, XSL etc.

For further information on this view, please see the detailed description of the various views in the Main Window section in the XML Spy Reference.


Schema Design View

Schema Design View

This command switches the current document into Schema Design view.

XML Spy Schema editor allows you to view and edit schemas in two different ways:
· As a Schema overview, in list form
· In a graphical view of specific schema components

Schema overview
Open a XSD document in the DTD/Schemas folder of the project window, or double click on an XSD document in Explorer. The main window then displays the Schema overview.

The top window displays all Global "components" (elements, complex types etc.) in list form. The bottom window displays the corresponding attributes of the currently selected component (eg. VIP Mgr. Prg etc.).

Schema overview:

To see graphical representation (Content model) of a component:
· Click on the [image] icon next to the component you want to display, or
· Select the menu option Schema design | Display Diagram, or
· Double click on a component name in the "Component Navigator" (Top right entry helper).

The content model for that component, appears in a tree view.

Graphical content model view


Text View

Text View

This command switches the current document into Text View.

This view allows you to edit the XML source in a source-code fashion and includes syntax-coloring.

If the previous view was the Enhanced Grid View, the document is automatically formatted according to the settings defined when saving a file (these can be modified in the "Save File" section of the File tab of the Options dialog). Use the menu command Tools | Options to open this dialog.

For further information on this view, see the detailed description of the various views in the Main Window section in the XML Spy Reference.


Document Editor View

Document Editor View

44-ic-doced-view
This command switches the current document into the Document Editor view.

XML Spy Document Editor enables you to edit XML documents based on templates created in XSLT Designer! The templates in XSLT Designer are saved as *.sps files, and supply all the necessary information needed by Document Editor.

Templates are opened by Selecting the File | New command and then clicking the "Select a Document Editor template..." button. Please see the Document Editor documentation for further information.


Browser View

Browser View

This command switches the current document into Browser View.

This view uses an XML-enabled browser (preferably Internet Explorer 5) to render the XML document using information from potential CSS or XSL style-sheets.

When switching to browser view, the document is first checked for validity, if you have selected Validate upon saving in the File tab of the I Options dialog. Use the menu command Tools | Options to open this dialog.

For further information on this view, please see the detailed description of the various views in the Main Window section in the XML Spy Reference.


Synchronize

Synchronize

This command synchronizes the Enhanced Grid view and Tree view in the main window.

To see the Tree view, you must activate the "Show Tree" check box in the File tab of the Options dialog). Use the menu command Tools | Options to open this dialog box.

Click an item in the Tree or Grid view, and select the menu option View | Synchronize. The view in the other window is opened to the same level, and the item is highlighted.

You can also double-click on an element in the tree view, to navigate to that item in the grid.


Expand

Expand

Hotkey: Num +

This command expands the selected element by one level.

The command can be used in the Tree and Enhanced Grid views. The keyboard shortcut is the + key on the numeric keypad.

In the Enhanced Grid view, the element and all its children remain selected after expansion. This allows you to expand a large element by pressing the + key repeatedly.

You can expand and collapse any element by clicking on the gray bar to the left of each element.


Collapse

Collapse

Hotkey: Num -

This command collapses the selected element by one level.

The command can be used in the Tree and Enhanced Grid views. The keyboard shortcut is the - key on the numeric keypad.

You can expand and collapse any element by clicking on the gray bar to the left of each element.


Expand fully

Expand fully

Hotkey: Num *

This command expands all child items of the selected element, down to the last level of nesting.

The command can be used in the Tree and Enhanced Grid views. The keyboard shortcut is the * key on the numeric keypad.


Collapse unselected

Collapse unselected

Hotkey: CTRL Num -

This command allows you to focus on one element and its children, and ignore all the other surrounding elements.

The command can be used in the Tree and Enhanced Grid views. The keyboard shortcut is the CTRL and - key on the numeric keypad.

Simply select the item that you want to work with and choose this command to collapse all other (unselected) elements.


Optimal widths

Optimal widths

This command adjusts the widths of all columns so that the text of the entire document fit into the designated columns.

If you expand and collapse several elements, select the "Optimal widths" command, as only visible items are taken into account when calculating the optimum column widths.


Word wrap

Word wrap

This command enables or disables word wrapping in the Text view.


Go to line/char...

Go to line/char...

Hotkey: CTRL+G

This command goes to a specific line number and/or character position in an XML document in the Text view.

If you are working with an external XSLT processor (see the XSL page on the Tools | Options dialog for details) you may often get error messages by line number and character position. XML Spy lets you quickly navigate to that spot, using this command:

This command works in both the Text View and Enhanced Grid View, but will only be able to show an approximate position in the grid view by highlighting the element closest to the character position specified.


Go to File

Go to File

This command opens a document that is being referred to, from within the file you are currently editing.

Select the file name, path name, or URL you are interested in, and choose this command from the View menu.

You can select:
· An entire element or attribute in the Enhanced Grid View
· Some characters from within any item in the Text or Enhanced Grid Views.
· An enclosed string. If you text cursor is between quotes, XML Spy will automatically use the entire string that is enclosed in the quotes.


Browser Menu

Browser Menu

This menu contains commands that are only available when the Browser View has been activated.


Back

Back

Hotkey: Backspace

This command displays a previously viewed page. You can also use the keyboard Backspace key to achieve the same effect.

This can be useful if you click a link in your XML document and want to return to it.


Forward

Forward

This command is only available once you have used the Back command, and moves you forward through previously viewed pages.


Stop

Stop

This command instructs the browser to stop loading your document.

This is useful if large external files or graphics would be loaded over a slow Internet connection.


Refresh

Refresh

Hotkey: F5

This command updates the Browser View by reloading the XML document and potential external CSS or XSL style-sheets as well as DTDs. You can also use the F5 key to trigger this command.


Fonts

Fonts

This command allows you to select the default font site for rendering the text of your XML document. It is similar to the Font-Size command in most browsers.


Separate Window

Separate Window

This command opens the browser view in a separate window, so that side-by-side viewing is possible. (eg. text or enhanced grid) view.

If you have separated the browser view, press F5 in the editing view to automatically refresh the corresponding browser view.


Soap Menu

Soap Menu

XML Spy supports SOAP Version 1.1 and WSDL Version 1.1.

Please note that the SOAP interface and Soap debugger are only available in the XML Spy Suite version!

The Soap - How to... section that follows the menu descriptions, shows you how to use the SOAP debugger using the nanonull.com timeservice server supplied by Altova. Please use this service to test the SOAP debugger. The AirportWeather web service, described on the following pages, might not always be available to you.

Use the SOAP functionality:
· To test your web services without having to implement client applications
· For quick testing of third party web services

For more info on these specifications please see:
SOAP http://www.w3.org/TR/SOAP/
WSDL http://www.w3.org/TR/wsdl


Create new SOAP request

Create new SOAP request

This command creates a new SOAP request document in XML Spy.

Creating a new SOAP request:
1. Select the menu option Soap | Create new SOAP request.
This opens a dialog box where you have to enter the local path or URL of a WSDL file describing the web service. In this example the capescience.com AirportWeather websevice. The URL for this web service is:
http://www.capescience.com/webservices/airportweather/AirportWeather.wsdl

2. Click OK to confirm the selection and connect to the capescience.com server.
This opens a dialog box from which you select a specific SOAP operation.

Please note:
If the connection fails or the URL is incorrect, an error message will appear at this point.

3. Click the getSummary (string arg0) entry, and confirm with OK.
This creates an Untitled.xml document in XML Spy containing the SOAP request data.

4. Click one of the fields to deselect the table highlighting.
Before the request can be sent, we have to specify the airfield for which we want the weather summary.
5. Click the arg0 field, and enter KJFK for the JFK weather report.

This completes the definition of this SOAP request, all we have to do now is send the request and see if we receive an answer. Please see "Send request to server".


Send request to server

Send request to server

This command sends a SOAP request to a web service from within XML Spy. Having defined your SOAP request document, see Create new SOAP request, the request can be sent off using this command.

Previously defined SOAP request document:

Sending a SOAP Request:
1. Making sure that the SOAP request document is active, select the menu option Soap | Send request to server.

After a few seconds wait, a new XML document is automatically created in XML Spy containing the SOAP Response from the respective server. In this example, the location and weather status of JFK are displayed in the new document.

To change the SOAP request parameters not displayed in the request document (owing to the fact that they are transferred in the HTTP header) please see "Edit SOAP request parameters".


Change SOAP request parameters

Change SOAP request parameters

This command allows you to change the currently defined SOAP parameters of the SOAP request document. This example uses the previously defined SOAP request document.

To change the SOAP request parameters:
1. Making sure that the SOAP request document is active, select the menu option Soap | Change SOAP request parameters.
This opens the SOAP request settings dialog box. You can now either change the Connection end point or SOAP action settings. Confirm the changes with OK.

2. You can now resend the SOAP request using the menu option Soap | Send request to server.
A SOAP response document will be generated and displayed in the main window in a few seconds.

Please note:
Only change the SOAP action settings if a full list of the SOAP methods and their corresponding SOAP actions are available to, and accessible by you.


Soap Debugger Session

Soap Debugger Session

This command starts a SOAP debugger session.

· A dialog box is immediately opened after you select this command. You then have to select a WSDL file location, generally a URL.
· Select the source and target ports needed for the debugger proxy server and the web service, in the following dialog box.

This opens the SOAP debuggers proxy server in its inactive state. Clicking one of the SOAP toolbar icons, starts the SOAP debugger and waits for the client requests.

Please see the SOAP - How to... section for a more detailed description.


Go

Go

This command activates the SOAP proxy server and processes the WSDL file until a breakpoint is encountered. The respective SOAP document then appears in one of the SOAP document windows.


Single Step

Single Step

This command allows you to single-step through the incoming and outgoing SOAP requests and responses. The SOAP debugger stops for each request and response. The proxy server is also started if it was inactive.


Break on next Request

Break on next Request

This command causes the debugger to stop on the next SOAP request, and display the data in the SOAP Request document window. You can directly edit the data in this window before sending it on to the web service.


Break on next Response

Break on next Response

This command causes the debugger to stop on the next SOAP Response, and display the data in the SOAP Response document window. You can directly edit the data in this window before sending it on to the client.


Stop the proxy server

Stop the proxy server

This command stops the debugger proxy server.


Soap debugger options

Soap debugger options

This command allows you to define the SOAP debugger options. Please define these settings before you start the SOAP debugger.

Hide:
You can hide the entry helpers as well as the project or info windows, enabling you to see more of the data in the SOAP documents.

Timeout (secs)
Most clients have timeout setting in the data receiving function. The time the debugger remains in a breakpoint is per default 5 seconds. A data packet (http1.1 100 Continue") message is sent to the client once every timeout period you define.

Setting the timeout period to zero suppresses the data packet, you remain in the breakpoint for as long as you want.

This computers address:
Address of the computer on which the SOAP debugger is running. This computer must be accessible to the Client computer.

Enter the address in the form http://computer name, where "computer name" is the web address or IP address of the computer on which the SOAP debugger is running. Do not enter a port number in the address. The "localhost" entry always points to your local computer.


Soap - How to...

Soap - How to...

The How to... sections in this manual go into more detail about a specific subject in a task oriented way, and are generally sequential in nature. Tasks may build upon previous ones and may also use their data (or files) further on in the section.

In this SOAP - How to... section you will learn how to:
· Send and receive SOAP requests using the SOAP debugger
· Set breakpoints for sending and receiving SOAP requests
· Edit an incorrect SOAP request before sending it on to the web service

When developing an application that accesses data from a web service and does further data processing, something might happen that you don't expect. Wouldn't it be great to be able to see and edit the data that is actually transmitted?

This is where XML Spy SOAP debugger comes in. It works as a proxy server between your client and the web service. The debugger functionality goes a lot deeper than a normal trace utility that only stores every call's Request and Response.

XML Spy SOAP debugger allows you to set breakpoints for every Request and Response message and even define Conditional breakpoints via XPath expressions.

SOAP debugger supports:
· Stepping through SOAP requests and responses
· Modification of the SOAP requests and responses and
· Forwarding of modified requests to the client or server.


SOAP communication process

SOAP communication process

Once the proxy server has been started, the SOAP communication process is as follows:

· Proxy server listens continually to a socket/port for incoming client requests

1. Client application sends a request to proxy server
2. Client requests can be modified if/when breakpoints have been triggered
3. Proxy server request data is forwarded to the web service server

· The websevice server responds to the proxy request, and sends the response data back to the proxy server

1. Server responses can be modified if/when breakpoints have been triggered
2. Proxy server response data is forwarded to the client application

· Client application receives response data from proxy server

How to... example client and server applications:
· The Client application, which sends and receives SOAP messages is the Browser window
· The "Nanonull Time Service" service will act as the web service server.
The URL for this web service is: http://www.nanonull.com/TimeService/TimeService.asmx?WSDL

Port settings
The SOAP debugger uses the 8080 port to monitor the clients' requests. The port can only be altered when a new SOAP debugging session is started. Note that this port may be disabled by personal firewalls, or advertising filters. You would therefore have to disable these programs, or select a different port address.


Using SOAP debugger

Using SOAP debugger

Having started XML Spy,
1. Select the menu option Project | Open Project.
2. Select the "Examples.spp" file in the ..\Altova\XML Spy Suite\Examples folder.
3. Click the + sign of the SOAP Debugger folder to see the folder contents.

4. Double click the DebuggerClient.htm file to start the SOAP Client and connect to the web service.

The htm window displays the current Eastern Standard Time (5:01 in this example).
5. Click the GMT radio button to see the current Greenwich Mean Time.

An error has obviously occured at this point. We should have a correct time in the clock display. We will have to activate the SOAP debugger to analyze the SOAP messages, and see if we can locate the error and perhaps fix it.

Configuring the SOAP debugger
1. Select the menu option SOAP | SOAP debugger options.
2. Activate the "Hide project/info windows" check box, and click OK to confirm.

This allows more room for the SOAP request and response windows. Make sure you define these settings before you start the SOAP debugger session.

To start the XML Spy SOAP debugger:
1. Select the menu option SOAP | SOAP Debugger Session.
This opens the "Enter the WSDL file location..." dialog box.

2. Enter the WSDL file location into the text box http://www.nanonull.com/TimeService/TimeService.asmx?WSDL and click OK.
The following dialog box displays the source and target port settings. The source port setting (8080) is a default setting and is automatically entered. This setting can be changed every time the debugger is started.
The target settings are supplied by the WSDL file, and also appear automatically.

3. Click the OK button to start the SOAP debugger session.

This opens the SOAP debugger proxy server in its inactive state. You can see this by noting that the proxy server icon [image] is disabled.

Setting debugger breakpoints:
This web service uses the method getTimeZoneTime to find the time zone time.
1. Activate the On Request and On Response check boxes for this method (getTimeZoneTime). This enables you to analyze both SOAP requests and responses for errors.

2. Click the GO icon [image] (or use the menu command SOAP | GO).
3. Click the DebuggerClient tab to switch to the Client. You may have to maximize the window to see more of the contents.

4. Click the "Turn On Debugging Mode" button in the client window.

This displays a "Debugging is on" message, and sends off the SOAP request to the debugger.

Viewing and editing the SOAP request
The SOAP request automatically appears in the SOAP request window of the debugger. We can now look at the request and edit any errors it might contain.

Looking at the timezone element, we notice that the value is GMD. This cannot be correct, so we will change it to GMT and see what happens.

1. Double click in the timezone field, change the entry to GMT and hit Enter.

2. Click the GO icon [image] (or use the menu command SOAP | GO) to send the corrected request to the web service.
After a few seconds, the web service response to the SOAP request appears in the SOAP response window.

We did not receive an error message in the response, so we can assume that this is the correct time.
3. Click the debugger GO icon [image] to send this response to the client (the Browser window in this case).
4. Click the DebuggerClient.htm tab to switch back to the client, and see the new result.

The error message has disappeared, and the correct GMT time is displayed.
5. Select the menu option SOAP | SOAP debugger session to close the debugger session.

Fixing the error
Now that we know that the client is actually sending the illegal value "GMD" instead of "GMT" in it's request and the server would correctly respond to "GMT", we have successfully identified the SOAP Client as being the component that causes the error, so we can go about fixing it.

In the DebuggerClient.html window:
1. Click the Text View button, open the Find dialog (Edit | Find), and search for "GMD".
XML Spy will display this code fragment:

else if(timezone[5].checked)
msCurrentTimeZone='GMD';

2. Change the value from "GMD" to "GMT" and switch back to the Browser View.
The SOAP Client now works correctly, the "Unknown Time zone" message has gone and the correct time appears in the window. Problem solved!


Setting breakpoints in SOAP debugger

Setting breakpoints in SOAP debugger

The SOAP debugger window is where you set and delete breakpoints. It is separated into two tabs.

Functional-Breakpoints tab
The "Functional breakpoints" tab, allows you to set a breakpoint on either Requests and/or Responses to SOAP methods. The debugger highlights the line of the function which triggered a breakpoint.

Data packets to and from the client are analyzed and matched to the corresponding functions from the WSDL file. If a breakpoint is set for a specific method, then this is where the SOAP debugger stops. The toolbar buttons are enabled at this point.

The data is displayed in the "Soap Request" or "Soap Response" document window. The SOAP documents displayed in the SOAP windows can be modified at this point. The data is sent the moment you click one of the toolbar icons (except for the "stop server" icon).

Conditional-Breakpoints
The "Conditional Breakpoints" tab, allows you to use XPath expressions to define breakpoints.

If a SOAP request causes an error, the SOAP response must contain a "faultcode" element. We therefore want to have a breakpoint triggered whenever a faultcode element appears.

To add a conditional breakpoint:
1. Click the Conditional Breakpoints tab, and then the Add button.

2. Enter the XPath expression (e.g. .//faultcode) in the XPath field.
3. Click the "Break when XPath nodes found" radio button.
4. Click the OK button to confirm the settings.
The SOAP debugger will stop whenever a .//faultcode element appears in a SOAP request or response.

In Requests
This option lets you define the specific action to be taken if a breakpoint occurs in a SOAP Request. The rest of the dialog box options relate to the SOAP Request. You can of course use the same settings for the SOAP Responses, if you also activate the "In Responses" check box.

In Responses
This option lets you define the specific action to be taken if a breakpoint occurs in a SOAP Response. The rest of the dialog box options relate to the SOAP Response. You can of course use the same settings for the SOAP Responses, if you also activate the "In Requests" check box.

Global
Selecting the Global option, defines that every method/function is scanned for the condition you define.

Local
Selecting the Local option, forces you to select a specific method/function from the ones supplied by the WSDL file. This method/function is then scanned for the condition you define.

XPath
Enter the specific XPath expression/node here. An XPath has to be entered here, to be able to use any one of the specific radio button options.
Please see the XPATH section for more information.

Break on value
The debugger stops when one of the XPath nodes matches the value you enter in this field.

Break when XPath nodes found
The debugger stops when the specific XPath node, .//faultcode entered in the XPath field, exists in the SOAP Request or Response.

Break when XPath nodes missing
The debugger stops when the specific XPath node , .//faultcode entered in the XPath field, is missing from the SOAP Request or Response.

Operation
The Operation column contains the method the being searched for. If you selected the Global radio button then this field remains empty. If you selected Local, then the method you selected is displayed here.

XPath
This column contains the XPath expression you defined.

Value
This column contains the XPath value against which the XPaths nodes are checked for a match. If you selected "Break on value" the specific string you entered is displayed here. If you selected "Break when XPath nodes found", then <--Exist--> is displayed. If you selected "Break when XPath nodes missing", then <--Missing--> is displayed.

In Requests
The check box displays if the XPath expression is checked in the SOAP request.
You can change the settings by directly clicking the check box in the column.

In Responses
The check box displays if the XPath expression is checked in the SOAP response.
You can change the settings by directly clicking the check box in the column.

To edit the Conditional Breakpoints:
· Double click the respective line in the tab, or
· Click the Change button.

To delete a conditional Breakpoint
· Click the line you want to delete, and click the Delete button.


Tools

Tools

The tools menu allows you to:
· Check the spelling of your XML documents.
· Access the scripting environment of XML Spy. You can create, manage and store your own forms, macros and event handlers.
· View the currently assigned macros
· Assign (or deassign) scripts to a project
· Customize your version of XML Spy: define your own toolbars, keyboard shortcuts, menus, and macros
· Define the global XML Spy program settings

44-tools-menu


Spelling...

Spelling...

XML Spy Suite now includes a built-in spelling checker.

The spelling checker can be used in the following views: Enhanced grid, Text and Document Editor as well as in XSLT Designer. Please note that you can check any type of XML file. The view you select influences the spelling checker options that are made available. A schema file (*.xsd) can be checked in the Text and Enhanced grid view, but not in the Schema Design view.

Spell checking in the Text and Enhanced grid view presents you with the most options, you can additionally check the spelling of:

· Element content
· Attribute content
· CDATA content
· Comment text

You can also define which specific element or attribute content to check or ignore. These selections are defined in the "Spelling context" dialog box.

The Tools | Spelling... command (hotkey Shift+F7) opens the Spelling dialog box, and automatically starts checking the currently active XML document (in this case the OrgChart.xml document in the Document Editor view).

44-spell1

Not in Dictionary
This text box contains the word that cannot be found in any of the existing dictionaries (default and custom dictionaries). You can also edit the text here. The word is also highlighted in the XML document. The command buttons become active at this point and allow you to decide which action to take.

Suggestions
This list box displays a list of words that resemble the unknown word (supplied from all dictionaries). Double clicking a word in this list automatically inserts it in the document and continues the spell checking process.

Ignore once
This command allows you to continue checking the document while ignoring the first occurrence of the unknown word. The same word will be flagged again if it appears in the document.

Ignore all
This command ignores all instances of the unknown word in the whole document.

Add to dictionary
This command adds the unknown word to the currently active custom dictionary. This is the dictionary containing the check mark in the Custom Dictionaries dialog box (custom.tlx).

44-spell-cust-dict2

Change
This command replaces the currently highlighted word in the XML document, with the selected word in the Suggestions list box.

Change all
This command replaces all occurrences of the currently highlighted word in the XML document, with the selected word in the Suggestions list box.

Recheck
The Recheck button restarts the check from the beginning of the document.

Close
This command closes the Spelling dialog box.

Options...
This command opens a dialog box depending on the current view.
· If opened from Document Editor view, the Options dialog box is opened.
· If opened from the Text or Enhanced Grid view, the Spelling context dialog box is opened.


Spelling options...

Spelling options...

This command opens either the Options or Spelling context dialog box, depending on the view you are using to display your XML document.

Options - Document Editor view and XSLT Designer
When viewing an XML document in Document Editor view, this command opens the Options dialog box. Use this dialog box to define the global spelling checker options.

Always suggest corrections:
Activating this option causes suggestions (from all of the dictionaries) to be displayed in the Suggestions list box. Disabling this option causes no suggestions to be shown.

Make corrections only from main dictionary:
Activating this option causes only the default dictionary to be used, none of the custom dictionaries are scanned for suggestions. It also disables the Custom Dictionaries button, preventing any editing of the custom dictionaries.

Ignore words in UPPER case:
Activating this option causes all upper case words to be ignored.

Ignore words with numbers:
Activating this number causes all words containing numbers to be ignored.

Dictionary Language
Use this combo box to select the dictionary language for the spelling checking. The default installation allows you to select English. Other language dictionaries will be made available on the Altova download web site.

44-spell-options

Custom dictionaries
The Custom Dictionaries... button allows you to:
· modify an existing dictionary (add or delete dictionary entries)
· create a totally new dictionary
· add an existing dictionary
· remove an existing dictionary

When you start the spell checking process, all dictionaries listed in the Custom Dictionaries list box are searched. If you want to limit the search to specific dictionaries, use the Remove command to delete those you do not want searched.

44-spell-cust-dict

To modify dictionary entries:
1. Click the custom dictionary name whose entries you want to change, and click Modify...
This opens the dictionary highlighted in the list box (custom.tlx in this case). A prompt appears if none of the dictionaries has been selected.

44-spell-cust-tlx

2. Click in the Word: field and enter the new dictionary entry (this automatically activates the Add button).
3. Click Add to add it to the dictionary.

To delete an entry from the dictionary:
1. Click the word in the Dictionary list box to highlight it, and click Delete.
2. Click OK to confirm the changes made in this dialog box.

To add a new dictionary:
1. Click New, and enter the name of the new custom dictionary in the File name... field.
2. Click Save to save the dictionary.
3. You can now add entries to the dictionary using the Add button, or the Add to Dictionary button while performing a spell check.

To add an existing dictionary:
Use this option to add previously removed (or third party dictionaries).
1. Click Add and select a dictionary from the list box. Dictionaries have a *.tlx extension.
2. Click Open to add the dictionary to the Custom dictionary list.

Please note:
It is not mandatory for a dictionary to have a *.tlx extension. It can have any, or no extension at all, and still be added to the dictionary list box.

To remove a dictionary:
· Click the dictionary name in the list and click Remove. This removes the dictionary from the list, it does not physically delete it from your hard disk.

Spelling context - Text and Enhanced Grid view
When viewing an XML document in the Text or Enhanced Grid view, this command opens the "Spelling context" dialog box. Starting the spelling checking in the Text and Enhanced grid view presents you with the most options, you can define the specific content which is to be checked:
· Element content
· Attribute content
· CDATA content
· Comment text

44-spell-context-dbox

The Spelling options.. button opens the Options dialog box, which allows you to define the global spelling checker options.

To define specific element or attribute "content" you want to check:
1. Click the "All, except listed below", or "Only listed below" radio button.
2. Click the Append element/attribute icon [image], and enter the tag name containing the text you want checked (e.g. para). Hit return to confirm.
44-elem-check
3. Click the OK button to confirm these settings, and click it again in the Spelling dialog box to start the spelling checker with these new settings.
The only element content to be checked will be the text between the para tags, attribute content will also be checked.

To delete a tag name:
· Select the tag name, and hit the Delete or Backspace key.


Switch to scripting environment

Switch to scripting environment

The scripting environment is currently available as a downloadable component. If you have not downloaded and installed the scripting component, you will be prompted to do so when you select the "Switch to Scripting environment" menu item.

Clicking OK, connects you with the Altova Component Download Center from where you can choose to download the "XML Spy Scripting Environment".

Having downloaded the component, double click on the Spyscripting.exe to install it.

This command switches to the scripting environment, a predefined global scripting project is active the first time you start the form editor. Please see the Scripting section in this manual for more information.


Show macros

Show macros

This command opens a dialog box which displays a list of all macros defined in the global scripting project and in the scripting project associated with the current project opened in XMLSpy.

The "Run" button in the dialog box, calls the selected macro.


Project

Project

This command opens a further submenu from where you can assign (or deassign) scripts to a project.

Please note:
You have to have a XML Spy project open for these menu items to become active.


Assign script to Project

Assign script to Project

This command enables you to assign scripts to an scripting project.


Unassign Scripts from Project

Unassign Scripts from Project

This command enables you to de-assign scripts from a scripting project.


Project Scripts active

Project Scripts active

This command allows you to activate or temporarily deactivate project scripts.


Customize...

Customize...

The customize command lets you customize XML Spy to suit your personal needs.


Commands

Commands

The Commands tab allows you customize your menus or toolbars.

To add a command to a toolbar or menu:
1. Open this dialog box using Tools | Customize.
2. Select the command category in the Categories list box. The commands available appear in the Commands list box.
3. Click on a command in the commands list box and drag "it" to an to an existing menu or toolbar.
4. An I-beam appears when you place the cursor over a valid position to drop the command.
5. Release the mouse button at the position you want to insert the command.

· A small button appears at the tip of mouse pointer when you drag a command. The check mark below the pointer means that the command cannot be dropped at the current cursor position.
· The check mark disappears whenever you can drop the command (over a tool bar or menu).
· Placing the cursor over a menu when dragging, opens it, allowing you to insert the command anywhere in the menu.
· Commands can be placed in menus or tool bars. If you created you own toolbar you can populate it with your own commands/icons.

Please note:
You can also edit the commands in the context menus (right click anywhere opens the context menu), using the same method. Click the Menu tab and then select the specific context menu available in the Context Menus combo box.

To delete a command or menu:
1. Open this dialog box using Tools | Customize.
2. Click on the menu entry or icon you want to delete, and drag with the mouse.
3. Release the mouse button whenever the check mark icon appears below the mouse pointer.
The command, or menu item is deleted from the menu or tool bar.


Toolbars

Toolbars

The Toolbars tab allows you to activate or deactivate specific toolbars, as well as create your own specialized ones.

XML Spy toolbars contain symbols for the most frequently used menu commands.
For each symbol you get a brief "tool tip" explanation when the mouse cursor is directly over the item and the status bar shows a more detailed description of the command.

You can drag the toolbars from their standard position to any location on the screen, where they appear as a floating window. Alternatively you can also dock them to the left or right edge of the main XML Spy window.

· Toolbar settings defined in the Grid, Schema design and Text view are valid in those views. The Browser view toolbars are independent of all the other views.

To activate or deactivate a toolbar:
1. Click the check box to activate (or deactivate) the specific toolbar.

To create a new toolbar:
1. Click the New... button, and give the toolbar a name in the Toolbar name dialog box.
2. Add commands to the toolbar using the Commands tab of the Customize dialog box.

To reset the Menu Bar
· Click the Menu Bar entry and
· Click the Reset button, to reset the menu commands to the state they were in when XML Spy was installed.

To reset all toolbar and menu commands
· Click the Reset All button, to reset all the toolbar commands to the state they were when XML Spy was installed. A prompt appears stating that all toolbars and menus will be reset.
· Click Yes to confirm the reset.

To change a toolbar name:
· Click the Rename... button to edit the name of the toolbar.

To delete a toolbar:
· Click the Delete button to delete the currently highlighted toolbar in the Toolbars list box.
· A prompt appears, asking if you really want to delete the toolbar. Click Yes to confirm the deletion.
· or, click right on the menu or icon bar, and select the Delete entry in the popup menu.

Show text labels:
This option places explanatory text below toolbar icons when activated.


Keyboard

Keyboard

The Keyboard tab allows you to define (or change) keyboard shortcuts for any XML Spy command.

To assign a new Shortcut to a command:
1. Select the commands category using the Category combo box.
2. Select the command you want to assign a new shortcut to, in the Commands list box
3. Click in the "Press New Shortcut Key:" text box, and press the shortcut keys that are to activate the command.
The shortcuts appear immediately in the text box. If the shortcut was assigned previously, then that function is displayed below the text box.
4. Click the Assign button to permanently assign the shortcut.
The shortcut now appears in the Current Keys list box.
(To clear this text box, press any of the control keys, CTRL, ALT or SHIFT).

To deassign (or delete a shortcut):
1. Click the shortcut you want to delete in the Current Keys list box, and
2. Click the Remove button (which has now become active).
3. Click the Close button to confirm all the changes made in the Customize dialog box.

Set accelerator for:
Currently no function.

Currently assigned keyboard shortcuts:
Hotkeys by key

F1 Help Menu
F3 Find Next
F5 Refresh
F7 Check well-formedness
F8 Validate

F9 Database/Table view
SHIFT + F9 Insert table row
CTRL + F9 Append row

F10 XSL Transformation
CTRL + F10 XSL:FO Transformation

Num + Expand
Num - Collapse
Num * Expand fully
CTRL + Num- Collapse unselected
CTRL + G Goto line/char

CTRL+TAB and CTRL+F6 Cycle through open windows
Arrow keys (up / down) Move selection bar
Esc. Abandon edits/close dialog box

Return /Space bar confirms a selection

Alt + F4 Closes XML Spy
CTRL + F4 Closes active window
Alt + F, 1 Open last file

CTRL + Double click an element (Schema view)
Display element definition

CTRL + N File New
CTRL + O File Open
CTRL + S File Save
CTRL + P File Print

CTRL + A Select All
Shift + Del Cut (or CTRL + X)
CTRL + C Copy
CTRL + V Paste

CTRL + Z Undo
CTRL + Y Redo

Del Delete (Delete item in Schema/Enhanced Grid view)

CTRL + F Find
F3 Find Next
CTRL + H Replace

CTRL + I Append Attribute
CTRL + E Append Element
CTRL + T Append Text
CTRL + D Append CDATA
CTRL + M Append Comment

CTRL + SHIFT + I Insert Attribute
CTRL + SHIFT + E Insert Element
CTRL + SHIFT + T Insert Text content
CTRL + SHIFT + D Insert CDATA
CTRL + SHIFT + M Insert Comment

CTRL + ALT + I Add Child Attribute
CTRL + ALT + E Add Child Element
CTRL + ALT + T Add Child Text
CTRL + ALT + D Add Child CDATA
CTRL + ALT + M Add Child Comment

Hotkeys by function
Abandon edits Esc.
Add Child Attribute CTRL + ALT + I
Add Child CDATA CTRL + ALT + D
Add Child Comment CTRL + ALT + M
Add Child Element CTRL + ALT + E
Add Child Text CTRL + ALT + T
Append Attribute CTRL + I
Append CDATA CTRL + D
Append Comment CTRL + M
Append Element CTRL + E
Append row CTRL + F9
Append Text CTRL + T
Check well-formedness F7
Closes active window CTRL + F4
Closes XML Spy Alt + F4
Collapse Num -
Collapse unselected CTRL + Num-
Confirms a selection Return / Space bar
Copy CTRL + C
Cut SHIFT + Del (or CTRL + X)
Cycle through windows CTRL + TAB and CTRL + F6
Database/Table view F9
Delete item Del
Expand Num +
Expand fully Num *
File New CTRL + N
File Open CTRL + O
File Print CTRL + P
File Save CTRL + S
Find CTRL + F
Find Next F3
Goto line/char CTRL + G
Help Menu F1
Insert Attribute CTRL + SHIFT + I
Insert CDATA CTRL + SHIFT + D
Insert Comment CTRL + SHIFT + M
Insert Element CTRL + SHIFT + E
Insert table row SHIFT + F9
Insert Text content CTRL + SHIFT + T
Move selection bar Arrow keys (up / down)
Open last file Alt + F, 1
Paste CTRL + V
Redo CTRL + Y
Refresh F5
Replace CTRL + H
Select All CTRL + A
To view an element
definition CTRL + Double click on an element.
Undo CTRL + Z
Validate F8
XSL Transformation F10
XSL:FO Transformation CTRL + F10


Menu

Menu

The Menu tab allows you to customize the main menu bars as well as the (popup - right click) context menus.

You can customize both the Default and XML Spy menu bars.

The Default menu is the one visible when no XML documents of any type are open in XML Spy.

The XML Spy menu is the menu bar visible when at least one XML document has been opened.

To customize a menu:
1. Select the menu bar you want to customize from the "Show Menus for:" combo box
2. Click the Commands tab, and drag the commands to the menu bar of your choice.

To delete commands from a menu:
1. Click right on the command, or icon representing the command, and
2. Select the Delete option from the popup menu,

or,
1. Select Tools | Customize to open the Customize dialog box, and
2. Drag the command away from the menu, and drop it as soon as the check mark icon appears below the mouse pointer.

To reset either of the menu bars:
1. Select either the Default or XML Spy entry in the combo box, and
2. Click the Reset button just below the menu name.
A prompt appears asking if you are sure you want to reset the menu bar.

To customize any of the Context menus (right click menus):
1. Select the context menu from the combo box.
2. Click the Commands tab, and drag the commands to context menu that is now open.

To delete commands from a context menu:
1. Click right on the command, or icon representing the command, and
2. Select the Delete option from the popup menu

or,
1. Select Tools | Customize to open the Customize dialog box, and
2. Drag the command away from the context menu, and drop it as soon as the check mark icon appears below the mouse pointer.

To reset any of the context menus:
1. Select the context menu from the combo box, and
2. Click the Reset button just below the context menu name.
A prompt appears asking if you are sure you want to reset the context menu.

To close an context menu window:
1. Click on the Close icon at the top right of the title bar, or
2. Click the Close button of the Customize dialog box.

Menu animations
· Select one of the menu animations from the combo box, if you want animated menus.

Menu shadows
· Click the Menu shadows check box, if you want all your menus to have shadows.


Macros

Macros

The Macros tab allows you to place macros (created using the XML scripting environment) in a toolbar or menu.

To place a macro (icon) into a toolbar or menu:
1. Start the scripting environment using Tools | Switch to Scripting environment.
2. Double click the XMLSpyMacros entry in the Modules folder of the XMLSpyGlobalScripts project.
Previously defined macros are then be visible in the right hand window.
3. Switch back to XML Spy, and select Tools | Customize and click on the Macros tab.
The macros defined in the scripting environment are now visible in the Macros list box at left.
4. Click the macro name and then the Add Command button. This places the macro name in the Associated commands list box.
5. Click the macro name in the Associated commands list box, and drag it to any tool bar or menu.

· To edit a macro icon, click the Edit Icon button.

· To delete a macro from the Associated commands list box, click the Delete button.


Plug-Ins

Plug-Ins

The Plug-Ins tab allows you to place plug-ins in a toolbar or menu.

To place a plug-in icon into a toolbar or menu:
1. Click the "Add Plug-In..." button.

2. Select the folder and then click the plug-in file to mark it (XMLSpyPlugIn.dll in this case).

3. Click the Open button to install the plug-in.
The plug-in name appears in the "list of active plug-ins" list, and the plug-in icon(s) appears in a new toolbar.

To remove a plug-in:
1. Click the plug-in name in the "List of active plug-ins" list and click the "Remove Plug-in" button.


Options

Options

The Options tab allows you to set general environment settings.

Toolbar
When active, the Show Tooltips on toolbars check box displays a popup when the mouse pointer is placed over an icon in any of the icon bars. The popup contains a short description of the icon function, as well as the associated keyboard shortcut, if one has been assigned.

The Show shortcut keys in Tooltips check box, allows you to decide if you want to have the shortcut displayed in the tooltip.

When active, the Large icons check box switches between the standard size icons, and larger versions of the icons.


Customize context menu

Customize context menu

The Customize context menu allows you to further customize icons and menu items.

To open the customize context menu:
1. First open the Customize menu by selecting Tools | Customize.
2. Then place the mouse pointer over an icon (or menu) and click right to open the context menu.

Reset to default
Currently no function.

Copy Button image
This option copies the icon you right click, to the clipboard.

Delete
This option deletes the icon or menu you right click. Deleting a menu, deletes all menu options contained in it!

To restore a deleted menu:
· Select the Menu tab
· Select the menu you want to restore (XML Spy or Default).
· Click the Reset button below the menu selection combo box.

Button Appearance...
This option allows you to edit the button image as well as the button text. Currently only the macro icons can be edited (default XML Spy icon).

The Image only, Text only and Image and text radio buttons, let you define what you want to edit. Click the Select User-defined Image radio button and click one of the icons.

Click the Edit... button, to open the Edit button image dialog box. The Button text can be edited if you select either Text only or Image and text options.

Image
This option changes the graphical display of an icon to the text representing it.

Text
This option changes the textual description of a function to the graphical image (icon) representing that function.

Image and Text
This option enables the simultaneous display of an icon and its text.

Start group
This option inserts a vertical divider to the left of the icon you right clicked.


Options

Options

The "Options" command allows you to define the global program settings in a tabbed dialog box. These settings are saved in the registry, and apply to all current and future document windows.

The Apply button displays the changes in the currently open documents, and fixes the current settings. The changes are seen immediately in the background windows.


File

File

The "File" tab defines the way XML Spy opens and saves XML documents. You can also find related settings in the Encoding tab.

Open/New file in Grid view
You can choose to open an existing file or create a new file either in the Enhanced Grid View or in the text view. If you select the grid view, you can optionally show the tree structure, and automatically expand all lines at the same time.

Automatic reload of changed files
If you are working in a multi-user environment, or if you are working on files that are dynamically generated on a server, you can instruct XML Spy to watch for changes to the files that you are currently editing. XML Spy will then prompt you to reload the file, whenever a change is detected.

Validation
If you are using document type definitions (DTDs) or schemas to define the structure of your XML documents, you can automatically check the document for validity whenever it is opened or saved.

XML Spy can also cache these files in memory to save any unnecessary reloading (e.g. when the Schema being referred to, is accessed through a URL).

Project
When you start XML Spy, you can open the last-used project automatically.

Save File
XML Spy uses TAB-characters (0x09) to indent the individual elements forming the structure of the XML document. In certain situations this may be undesirable. Deactivate the "Indent elements using tabs" check box, if this is the case.

No formatting output for
You can selectively turn off output formatting for certain elements, by entering them in the list box (e.g. necessary for xsl:attribute when you are editing XSL Stylesheets).

When saving an XML document, XML Spy includes a short comment <!-- Edited with XML Spy 4.x http://www.xmlspy.com --> near the top of the file. This option can only be deactivated by licensed users.

When saving a content model diagram (using the menu option Schema design | Generate Documentation), XML Spy includes a comment <!-- Generated with XML Spy 4.x Schema Editor - http://www.xmlspy.com -->) at the bottom of the diagram. This option can only be deactivated by licensed users.

Line breaks
Line-breaks in the document file can be preserved so that the same characters will be used that were found when opening the file. You can choose to encode line breaks in any of the three possible forms (CR&LF for PCs, CR for the MacOS, or LF for Unix).


File types

File types

The "File types" tab allows you to customize the behavior of XML Spy on a per-file-type basis.

Choose a file type from the "File types" list box, to customize the functions for that particular file type:

Windows Explorer settings
You can modify the file type description and MIME-compliant content type used by Windows Explorer, and you can define if XML Spy is to be the default editor for this file type.

XML Conformance
XML Spy lets you edit XML files as well as non-XML files. You must define the XML-Conformance settings for each new file type you add. Since XML allows for special grammar rules when dealing with external Document Type Definitions (DTDs) and external parsed entities, the exact grammar to be used can also be set here.

Do not modify these settings unless you are adding a new file type and are sure of what you are doing.

Default view
This group lets you define the default XML Spy view to be used for each file type.

Grid view
This check box lets you define if the Enhanced Grid View should automatically build tables.

Text view
This text box lets you set syntax-coloring for particular file types.

Disable automatic validation
If you are using partial XML-documents that are included in another file and cannot be validated individually, you can turn off automatic validation per file type.

Save empty elements in short <E/> format
Some XML tools may have problems understanding the short <Element/> form for empty elements defined in the XML 1.0 Specification. You can instruct XML Spy to save elements in the longer (but nonetheless also valid) <Element></Element> form.

Add new file extension button
Adds a new file type to the File types list. Define the settings for this new file type using the options in this dialog box.

Delete selected file extension button
Deletes the currently selected file type and all associated settings.


Editing

Editing

The "Editing" tab defines the behavior of the Enhanced Grid View, when exchanging data using the clipboard and moving items with drag & drop.

Intelligent editing
While editing documents, XML Spy provides Intelligent Editing based on these settings. You can also customize various aspects of the behavior of these Entry helpers here.

Default copy to clipboard in grid view as
You can choose the format in which data will be exported to foreign applications using the clipboard. If you select XML-Text, the contents of the clipboard will be formatted and tagged just like the resulting XML file itself.

The structured text mode attempts to format the clipboard contents as a table, for use in a spreadsheet or database application. This option does not affect the internal clipboard format that XML Spy uses for copying and pasting.

Table view
You can also control, how XML Spy decides when to display repeating elements in the Table View.


View

View

The "View" tab allows you customize the XML documents presentation.

Enhanced Grid view
Collapsed elements in the Enhanced Grid View can be displayed in preview form. This displays the attributes and their values in gray in the same line as the element.

XML Spy lets you automatically apply the Optimal Widths command while editing, and lets you limit the maximum cell width and height.

Text view
The Text View supports syntax-coloring, which can be updated dynamically while typing or be disabled entirely.

Program logo
You can turn off the splash screen upon program startup, to speed up XML Spy.

Window title
The window title for each document window can contain only file name, or the full path name.

Document Editor view
XML files based on a document template (*.sps), are automatically opened in the Document Editor view when this option is active.

Browser view
You can choose to see the browser view in a separate window, enabling side-by-side placement of the edit and browser views.


Grid fonts

Grid fonts

The "Grid fonts" tab allows you to customize the appearance of text in the Enhanced Grid view.

Font face and script
You can select the font face and size to be used for displaying the various items in the Enhanced Grid View. The same fonts are also used for printing and consequently only TrueType fonts can be selected.

Size
If you want to use the same font size for all items, click on the "Use same for all" check box.

Styles
The style and color can be set using the combo boxes. The current settings are immediately reflected in the list, so that you can preview the way your document is going to look.

In the Windows 95/98 version of XML Spy, it is possible to select a "Script" for some fonts. This is especially necessary when editing documents with a non-Roman writing systems. The script selected in the font settings dialog box, needs to match the character set code-page selected when opening a document (i.e. when editing a Cyrillic ISO-8859-5 document, the code-page being used to edit the file should be set to 1251 and the font script needs to be set to "Cyrillic").


Schema fonts

Schema fonts

The "Schema fonts" tab allows you to customize the appearance of text in the Text view.

Font face and script
You can select the font face and size to be used for displaying the various items in the Schema Design view. The same fonts are used when printing and creating schema documentation, consequently only TrueType fonts can be selected.

The "Doc." Schema and Element headers, are the fonts that are used when creating schema documentation.

Size
If you want to use the same font size for all items, click on the "Use same for all" check box.

Styles
The style and color can be set using the combo boxes. The current settings are immediately reflected in the list, so that you can preview the way your document is going to look.

In the Windows 95/98 version of XML Spy, it is possible to select a "Script" for some fonts. This is especially necessary when editing documents with a non-Roman writing systems. The script selected in the font settings dialog box, needs to match the character set code-page selected when opening a document (i.e. when editing a Cyrillic ISO-8859-5 document, the code-page being used to edit the file should be set to 1251 and the font script needs to be set to "Cyrillic").


Text fonts

Text fonts

The "Text fonts" tab allows you to customize the appearance of text in the Text view.

Again you can choose the font face, style and size, but this time the same font, style and size is always being used for all elements. Only the color can be adjusted individually to provide full customization of the syntax coloring option.

Setting the background color is only supported when RichEdit 3.0 is available on your system.


Colors

Colors

The "Colors" tab allows you to customize the colors used in the Enhanced Grid view, when viewing elements in the Database/Table view.

Example:

Header unselected
This option defines the color of the table header when deselected.

Header selected
This option defines the color of the table header when selected.

Non-existing elements unselected
This option defines the color of the empty elements when deselected.

Non-existing elements selected
This option defines the color of the empty elements when selected.

In addition to the colors you define here, XML Spy uses the regular selection and menu color preferences set in the Display Settings on the Control Panel of your Windows installation.


Encoding

Encoding

The "Encoding" tab specifies the kind of character-set encoding to be used when creating new files, as well as the encoding to be assumed, when opening files that lack an encoding declaration.

Default encoding for new files
The default encoding for new files can be pre-determined in the Settings dialog box so that each new document is automatically created with a proper XML-declaration and includes the encoding-specification that you most commonly need.

The encoding for existing files will, of course, always be remembered independently of this setting and can only be changed by the "Encoding" command on the "File" menu.
If a two- or four-byte encoding is selected as the default encoding (i.e. UTF-16, UCS-2, or UCS-4) you can also choose between little-endian and big-endian byte-ordering for the XML files.

Open/save files with unknown encoding as
You can choose how an XML file is to be interpreted if the encoding-specification is missing, and the encoding cannot be auto-detected. In most cases this will very likely be UTF-8 or ISO-8895-1, even though the XML specification theoretically only allows UTF-8 files to lack an encoding-specification.

Open/save non-XML files in
Sometimes is can be convenient to also use XML Spy for editing non-XML files (such as Active Server Pages (ASP) or similar web-related documents. Since these files do not contain any encoding statements, you must specify a default Windows Code Page to be used for access these files.


XSL

XSL

The "XSL" tab allows you to define which program to use for XSL Transformations.

XML Spy includes full support for XSL Transformations, and can either use the MSXML 3.0 or 4.0 parser (which is pre-installed) or any external XSLT processor for this purpose. The "Choose version automatically" option is active per default. XML Spy first tries to use version 4.0 and if not available version 3.0. You can however, manually choose either version by clicking the respective radio button.

Use Microsoft XML Parser (MSXML) 3.0 or 4.0
If you are using Internet Explorer 5 or above (i.e. the MSXML module) for XSLT processing, you must specify if the resulting output is to be transformed as an XML-compliant document (such as XHTML or WML), or non-XML compliant text files.

Installing other XML Parsers
The Component Download Center, accessible through the menu option Help | Components Download, allows you to download and use different XSL processors. The XSL tab below, shows that Infoteria iXSLT 2.0c has been installed.

External XSL transformation program
If you are using an external XSL processor, you must specify a command-line string that is to be executed by XML Spy in order to initiate the XSL Transformation. In this case, use the following variables to build your command-line string:

%1 the XML instance document that is to be processed
%2 the output file that is to be generated
%3 the XSL Stylesheet to be used (optional, if the document contains an <?xsl-stylesheet ...?> reference

You can also choose to show the result of the external XSLT processor directly within XML Spy in a message box.

Please see the technical background information on XSLT Processors for further details.


Scripting

Scripting

The "Scripting" tab allows you to select the scripting environment and other scripting specific parameters.

Activation:
Define if the scripting environment is to be active when XML Spy starts. Click the Browse... button to select the scripting project file.

Standard script language:
Select the scripting language you want to use, JavaScript or VBScript.

Automatic script processing:
This section defines if auto-macros have the right to run, and if event processing is to be enabled.


Window Menu

Window Menu

To organize the individual document windows in an XML Spy session, the Window menu contains standard commands common to most Windows applications.

You can cascade the open document windows, tile them, or arrange document icons once you have minimized them. You can also switch the various Entry Helper windows on or off (such as Project, Info, or Entry-Helpers) or switch to each open document window directly from the menu.


Cascade

Cascade

This command rearranges all open document windows so that they are all cascaded (i.e. staggered) on top of each other.


Tile horizontally

Tile horizontally

This command rearranges all open document windows as horizontal tiles, making them all visible at the same time.


Tile vertically

Tile vertically

This command rearranges all open document windows as vertical tiles, making them all visible at the same time.


Project Window

Project Window

This command lets you switch the Project Window on or off.

This is a dockable window. Dragging on its title bar detaches it from its current position and makes it a floating window. Click right on the title bar, to allow docking or hide the window.


Info Window

Info Window

This command lets you switch the Info Window on or off.

This is a dockable window. Dragging on its title bar detaches it from its current position and makes it a floating window. Click right on the title bar, to allow docking or hide the window.


Entry Helpers

Entry Helpers

This command lets you switch all three Entry-Helper Windows on or off.

All three Entry helpers are dockable windows. Dragging on a title bar detaches it from its current position and makes it a floating window. Click right on the title bar, to allow docking or hide the window.


All on/off

All on/off

This command lets you switch all dockable windows on, or off:

· the Project Window
· the Info Window
· the three Entry-Helper Windows

This is useful if you want to hide all non-document windows quickly, to get the maximum viewing area for the document you are working on.


Currently open window list

Currently open window list

This list shows all currently open windows, and lets you quickly switch between them.

You can also use the Ctrl-TAB or CTRL F6 keyboard shortcuts to cycle through the open windows.


Help Menu

Help Menu

The Help menu contains all commands required to get help or more information on XML Spy, as well as links to information and support pages on our web server.

The Help menu also contains the Registration dialog, which lets you enter your license key-code, once you have purchased the product.


XML Spy Quick Help

XML Spy Quick Help

XML Spy includes a context-sensitive online help system that is based on the Microsoft HTML Help Viewer and lets you directly access information on each menu command, dialog box and window from within XML Spy.

Press the "F1" button on your keyboard to access the context-sensitive help for the currently open dialog box, or press "F1" while you are browsing through the menus with your mouse.

All dialogs include a small question mark symbol (?) in their window title bar. Click on this symbol to access the context-sensitive help topic for that dialog box.

If you would like to learn more about any topic, you can also use the Table of contents and Index commands on the Help menu or search through the entire text of the electronic documentation using the Search command.


Table of contents...

Table of contents...

This command displays a hierarchical representation of all chapters and topics contained in the online help system. Use this command to jump to the table of contents directly from within XML Spy.

Once the help window is open, use the three tabs to toggle between the table of contents, index, and search panes. The Favorites tab lets you bookmark certain pages within the help system.


Index...

Index...

This command accesses the keyword index of XML Spy Online Help. You can also use the Index tab in the left pane of the online help system.

The index, lists all relevant keywords and lets you navigate to a topic by double-clicking the respective keyword. If more than one topic matches the selected keyword, you are presented a list of available topics to choose from:


Search...

Search...

The Search command performs a full-text search in the entire online help system.

· Once you enter your search term into the query field and hit the Return key.
The online help system displays a list of available topics that contain the search term you've entered.
· Double-click on any item in the list to display the corresponding topic.


Registration...

Registration...

When you start XML Spy for the first time, you are automatically presented with the Registration dialog box, which lets you register your software product in order to be eligible for technical support and activate your license, which is done by entering a unique key-code to unlock the software.

FREE Evaluation Version

If you have downloaded the XML Spy from our web server and would like to activate your FREE 30-day evaluation version, please enter your name, company, and e-mail address and click on the "Request FREE evaluation key..." button. XML Spy then uses your Internet connection to transmit the information you have just entered to our web server, where a personal unique evaluation license will be generated for you. The license key-code, which is necessary to unlock your software, will then be sent to the e-mail address you have entered - it is therefore important, that you enter your real e-mail address in the registration dialog box!

Once you have clicked the request button, please go to your favorite mail software and retrieve the license key-code from our e-mail message, which you should be receiving in a matter of a few minutes (depending on transient Internet conditions).

If you requested a key-code and it didn't arrive in a short space of time, the process may have failed due to Firewall restrictions in your network. If this is the case, please send a short message with your information via e-mail to evaluate@xmlspy.com and our support staff will generate a key-code for you manually.

When you have received your evaluation key-code, please enter it into the key-code field in the registration dialog box and click on OK to start working with XML Spy.

Whenever you want to place an order for a licensed version of XML Spy, you can also use the "Order license key..." button in the registration dialog box or the Order form menu command to proceed to the Secure XML Spy Online Shop on the Internet.

Licensed Version

If you have purchased a single-user license for XML Spy, you will receive an e-mail message from us that contains your license-data and includes your name, company and key-code. Please make sure that you enter all fields from your license e-mail into the registration dialog box. The key-code will only be able to unlock your software installation, if the entries in the name and company fields match the name and company entered into our order form.

If your company has purchased a multi-user license for XML Spy, you will receive an e-mail message from us that contains your license-data and includes your company name and key-code.

Please make sure that you enter the company name and key-code from your license e-mail into the registration dialog box and also enter your personal name into the name field. The key-code will only be able to unlock your software installation, if the value in the company field match the company name entered into our order form.

Please note that the XML Spy License-Agreement does not allow you to install more than the licensed number of copies of XML Spy on the computers in your organization (per-seat license).


Order form...

Order form...

When you want to place an order for a licensed version of XML Spy, use this command or the "Order license key..." button in the registration dialog to proceed to the Secure XML Spy Online Shop on the Internet, where you can choose between different single- and multi-user license packs.

Once you have placed your order, you can choose to pay by credit card, send a check by mail, or use a bank wire transfer.


Support Center...

Support Center...

If you have any questions regarding our product, please feel free to use this command to query to our support center on the Internet at any time. This is the place where you'll find links to the FAQ, support form, and e-mail addresses for contacting our support staff directly.


FAQ on the web

FAQ on the web

To help you in getting the best support possible, we are providing a list of Frequently Asked Questions (FAQ) on the Internet, that is constantly updated as our support staff encounters new issues that are raised by our customers.

Please make sure to check the FAQ before contacting our technical support team. This will allow you to get help more quickly.

We regret that we are not able to offer technical support by phone at this time, but our support staff will typically answer your e-mail incidents within one business day.

If you would like to make a feature suggestion for a future version of XML Spy or if you wish to send us any other general feedback, please use the questionnaire form.


Components download

Components download

The Components download option, currently lets you to download the latest Microsoft XML Parser, as well as an alternate XSLT Transformation System, and will be expanded in the future.


XML Spy on the Internet...

XML Spy on the Internet...

This command takes you directly to the XML Spy web-server http://www.xmlspy.com where you can find out about news, product updates and additional offers from the XML Spy team.


XML Spy Training

XML Spy Training

This command takes you directly to the XML Spy web-server http://www.xmlspy.com where you can find out about our authorized XML Spy Training Partners who provide courses on using XML Spy and Advanced XML Application Development (AXAD).


Japanese distributor...

Japanese distributor...

If you are located in Japan, you may prefer to contact our Japanese distributor on the Internet by using this menu command.


About XML Spy...

About XML Spy...

This command shows the XML Spy splash screen and copyright information dialog box, which includes the XML Spy logo.

Please note that this dialog box shows the version number - to find the number of the actual build you are using, please look at the status bar, which always includes the full version and build number.


Dialogs

Dialogs

Most dialog boxes in XML Spy are shown in response to a certain menu command or click on a toolbar button and are, therefore, explained in the individual chapters that describe the respective commands.

This section describes standard dialog boxes, that are used by more than one command.

Assign File
The Assign File dialog box is opened by the Assign DTD, Assign Schema, or Assign XSL commands and prompts you for a file or path name to be used for the requested process:

You can either:
· enter a path name into the text box
· select from a list of most recently used filenames using the drop-down list
· browse for a file on your computer (using the common Open dialog box), or
· use the Window button to select any currently open window or any file that is part of the current project.

Select file
The Select File dialog box lets you choose any currently open window or any file from your current project, as a convenient way to locate a file to be used for the various Assign commands.

Double clicking an entry in either window, places the file name in the Assign File dialog box.

Both windows show the available files based on their extensions depending on which command was selected: Assign DTD, Assign Schema, or Assign XSL.


Internet Links

Internet Links

Altova provides many services through our web site, which you can directly access from the Help Menu within XML Spy or through the help system.

Please visit our XML Spy Home Page frequently to learn about product updates, news, and other XML related information.

The Support Center shows available support options that you can access freely as a registered user.

The FAQ contains a collection of frequently asked questions and their answers. Please make sure that you check this resource, before submitting a new incident to our technical support staff.

If you have been using the evaluation version and want to buy the fully licensed product, or if you need to purchase additional license for your colleagues, please visit our Order Pages to access our secure online shop.


Technical Background Information

Technical Background Information

This chapter contains useful background information on the technical aspects of XML Spy. If you run across a technical term in the remainder of this help system you may occasionally find a link to some of the background materials provided here.


XML Parser

XML Parser

When opening any XML document, XML Spy uses its built-in incremental validating parser to both check the document for well-formedness and validate it against any specified DTD, DCD, XDR, BizTalk, or XSD Schema.

The same parser is also used while editing a document that refers to a DTD, DCD, XDR, BizTalk, or XSD Schema to provide intelligent editing help and immediately display any validation error that is encountered.

This is possible through the incremental design of the new parser that is optimized for the special needs of an integrated development environment.

The built-in parser implements the new May 2nd Final Recommendation XML Schema from the W3C and we are constantly tracking the W3C Schema Group's efforts and are actively participating in all Schema-related discussions to provide you with a state-of-the-art development environment.


Schema Dialects

Schema Dialects

An important aspect of XML is the area of schemas and DTDs that define the logical structure (or content model) of an XML document - XML Spy is the ideal tool that integrates schema and DTD creation while working with XML instance documents.

XML Spy supports both editing and schema-validation of the following schema kinds:

· Document Type Definitions (DTD)
· Document Content Descriptions (DCD)
· XML-Data Reduced (XDR)
· BizTalk
· XML Schema Definition (XSD) draft April 7, 2000, CR Oct. 24 2000, May 2nd 2001 Final Recommendation

and can validate an XML instance document against any of the above schema dialects.

Since the XML Schema definition is still only available as a "last call" draft, the corresponding implementation in the built-in validating parser in XML Spy is a preliminary version. It does, however, already include - among other functions - all of the following important aspects of XML Schemas:

· simpleType & complexType
· element, attribute, attributeGroup
· group, sequence, choice, any
· all datatype facets, including user-defined patterns (!)
· notation, annotation, documentation, include


XSLT Processor

XSLT Processor

To use the full power of XSLT for XSL Transformations, you will need to download and install any XSLT transformation engine, which supports the current XSLT standard from W3C and has a command line interface.

Please note, that we provide some of the most well known XSLT engines on our Components web page http://www.xmlspy.com/components, including Microsoft XML Parser MSXML 3.0 or 4.0.

To use XSLT successfully, please make sure that your XSL Stylesheet correctly refers to the namespace defined in the final XSLT recommendation:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


OS & Memory Requirements

OS & Memory Requirements

XML Spy is a modern 32-bit Windows application that runs on Windows 95, 98, NT 4.0, Windows 2000 and Windows XP. It requires a fair amount of memory to be installed in the system, because it loads each document fully into memory.

On the other hand it typically requires less memory than many Java-based applications, because it is written entirely in C++ and thus does not require the overhead of a Java runtime environment.

Having documents in main memory is necessary to completely parse and analyze each document, and to also improve the viewing and editing speed during normal work. While editing a small to medium sized document (up to 512kB) is possible in as little as 2MB of RAM, opening a 5MB document can consume up to 50MB during the initial parsing process.

Memory requirements are also influenced by the unlimited Undo history. When repeatedly cutting and pasting large selections in large documents, memory can rapidly be depleted.


Internet Usage

Internet Usage

XML Spy is an integrated development environment for XML and as such will, also initiate Internet connections on your behalf in the following situations:

a) if you click the "Request evaluation key-code" in the registration dialog the three fields in the registration dialog box are transferred to our web server by means of a regular http (port 80) connection and the free evaluation key-code is sent back to the customer via regular SMTP e-mail.

b) if you use the Open URL... dialog box to open a document directly from a URL, that document is retrieved through a http (port 80) connection.

c) if you open an XML document that refers to an XML Schema or DTD and the document is specified through a URL, it is also retrieved through a http (port 80) connection, once you validate the XML document. This may also happen automatically upon opening a document, if you have instructed XML Spy to automatically validate files upon opening in the File tab of the Tools | Options dialog.

d) if you are using the Send by mail... command, the current selection or file is sent by means of any MAPI-compliant mail program installed on the user's PC.

All this communication is, of course, only initiated in response to a direct request from you! XML is, after all, related to the Internet and thus any XML development tool must have access Internet protocols to provide an efficient environment for the everyday duties of any XML developer.


Unicode Support

Unicode Support

Unicode is the new 16-bit character-set standard defined by the Unicode Consortium that provides a unique number for every character,

· no matter what the platform,
· no matter what the program,
· no matter what the language.

Fundamentally, computers just deal with numbers. They store letters and other characters by assigning a number for each one. Before Unicode was invented, there were hundreds of different encoding systems for assigning these numbers. No single encoding could contain enough characters: for example, the European Union alone requires several different encodings to cover all its languages. Even for a single language like English, no single encoding was adequate for all the letters, punctuation, and technical symbols in common use.

These encoding systems used to conflict with one another. That is, two encodings used the same number for two different characters, or different numbers for the same character. Any given computer (especially servers) needs to support many different encodings; yet whenever data is passed between different encodings or platforms, that data always runs the risk of corruption.

Unicode is changing all that!
Unicode provides a unique number for every character, no matter what the platform, no matter what the program, and no matter what the language. The Unicode Standard has been adopted by such industry leaders as Apple, HP, IBM, JustSystem, Microsoft, Oracle, SAP, Sun, Base and many others.

Unicode is required by modern standards such as XML, Java, ECMAScript (JavaScript), LDAP, CORBA 3.0, WML, etc., and is the official way to implement ISO/IEC 10646. It is supported in many operating systems, all modern browsers, and many other products. The emergence of the Unicode Standard, and the availability of tools supporting it, are among the most significant recent global software technology trends.

Incorporating Unicode into client-server or multi-tiered applications and web sites offers significant cost savings over the use of legacy character sets. Unicode enables a single software product or a single web site to be targeted across multiple platforms, languages and countries without re-engineering. It allows data to be transported through many different systems without corruption.

Even though XML is clearly defined to be based on the Unicode standard, XML Spy is still one of the few XML development tools that fully implements Unicode!


Windows NT 4.0 & Windows 2000

Windows NT 4.0 & Windows 2000

Starting with version 2.0 XML Spy provided full Unicode support in the Windows NT and Windows 2000 version of the software. To edit any XML document from a non-roman writing system you will, however, also need a font that supports the Unicode characters being used by that document.

Windows NT typically includes support for all common single-byte writing-systems in its Arial, Times, and Courier New fonts and will additionally include all required fonts for the writing-system in your own country (i.e. if you install the Japanese version of Windows NT you will automatically have fonts that support the Katakana, Hiragana, and Kanji writing-systems as well as the input-methods and dictionaries to enter Kanji and to switch between Katakana and Hiragana). If you wish to edit any document from a foreign writing-system, you may want to install additional Windows NT components for that writing-system or purchase special Unicode fonts for these writing-systems (such fonts are available from all leading type vendors).

Please note that most fonts only contain a very specific subset of the entire Unicode range and are therefore typically targeted at the corresponding writing system. Consequently you may encounter XML documents that contain "unprintable" characters, because the font you have selected does not contain the required glyphs. Therefore it can sometimes be very useful to have a font that covers the entire Unicode range - especially when editing XML documents from all over the world.

The most universal font we have encountered is a typeface called "Arial Unicode MS" that has been created by Agfa Monotype for Microsoft. This font contains over 50.000 glyphs and covers the entire set of characters specified by the Unicode 2.1 standard. It needs 23MB and is included with Microsoft Office 2000.

We highly recommend that you install this font on your system and use it with XML Spy, if you are often editing documents in different writing systems. This font is not installed with the "typical" setting of the Microsoft Office setup program, but you can choose the Custom Setup option to install this font.

In the "Examples" folder you will also find a new XHTML file called "Unicode-UTF8.xml" that contains the sentence "When the world wants to talk, it speaks Unicode" in many different languages ("Wenn die Welt miteinander spricht, spricht sie Unicode") and writing-systems (" japanese1 Unicode japanese2 ") - this line has been adopted from the 10th Unicode conference in 1997 and is a beautiful illustration of the importance of Unicode for the XML standard. Opening this file will give you a quick impression on what is possible with Unicode and what writing systems are supported by the fonts available on your PC installation.


Windows 95/98/ME

Windows 95/98/ME

These Windows versions do not include full Unicode capabilities on the operating system layer. Instead support for non-roman writing-systems is provided through so-called code-pages that contain all the required characters mapped to either the available byte-values in the range of 0x80 to 0xFF (in case of single-byte systems, such as Cyrillic or Hebrew) or as double-byte values, where the first most significant bit of the first byte is typically used to indicate that this is a so-called "wide character" (in case of CJK writing-systems).

We therefore provider a special Windows 95/98/ME version of XML Spy that is automatically installed whenever you are using the Setup program on these operating systems. This version of XML Spy supports the following code-pages for viewing and editing XML documents (for excellent background information about code-pages please refer to http://czyborra.com/charsets/codepages.html):

Code-page Equivalent XML Encoding
1252 ISO-8859-1 (Western, Latin-1)
1250 ISO-8859-2 (Eastern Europe, Latin-2)
1251 ISO-8859-5 (Cyrillic)
1253 ISO-8859-7 (Greek)
1254 ISO-8859-9 (Turkish)
1255 ISO-8859-8 (Hebrew)
1256 ISO-8859-6 (Arabic)
874 ISO-8859-11/TIS-620 (Thai)
932 Shift-JIS (Japanese)
936 GB2312 (Chinese)
949 EUC-KR (Korean)
950 Big5 (Taiwanese)

Whenever you open an XML file, XML Spy detects the character-set encoding used in that file, expands the file to an internal full Unicode representation and then transforms the document to a code-page supported by Windows 95/98 in order to enable viewing and editing of the document.

In most cases this process will be entirely automatic, as the available ISO-8895-x encodings as well as some of the CJK encodings often correspond with a certain code-page. However, if you open a Unicode encoded file (e.g. UTF-8 or UTF-16) XML Spy will be unable to determine which code-page to use and will thus bring up a dialog box that asks you to specify a code-page to be used for editing.

In order to correctly view and edit a Unicode file under Windows 95/98/ME it is extremely important that you use this dialog box to:

a) choose the correct code-page that includes all characters contained in the file and
b) later select a font and script from the settings dialog box that also supports the same code-page.

If the file contains any characters that are not available in the selected code-page, the user will receive an error message including a detailed list of offending characters before they will be replaced by a '_' (underscore).

We therefore highly recommend using only the Windows NT/2000 version of XML Spy for editing XML files that make full use of Unicode!


Right-to-Left Writing Systems

Right-to-Left Writing Systems

Please note that even under Windows NT 4.0 any text from a right-to-left writing-system (such as Hebrew or Arabic) is not rendered correctly except in those countries that actually use right-to-left writing-systems. This is due to the fact that only the Hebrew and Arabic versions of Windows NT contains support for rendering and editing right-to-left text on the operating system layer.


RichEdit Component

RichEdit Component

XML Spy uses the Microsoft-supplied "RichEdit" component for editing documents in the Text View. The version of RichEdit that is available in Windows 98 and Windows NT 4.0 is called RichEdit 2.0 and contains many known limitations.

Windows 2000 contains a new and vastly improved version called RichEdit 3.0, that not only fixes most known bugs, but also contains special support for finer Undo-Control as well as better international capabilities with foreign writing systems.

XML Spy already contains full support for RichEdit 3.0 and takes advantage of the new features, if it detects the presence of RichEdit 3.0.

Altova is a registered MCSP (Microsoft Certified Solution Provider), we are unfortunately not allowed to distribute the RichEdit 3.0 component to our customers (RichEdit is only available as part of the operating system and is not redistributable).

We are, however, allowed to suggest that if you have access to a Windows 2000 CD-ROM you should install Windows 2000 on some machine and copy the file "riched20.dll" from the Windows\System directory of that machine to the Windows NT 4.0 or Windows 98 Windows installation (thereby replacing the old RichEdit 2.0 version) that you wish to use XML Spy on.

This will get you all the benefits of RichEdit 3.0 now and will - in our experience - not cause any compatibility problems, since the RichEdit 3.0 component is fully compatible with Windows 98 and Windows NT 4.0.


License Metering

License Metering

XML Spy has a built-in license metering module that helps you in avoiding any unintentional violation of our license agreement. XML Spy can be licensed either as a single-user or multi-user software and depending on your license, this license-metering module makes sure, that no more than the licensed number of users are using XML Spy concurrently.

This license-metering technology uses your local area network (LAN) to communicate between instances of XML Spy running on different computers.

Single license
When XML Spy starts up, it sends a short broadcast datagram to find any other instance of the product running on another computer in the same network segment. If it doesn't get any response, it will open a port for listening to other instances of XML Spy. Other than that, it will do nothing at all in a single-user situation. If you are not connected to a LAN or are using dial-up connections to connect to the Internet, XML Spy will NOT generate any network traffic at all.

Multi license
If more than one copy of XML Spy is used within the same LAN, they will briefly communicate with each other on startup, to exchange their key-codes to ensure that the number of concurrent licenses purchased is not accidentally violated, as additional copies of the product are launched by more users.

This is the same kind of license metering technology, that is common in the Unix world and with many other database development tools and allows our customers to purchase reasonably-priced concurrent-use multi-user licenses (see http://www.xmlspy.com/order for our price list).

Please note, that XML Spy is at no time attempting to send any information out of your LAN, or over the Internet. We are also deliberately sending very few and small network packets so as to not put a burden on any network. The TCP/IP ports (2799) used by XML Spy are officially registered with the IANA see http://www.isi.edu/in-notes/iana/assignments/port-numbers for details) and our license-metering module is a proven and tested technology.

If you are using a firewall, you may notice communications on port 2799 between the computers that are running XML Spy. You are, of course, free to block such traffic between different groups in your organization, as long as you can ensure by other means, that your license agreement is not violated.

You will also notice, that XML Spy contains many useful functions that make use of your Internet connection, but these are unrelated to the license-metering technology.


Appendix

Appendix

This appendix contains important legal information concerning your rights to use this software product. Please read carefully - this information is binding, as you have agreed to these terms upon installation of this software product.


Electronic Software Distribution

Electronic Software Distribution

We are making XML Spy available through electronic software distribution only, because this method offers many unique benefits for our customers:

· you can freely evaluate the software before making a purchasing decision
· once you decide to buy the software, you can place your order online and immediately get a fully licensed product within minutes
· you can be sure to always get the latest version of our software
· we include both a comprehensive integrated online-help system and an electronic manual that you can also print out, if you prefer to read your documentation on paper

Once you download this software product, you may evaluate the XML Spy for a period of up to 30 days free of charge. During this evaluation period the software will start to remind you after about 20 days that it has not been licensed yet. The reminder message will, however, only be displayed once every time you start the program.

If you would like to continue using the program after the 30 day evaluation period, you have to purchase a license, which is delivered in the form of a key-code that you enter into the Registration dialog to unlock the product.

You can register and purchase your license on-line by directing your browser to access our web-shop at http://www.xmlspy.com/order. On this page you will get detailed pricing information (including multi-user discounts) and also find a list of authorized distributors and resellers.

If you want to share XML Spy with others, please make sure that only the installation program is ever distributed. It contains the application program, grammar description, sample files, and this online manual as well as a quick Read-Me file in one neat package. Any person that receives the XML Spy software from you is also automatically entitled to a 30 day evaluation period. After the expiration of said period, any other user must also purchase a license in order to be able to use XML Spy.

For further details, please refer to the SOFTWARE PRODUCT LICENSE at the end of this manual.


Copyright

Copyright

All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by Altova GmbH or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material.

Copyright ©1998-2002 Altova GmbH

All rights reserved.

The Sentry Spelling-Checker Engine Copyright © 2000 Wintertree Software Inc.


Software Product License

Software Product License

THIS IS A LEGAL DOCUMENT -- RETAIN FOR YOUR RECORDS

ALTOVA SOFTWARE LICENSE AGREEMENT

Licensor:

Altova GmbH
Rudolfsplatz 13a/9
A-1010 Wien
Austria

Notice to User:
This is a legal document between you and Altova GmbH ("Altova"). It is important that you read this document before using the Altova-provided software ("Software") and any accompanying documentation ("Documentation"). By using the Software, you agree to be bound by the terms of this Agreement whether or not you decide to purchase the Software. If you do not agree, you are not licensed to use the Software, and you must destroy any downloaded copies of the Software in your possession or control. Please go to our Web site to download and print a copy of this Agreement for your files.

1. SOFTWARE LICENSE
(a) License Grant. Altova grants you a non-exclusive, non-transferable (except as provided below), limited license to install and use a copy of the Software on your compatible computer, up to the Permitted Number of computers. The Permitted Number of computers shall be delineated at such time as you elect to purchase the Software.

(b) Server Use. You may install one copy of the Software on your computer file server for the purpose of downloading and installing the Software onto other computers within your internal network up to the Permitted Number. No other network use is permitted, including without limitation using the Software either directly or through commands, data or instructions from or to a computer not part of your internal network, for Internet or Web-hosting services or by any user not licensed to use this copy of the Software through a valid license from Altova.

(c) Concurrent Use. If you have purchased a "Concurrent-User" version of the Software, you may install the Software on any compatible computers, up to ten (10) times the Permitted Number of users, provided that only the Permitted Number of users actually use the Software at the same time. The Permitted Number of concurrent users shall be delineated at such time as you elect to purchase the Software.

(d) Backup and Archival Copies. You may make one backup and one archival copy of the Software, provided your backup and archival copies are not installed or used on any computer and further provided that all such copies shall bear the original and unmodified copyright, patent and other intellectual property markings that appear on or in the Software. You may not transfer the rights to a backup or archival copy unless you transfer all rights in the Software as provided under Section 3.

(e) Home Use. You, as the primary user of the computer on which the Software is installed, may also install the Software on one of your home computers. However, the Software may not be used on your home computer at the same time as the Software is being used on the primary computer.

(f) Key Codes. You will receive a key code when you elect to purchase the Software. The key code will enable you to activate the Software after an initial thirty (30)-day evaluation period. You may not relicense, reproduce or distribute a key code except with the express written permission of Altova.

(g) Title. Title to the Software is not transferred to you. Ownership of all copies of the Software and of copies made by you is vested in Altova, subject to the rights of use granted to you in this Agreement.

(h) Reverse Engineering. You may not reverse engineer, decompile, disassemble or otherwise attempt to discover the source code, underlying ideas, underlying user interface techniques or algorithms of the Software by any means whatsoever, directly or indirectly, or disclose any of the foregoing, except to the extent you may be expressly permitted to decompile under applicable law, it is essential to do so in order to achieve operability of the Software with another software program, and you have first requested Altova to provide the information necessary to achieve such operability and Altova has not made such information available. Altova has the right to impose reasonable conditions and to request a reasonable fee before providing such information. Any information supplied by Altova or obtained by you, as permitted hereunder, may only be used by you for the purpose described herein and may not be disclosed to any third party or used to create any software which is substantially similar to the expression of the Software. Requests for information should be directed to the Altova Customer Support Department.

(i) Other Restrictions. You may not loan, rent, lease, sublicense, distribute or otherwise transfer all or any portion of the Software to third parties except to the limited extent set forth in Section 3. You may not copy the Software except as expressly set forth above, and any copies that you are permitted to make pursuant to this Agreement must contain the same copyright, patent and other intellectual property markings that appear on or in the Software. You may not modify, adapt or translate the Software. You may not, directly or indirectly, encumber or suffer to exist any lien or security interest on the Software; knowingly take any action that would cause the Software to be placed in the public domain; or use the Software in any computer environment not specified in this Agreement. You will comply with applicable law and Altova's instructions regarding the use of the Software. You agree to notify your employees and agents who may have access to the Software of the restrictions contained in this Agreement and to ensure their compliance with these restrictions. THE SOFTWARE IS NOT INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION, COMMUNICATION SYSTEMS OR AIR TRAFFIC CONTROL EQUIPMENT, WHERE THE FAILURE OF THE SOFTWARE COULD LEAD TO DEATH, PERSONAL INJURY OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.

(j) License Metering. Altova has a built-in license metering module that helps you to avoid any unintentional violation of this Agreement. Altova may use your internal network for license metering between installed versions of the Software.

2. INTELLECTUAL PROPERTY RIGHTS

Acknowledgement of Altova's Rights. You acknowledge that the Software and any copies that you are authorized by Altova to make are the intellectual property of and are owned by Altova and its suppliers. The structure, organization and code of the Software are the valuable trade secrets and confidential information of Altova and its suppliers. The Software is protected by copyright, including without limitation by United States Copyright Law, international treaty provisions and applicable laws in the country in which it is being used. You acknowledge that Altova retains the ownership of all patents, copyrights, trade secrets, trademarks and other intellectual property rights pertaining to the Software, and that Altova's ownership rights extend to any images, photographs, animations, videos, audio, music, text and "applets" incorporated into the Software and all accompanying printed materials. You will take no actions, which adversely affect Altova's intellectual property rights in the Software. Trademarks shall be used in accordance with accepted trademark practice, including identification of trademark owners' names. Trademarks may only be used to identify printed output produced by the Software, and such use of any trademark does not give you any right of ownership in that trademark. XML Spy and Altova are trademarks of Altova GmbH (registered in numerous countries). Unicode and the Unicode Logo are trademarks of Unicode, Inc. Windows, Windows 95, Windows 98, Windows NT and Windows 2000 are trademarks of Microsoft. W3C, CSS, DOM, MathML, RDF, XHTML, XML and XSL are trademarks (registered in numerous countries) of the World Wide Web Consortium (W3C); marks of the W3C are registered and held by its host institutions, MIT, INRIA and Keio. Except as expressly stated above, this Agreement does not grant you any intellectual property rights in the Software.

3. LIMITED TRANSFER RIGHTS
Notwithstanding the foregoing, you may transfer all your rights to use the Software to another person or legal entity provided that: (a) you also transfer each of this Agreement, the Software and all other software or hardware bundled or pre-installed with the Software, including all copies, updates and prior versions, and all copies of font software converted into other formats, to such person or entity; (b) you retain no copies, including backups and copies stored on a computer; (c) the receiving party secures a personalized key code from Altova; and (d) the receiving party accepts the terms and conditions of this Agreement and any other terms and conditions upon which you legally purchased a license to the Software. Notwithstanding the foregoing, you may not transfer education, pre-release, or not-for-resale copies of the Software.

4. PRE-RELEASE PRODUCT ADDITIONAL TERMS

If the product you have received with this license is pre-commercial release or beta Software ("Pre-release Software"), then this Section applies. To the extent that any provision in this Section is in conflict with any other term or condition in this Agreement, this Section shall supersede such other term(s) and condition(s) with respect to the Pre-release Software, but only to the extent necessary to resolve the conflict. You acknowledge that the Software is a pre-release version, does not represent final product from Altova, and may contain bugs, errors and other problems that could cause system or other failures and data loss. CONSEQUENTLY, THE PRE-RELEASE SOFTWARE IS PROVIDED TO YOU "AS-IS", AND ALTOVA DISCLAIMS ANY WARRANTY OR LIABILITY OBLIGATIONS TO YOU OF ANY KIND EXPRESS OR IMPLIED. WHERE LEGALLY LIABILITY CANNOT BE EXCLUDED FOR PRE-RELEASE SOFTWARE, BUT IT MAY BE LIMITED, ALTOVA'S LIABILITY AND THAT OF ITS SUPPLIERS SHALL BE LIMITED TO THE SUM OF FIFTY DOLLARS (U.S.$50) IN TOTAL. You acknowledge that Altova has not promised or guaranteed to you that Pre-release Software will be announced or made available to anyone in the future, that Altova has no express or implied obligation to you to announce or introduce the Pre-release Software and that Altova may not introduce a product similar to or compatible with the Pre-release Software. Accordingly, you acknowledge that any research or development that you perform regarding the Pre-release Software or any product associated with the Pre-release Software is done entirely at your own risk. During the term of this Agreement, if requested by Altova, you will provide feedback to Altova regarding testing and use of the Pre-release Software, including error or bug reports. If you have been provided the Pre-release Software pursuant to a separate written agreement, your use of the Software is governed by such agreement. You may not sublicense, lease, loan, rent, distribute or otherwise transfer the Pre-release Software. Upon receipt of a later unreleased version of the Pre-release Software or release by Altova of a publicly released commercial version of the Software, whether as a stand-alone product or as part of a larger product, you agree to return or destroy all earlier Pre-release Software received from Altova and to abide by the terms of the license agreement for any such later versions of the Pre-release Software.

5. WARRANTY AND LIMITATION OF LIABILITY

(a) Limited Warranty. Altova warrants that (a) the Software will perform substantially in accordance with the accompanying written materials for a period of ninety (90) days from the date of receipt, and (b) any support services provided by Altova shall be substantially as described in applicable written materials provided to you by Altova, and Altova support engineers will make commercially reasonable efforts to solve any problem issues. Some states and jurisdictions do not allow limitations on duration of an implied warranty, so the above limitation may not apply to you. To the extent allowed by applicable law, implied warranties on the Software, if any, are limited to ninety (90) days.

(b) Customer Remedies. Altova's and its suppliers' entire liability and your exclusive remedy shall be, at Altova's option, either (a) return of the price paid, if any, or (b) repair or replacement of the Software that does not meet Altova's Limited Warranty and which is returned to Altova with a copy of your receipt. This Limited Warranty is void if failure of the Software has resulted from accident, abuse or misapplication. Any replacement Software will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer.

(c) No Other Warranties. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, ALTOVA AND ITS SUPPLIERS DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, INFORMATIONAL CONTENT OR ACCURACY, QUIET ENJOYMENT, TITLE AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO STATE/JURISDICTION.

(d) Limitation Of Liability. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL ALTOVA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF ALTOVA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY CASE, ALTOVA'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS AGREEMENT SHALL BE LIMITED TO THE GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE PRODUCT OR U.S.$50.00; PROVIDED, HOWEVER, IF YOU HAVE ENTERED INTO AN ALTOVA SUPPORT SERVICES AGREEMENT, ALTOVA'S ENTIRE LIABILITY REGARDING SUPPORT SERVICES SHALL BE GOVERNED BY THE TERMS OF THAT AGREEMENT. Because some states and jurisdictions do not allow the exclusion or limitation of liability, the above limitation may not apply to you. In such states and jurisdictions, Altova's liability shall be limited to the greatest extent permitted by law.

(e) Infringement Claims. Altova will indemnify and hold you harmless and will defend or settle any claim, suit or proceeding brought against you that is based upon a claim that the content contained in the Software infringes a copyright or violates an intellectual or proprietary right protected by United States or European Union law ("Claim"), but only to the extent the Claim arises directly out of the use of the Software. You must notify Altova in writing of any Claim within ten (10) business days after you first receive notice of the Claim, and you shall provide to Altova at no cost with such assistance and cooperation as Altova may reasonably request from time to time in connection with the defense of the Claim. Altova shall have sole control over any Claim (including, without limitation, the selection of counsel and the right to settle on your behalf on any terms Altova deems desirable in the sole exercise of its discretion). You may, at your sole cost, retain separate counsel and participate in the defense or settlement negotiations. Altova shall pay actual damages and costs awarded against you (or payable by you pursuant to a settlement agreement) in connection with a Claim to the extent such damages and costs are not reimbursed to you by insurance or a third party, to an aggregate maximum of US$1,000. If the Software or its use becomes the subject of a Claim or its use is enjoined, or if in the opinion of Altova's legal counsel the Software is likely to become the subject of a Claim, Altova shall attempt to resolve the Claim by using commercially reasonable efforts to modify the Software or obtain a license to continue using the Software. If in the opinion of Altova's legal counsel the Claim, the injunction or potential Claim cannot be resolved through reasonable modification or licensing, Altova, at its own election, may terminate this Agreement without penalty, and will refund to you on a pro rata basis any fees paid in advance by you to Altova. THE FOREGOING CONSTITUTES ALTOVA'S SOLE AND EXCLUSIVE LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT.

6. TERM AND TERMINATION
This Agreement may be terminated (a) by your giving Altova written notice of termination; or (b) by Altova, at its option, giving you written notice of termination if you commit a breach of this Agreement and fail to cure such breach within ten (10) days after notice from Altova. Upon any termination of this Agreement, you must cease all use of the Software, destroy all copies then in your possession or control and take such other actions as Altova may reasonably request to ensure that no copies of the Software remain in your possession or control.

7. GENERAL PROVISIONS

If there is a local subsidiary of Altova in the country in which the Software was obtained, then the local law of the jurisdiction in which the subsidiary is located shall govern this Agreement. Otherwise, this Agreement shall be governed by the laws of the Republic of Austria and, to the extent applicable, the European Union. This Agreement contains the entire agreement and understanding of the parties with respect to the subject matter hereof, and supersedes all prior written and oral understandings of the parties with respect to the subject matter hereof. Any notice or other communication given under this Agreement shall be in writing and shall have been properly given by either of us to the other if sent by certified or registered mail, return receipt requested, or by overnight courier to the address shown on Altova's Web site for Altova and the address shown in Altova's records for you, or such other address as the parties may designate by notice given in the manner set forth above. This Agreement will bind and inure to the benefit of the parties and our respective heirs, personal and legal representatives, affiliates, successors and permitted assigns. The failure of either of us at any time to require performance of any provision hereof shall in no manner affect such party's right at a later time to enforce the same or any other term of this Agreement. This Agreement may be amended only by a document in writing signed by both of us. In the event of a breach or threatened breach of this Agreement by either party, the other shall have all applicable equitable as well as legal remedies. The Software and its related documentation may not be exported or reexported in violation of the U.S. Export Administration Act and its implementing regulations or the laws of the jurisdiction in which the Software was obtained. Each party is duly authorized and empowered to enter into and perform this Agreement. If, for any reason, any provision of this Agreement is held invalid or otherwise unenforceable, such invalidity or unenforceability shall not affect the remainder of this Agreement, and this Agreement shall continue in full force and effect to the fullest extent allowed by law. The parties knowingly and expressly consent to the foregoing terms and conditions.

Previous Top