Welcome to XML Spy

xml spy
[Main] [Next]

Welcome to XML Spy

XML Spy is the first true Integrated Development Environment (IDE) for the eXtensible Markup Language (XML) and contains many useful functions that can simplify typical XML editing tasks for you. This help system is provided to help you get started with using our software and provides detailed information on all aspects of the product.

It includes a Tutorial section 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.

You may also want to periodically check our XML Spy web-server for news, updates, and new examples:

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.

© 2001 Altova


Getting started with XML

[Previous] [Main] [Next]

Getting started with 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 3.5 online help and printable documentation contain a Tutorial section that give you a general overview of XML and XML Spy.

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.


Tutorial

Tutorial

This Tutorial will introduce you to XML, and how to use XML Spy for all your XML-related editing needs.

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.


Introduction to XML

Introduction to 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.


What is XML

What is XML

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 for 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 an 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 two 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:

This is the same XML document as above, but includes 4 products in the invoice. 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, Access, 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 up to the current 3.0 version, 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.

XLink
The "XML Linking Language" describes hyperlinking in XML documents and extends the hyperlinking concepts of HTML.

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.


Using XML Spy

Using XML Spy


Overview

Overview

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 "Display as Table" [image] function has been activated for the Division element. "Display as Table" displays recurring elements in tabular form. This embedded view, is available in all XML spy views wherever recurring elements occur. Click on the same icon to return to the grid 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 documents for the current 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 "particles" (elements, complex types etc.) in list form.

To see graphical representation of each particle:
1. Click on the [image] icon next to the particle you want to display.
The content model for that particle 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, text view, embedded database/table view, or browser view.

The left area contains the project and info windows; the right area contains the entry helper 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 five advanced views on your documents:
· | An Enhanced Grid View for structured editing
· | An embedded Database/Table view, which is available in all views, 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, 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 Settings dialog. Select the menu option Edit | Settings to open this dialog.


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 determined by their contents alone and cannot be adjusted by the user.

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 is 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 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 Table | Ascending Sort
· | Append (or insert) rows using the menu command Table | Insert Row.

Exchanging data from the Database/Table view
To exchange with other applications, select elements in this table and copy/paste them directly into Access or Excel. 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 lets directly you import or export XML data from any text file, Word document or database.


Schema Design View

Schema Design View

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

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 Candidate recommendation of Oct. 24th 2000, and the ability to convert schemas from the April 7th 2000 working draft, to the Candidate recommendation.
· | Generation of DTD/Schema from an XML document (Text view)
· | 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 particles

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 "particles" (elements, complex types etc.) in list form. The bottom window displays the corresponding attributes of the currently selected particle (eg. Mgr. Prg etc.).

Content model
The content model is a graphical representation of a particle. The tree structure as well as annotations etc. are show 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 particle:
· | Click on the [image] icon next to the particle you want to display, or
· | Select the menu option Schema design | Display Diagram, or
· | Double click on a particle name in the "Particle Navigator" (Top right entry helper).

The content model for that particle, 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.

Appending or inserting Particles
1. Click the Append [image] or Insert [image] icon at the top left of the particle window.
2. Select the particle (or function) you want to append from the popup.

Appending or inserting Attributes to a particle
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 or complex, but not mixed.
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.

Namespace attributes:
strict
There must be a global declaration for the item available, or it must have an xsi:type, and it must be valid.
skip
No constraints: the item must be well-formed.
lax
If the item, or sub-items has a unique determined declaration, it must be valid with respect to that definition.

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 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:
A "complex type" element, is a datatype containing attributes and non-text children.
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 particle 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 element name in the yellow box (here, PersonType) or,
2. Click on the "Com" tab of the Particle 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 particles
There are two methods of defining global particles: creating a new particle from scratch, or changing an existing element into global particle.

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

The global particle appears in the "Elm" tab of the Particle navigator. Double clicking on the particle, displays the tree view of that particle in the main window.

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

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

To change an element into a global particle:
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 particles
A reference to a global particle can be created in two ways:
· | You add a particle to a schema which has the same name as an existing global particle. This causes a dialog to appear, prompting you if you want to reference the element to it. Confirming with OK, references the particle to the particle 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 particle 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.
1. The element definition appears, along with the corresponding info in the details window, or
2. Right click the element and select Go to Definition from the context menu.
The element definition appears in the main window.

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, 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.


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.


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 MSXML3 technology preview if you intend to work with XSLT in XML Spy, as MSXML3 already supports most of the W3C XSLT Recommendation. Please see our FAQ on the Internet 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).

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.

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


Entry Helper Windows

Entry Helper Windows

XML Spy 3.5 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 Particle Navigator, and displays information on Global Particles: elements, groups, complex types, simple types, attributes and attribute groups.

To display the content model of a particle:
· | Click the particle type tab (Elm, Grp. etc.), and
· | Double click on the desired particle, 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

If you are editing DTDs or documents based upon a DTD content-model (such as XHTML), 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).


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.

Opening files not available in the Create new document dialog
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 File Type Settings dialog.

Assigning a DTD / Schema to a new XML document
XML Spy contains built-in templates for most XML-based document types and will automatically provide 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 \Templates directory, automatically created one level below the XML Spy installation directory.

If you select the ".xml XML Document" entry, (typically a new XML instance document) in the above dialog, 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, 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 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 (the list of available file types can be configured through the File Type page on the Settings 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 Settings dialog.


Open URL...

Open URL...

The "Open URL..." command, allows you to open non-local files from a URL (uniform resource locator) address.

To open an URL address:
1. Enter the URL in the URL field
2. Click the Browse button to see and navigate the directory structure of the server.
3. Double click the file you want to load, or select the file and click the OK button.

The file you open appears in the main window. If the XML file refers to a schema file that is also available in the same server directory, then the schema file will also be loaded into XML Spy.

The Up button moves you up one directory in the directory structure, while the New Folder button creates a new directory on the server if your access rights permit it.

The Browse function is only available on servers which support the following protocols:
· | FTP
· | HTTP
· | HTTPS
· | or servers supporting WebDAV

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

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 and FTP servers, the 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 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 page of the Settings 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 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. If the document was opened from a URL, the Save as... dialog is opened, allowing you to save the document under a different name.

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 page on the Settings 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 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 wan to save is active in the XML Spy main window.
2. Select the menü 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
· | HTTPS
· | 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 and FTP servers, the 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 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 where you can control what appears on the printout. This dialog will 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 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 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 without starting the print process.


Print Setup...

Print Setup...

The "Print Setup..." command, displays the printer-specific "Print Setup" dialog, 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.

You can also edit XML Spy settings by clicking on the "Settings..." option in this menu.


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: 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 Edit tab on the Settings 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 3.5 FAQ</link_text>
            </link>
            <link mode="internal">
                <link_section>support</link_section>
                <link_subsection>faq25</link_subsection>
                <link_text>XML Spy 2.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 Settings 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.


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.


Settings

Settings

The "Settings" command, allows you to define the global program settings in a tabbed dialog. 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 3.5 http://www.xmlspy.com --> near the top of the file. 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 you want XML Spy 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. You should not modify these settings unless you are adding a new file type and are sure of what you are doing.

Default view
You can define the default XML Spy view to be used, for each file type.

Grid view
You can define if the Enhanced Grid View should automatically build tables.

Text view
You can turn off 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
You can add new file types (or remove them) from the File types list, with the respective buttons.


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.

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.

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.


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, 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 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, 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 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 parser or any external XSLT processor for this purpose.

Use Microsoft XML Parser (MSXML) 3.0
If you are using Internet Explorer 5 (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.

Use 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 ons XSLT Processors for further details.


Scripting

Scripting

The scripting environment is currently in Beta test and will be provided at a later time.

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.


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

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...

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

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

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

Saves the current project.


Source control

Source control

XML Spy supports Microsoft Source-Save 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.

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, 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 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, 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 prompt appears stating that the directory is under source control, and offers the option to check it out.
7. Click the OK, if you want bidirectional source save control to be enabled.
The Check out dialog 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 might contain extra command buttons. In this case the Advanced... button opens the Advanced Check Out Options dialog.

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, above the L in 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. It is placed in your local working directory and is automatically loaded into XML Spy. Changes made to this file are not updated in the source control program.


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. You are the only person allowed to make changes to the file.

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)
· | A complete XML Spy project, click on the project file icon.

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

To accept the changes you made to the file:
Select the Check in command.

To reject the changes you made to the file:
Select the Undo Check Out command.


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, above the L in the XML 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)
· | A complete 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 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.

This command 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 prompting for more information may appear at this time.

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 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.

Please note:
You must have saved the checked out file at least once for the differences to be protocolled.


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 checks the status of the currently selected file(s) and refreshes the file list.


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...

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.

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.


Add URL to Project...

Add URL to Project...

Adds a 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

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

Adds the 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 Folder to Project...

Add Folder to Project...

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.


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.


Most Recently Used Projects

Most Recently Used Projects

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. (Edit | Settings | 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

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

Insert 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

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

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

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

Inserts 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

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

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

Insert 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

Inserts an external ID (SYSTEM or PUBLIC) into a DOCTYPE declaration before the selected item.


Insert ELEMENT

Insert ELEMENT

Inserts an element declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.


Insert ATTLIST

Insert ATTLIST

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

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


Insert NOTATION

Insert NOTATION

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


Append

Append

Appends a new 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

CTRL+I

Appends a new attribute after the last element within the same parent.


Append Element

Append Element

CTRL+E

Appends a new element after the last element within the same parent.


Append Text

Append Text

CTRL+T

Appends a new text content block after the last element within the same parent.


Append CDATA

Append CDATA

CTRL+D

Appends a new CDATA block after the last element within the same parent.


Append Comment

Append Comment

CTRL+M

Appends a new Comment after the last element within the same parent.


Append XML

Append XML

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 that it must appear at the very top of the file.


Append Processing Instruction

Append Processing Instruction

Appends a new Processing Instruction (PI) after the last element within the same parent.


Append DOCTYPE

Append DOCTYPE

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, that 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

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


Append ELEMENT

Append ELEMENT

Appends an element declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Append ATTLIST

Append ATTLIST

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


Append ENTITY

Append ENTITY

Appends an entity declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Append NOTATION

Append NOTATION

Appends a notation declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).


Add Child

Add Child

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

Inserts a new attribute as a child of the selected item.


Add Child Element

Add Child Element

Hotkey: CTRL+ALT+E

Inserts a new element as a child of the selected item.


Add Child Text

Add Child Text

Hotkey: CTRL+ALT+T

Inserts new text content as a child of the selected item.


Add Child CDATA

Add Child CDATA

Hotkey: CTRL+ALT+D

Inserts a new CDATA block as a child of the selected item.


Add Child Comment

Add Child Comment

Hotkey: CTRL+ALT+M

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...

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

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.

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

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


Add Child ELEMENT

Add Child ELEMENT

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

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

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

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

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 will appear.


Convert To Attribute

Convert To Attribute

Converts the selected item into a new attribute.


Convert To Element

Convert To Element

Converts the selected item into an element.


Convert To Text

Convert To Text

Converts the selected item into text content.


Convert To CDATA

Convert To CDATA

Converts the selected item into a CDATA block.


Convert To Comment

Convert To Comment

Converts the selected item into a Comment.


Convert To XML

Convert To XML

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

Converts the selected item to a new Processing Instruction (PI)


Convert To DOCTYPE

Convert To DOCTYPE

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

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


Convert To ELEMENT

Convert To ELEMENT

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

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

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

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


Move Left

Move Left

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

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 you are 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.


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 also automatically checks for well-formedness whenever a document is opened, saved, or the view mode is switched from Text to Enhanced Grid or Browser.

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 mal-formed 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

XML Spy can validate 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:

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 "Check well-formedness" 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 (XSD)

You can validate these schemas against their specification, to make 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

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...

To make working with XML namespaces a bit easier, XML Spy provides a "Set Namespace" command that lets you set the namespace 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 3.5 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.


Assign DTD...

Assign DTD...

This command allows you to assign a Document Type Definition (DTD) to an XML document to be used for 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 allows you to assign a Schema to an XML document that is to be used for 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 is available in the Text view.

If your XML instance document is based on a certain Document Type Definition (DTD) use this command to open the corresponding DTD file.


Go to Schema

Go to Schema

This command is available in the Text view.

If your XML instance document is based on a certain Schema use this command to open the corresponding Schema definition file.


Go to Definition

Go to Definition

"Go to Definition" icon [image].

This command is available in the Enhanced Grid and Text view.

While editing an XML document it can be useful to look up 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 Text view:
1. Click on the item definition in one of the Entry helper windows
2. Select the menu item 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...

If you are defining a new schema or DTD it is often helpful to create a few example XML documents as a starting point.

XML Spy then allows you to generate a new schema from an XML document (or from a set of documents in the project window).

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.

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...

In the of ever-changing world of schema versions it is important to have a tool at hand that can easily convert your content model between the various schema dialects.

Open your existing Schema or DTD, and use this command to convert your DTDs into XML Schemas compliant with the Oct. 24 2000 CR - or the other way round.


Flush Memory Cache

Flush Memory Cache

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.

If memory is tight on your system, or if you have been using many different documents based on different schemas recently, use this command to flush all cached Schema and DTD documents from memory.


Schema design Menu

Schema design Menu

The Schema design menu allows you set global parameters for your work with XML Spy.

This menu allows you to: define your schema settings, save a particle diagram, save Schema documentation in as much detail as you wish, and define how much extra element information you want to display during editing.


Schema settings

Schema settings

This command allows you to 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...

Save Diagram...

This command enables you to save the particle graphic (content model in the main window) in PNG format.


Save Documentation

Save Documentation

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

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

Include:
Select which items you want to include in the documentation: 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:


View config

View config

This command allows you to configure the content model view. The dialog 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 particle 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.


Zoom

This command allows you to control 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 returns you to the Schema overview while viewing the content model of a particle.

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 particle.

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


XSL Menu

XSL Menu

The eXtensible Stylesheet Language (XSL) and in particular the XSL Transformation (XSLT) lets 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

To perform 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 Settings dialog (Select Edit | Settings to open this dialog.)

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 ons XSLT Processors for further details.


Assign XSL...

Assign XSL...

This command allows you to assign an XSL stylesheet to an XML document to be used for XSL Transformation or rendering by any 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

If your XML document contains a reference to an XSL stylesheet, this command lets you open the corresponding XSL or XSLT document.


Convert Menu

Convert Menu

XML Spy 3.5 provides powerful data exchange functions that allow you to convert back and forth between text, word processor, database, and XML files.


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, 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 allows you to import database data from many sources. You can select an existing Microsoft Access (i.e. Jet Engine) file or specify any ActiveX Data Object (ADO) data source (such as SQL Server, Oracle, or any other ODBC-conformant database).

Source database
Once you have selected your data source, you can either choose a 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.

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.

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.

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.

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 - is imported as an attribute
Contacts.Company - is not imported
FirstName, LastName - are imported as elements.


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.

ADO Data Link properties dialog:

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 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 can 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 Schema Generation function to get all the datatype information you need from your database into your XML documents.


Import Microsoft Word document...

Import Microsoft Word document...

This command allows you to directly import any Word document and convert it to 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 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.


Export to Text files / Database...

Export to Text files / Database...

This command allows you to export 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 Text File

Export Text File

This command 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 and can also set the same options that are also available in the Import text file dialog.

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.


Export Database

Export Database

This command 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 ADO-compliant database system (such as SQL Server or Oracle).

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


Table Menu

Table Menu

The Table menu 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 icon:

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

Select the first element of any sequence of repeated elements, and use this command to display the elements in a tabular fashion. This will effectively break 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 icon:

If you are displaying repeated elements in the Database/Table View, you can add new rows by:

1. Clicking a row number in the table (or one of the cells), and
2. Selecting the menu option 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 icon:

If you are displaying repeated elements in the Database/Table View, you can append a new row to the table by:

1. Clicking a row number in the table (or one of the cells), and
2. Selecting the menu option 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

Icon:

If you are displaying repeated elements in the Database/Table View, you can sort the column elements in ascending order by:

1. Clicking a column header in the table, and
2. Selecting the menu option 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 to prompt for help:


Descending Sort

Descending Sort

Icon:

If you are displaying repeated elements in the Database/Table View, you can sort the column elements in descending order by:

1. Clicking a column header in the table, and
2. Selecting the menu option 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 this dialog to prompt for help:


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

Icon:

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

Icon:

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 particles

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 "particles" (elements, complex types etc.) in list form. The bottom window displays the corresponding attributes of the currently selected particle (eg. VIP Mgr. Prg etc.).

Schema overview:

Graphical particle view


Text View

Text View

Icon:

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 Settings dialog). Use the menu command Edit | Settings 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.


Browser View

Browser View

Icon:

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 Settings dialog). Use the menu command Edit | Settings 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 allows you to synchronize the Enhanced Grid view and Tree view in the main window, to locate an item in a large document.

To see the Tree view, you must activate the "Show Tree" checkbox in the File tab of the Settings dialog). Use the menu command Edit | Settings to open this dialog.

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 + icon:

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 + icon:

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 * icon:

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 - icon:

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

Icon

This command adjusts the widths of all columns so that the text of the entire document comfortably fits 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.


Go to line/char...

Go to line/char...

Hotkey: CTRL+G

This command allows you go to a specific line number and/or character position in an XML document.

If you are working with an external XSLT processor (see the XSL page on the Settings 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

Icon:

This command allows you to open 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 cursor is between quotes, XML Spy will automatically use the entire string that is enclosed by the quotes.


Browser Menu

Browser Menu

This menu contains commands that are only available when the Browser View has been activated.


Back

Back

This command displays the previously viewed page. 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.

Use this command to retrace your steps.


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

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, you can now press F5 in the editing view to automatically refresh the corresponding browser view.


Scripting Menu

Scripting Menu

The scripting environment is currently in Beta test and will be provided at a later time.


Switch to scripting environment

Switch to scripting environment

The scripting environment is currently in Beta test and will be provided at a later time.


Show macros

Show macros

The scripting environment is currently in Beta test and will be provided at a later time.


Project

The scripting environment is currently in Beta test and will be provided at a later time.


Assign script to Project

Assign script to Project

The scripting environment is currently in Beta test and will be provided at a later time.


Unassign Scripts from Project

Unassign Scripts from Project

The scripting environment is currently in Beta test and will be provided at a later time.


Project Scripts active

Project Scripts active

The scripting environment is currently in Beta test and will be provided at a later time.


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.


Customize Toolbars...

Customize Toolbars...

XML Spy lets you define your own toolbars, create new toolbars, and assign all major commands to toolbars to suit your personal editing style.

Use the Toolbars tab to define or modify the list of toolbars you would like to have. The New... button creates a new empty toolbar that you can then populate using the Commands tab. The Reset button allows you to return each toolbar to its predefined state.

The Commands tab lets you assign commands to toolbars by dragging the available command buttons to the toolbars on your screen.

You can select commands from many different categories and will always see a short description of each command in the dialog.

To remove a button from a toolbar, drag the button back to the customize dialog.


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 3.5 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 and window from within XML Spy.

Press the "F1" button on your keyboard to access the context-sensitive help for the currently open dialog, 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.

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 3.5 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 lets you perform a full-text search on the entire text of the electronic documentation to access all the information available in the 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, 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!

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 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 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. 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 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.


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, which includes the XML Spy logo.

Please note that this dialog always shows the version number 3.5 - 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.


Toolbars

Toolbars

The XML Spy toolbars contains symbols for the most frequently used menu commands.

For each symbol you'll 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 also drag the toolbars from their standard position to any location on the screen, where they will be available as a floating palette window. Alternatively you can also dock them to the left or right edge of the main XML Spy window.

Please note that XML Spy 3.5 lets you fully customize all toolbars to assign any frequently used command to an icon.


Dialogs

Dialogs

Most dialogs 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 chapter describes standard dialogs, that are used by more than one command.


Assign File

Assign File

The Assign File dialog 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), or
· | use the Window button to select any currently open window or any file that is part of the current project.


Select File

Select File

The Select File dialog 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.


Programmer's Reference

Programmer's Reference

Objects
Application
DatabaseConnection
Document
Documents
ElementList
ElementListItem
ExportSettings
GridView
SpyProject
SpyProjectItem
SpyProjectItems
TextImportExportSettings
XMLData

Enumerations

Description
This chapter contains the reference of the XMLSpy 1.0 Type Library.

All given examples are written in VisualBasic. Most of the code snippets assume that there is a variable defined and set called objSpy of type Application.


Application

See also

Methods
GetDatabaseImportElementList
GetDatabaseSettings
GetDatabaseTables
GetExportSettings
GetTextImportElementList
GetTextImportExportSettings
ImportFromDatabase
ImportFromText
ImportFromWord
NewProject
OpenProject
AddMacroMenuItem
ClearMacroMenu
ShowForm
ShowApplication
URLDelete
URLMakeDirectory
Quit

Properties
ActiveDocument
Documents
CurrentProject
WarningNumber
WarningText

Description
Application is the root for all other objects. It is the only object you can create by CreateObject (VisualBasic) or other similar COM related functions.

Example

Dim objSpy As Application
Set objSpy = CreateObject("XMLSpy.Application")


DatabaseConnection

See also

Properties
ADOConnection
CreateMissingTables
CreateNew
File
NumberDateTimeFormat
SQLSelect
TextFieldLen

Description
DatabaseConnection specifies a database connection.


Document

See also

Methods
AssignDTD
AssignSchema
AssignXSL
Close
CreateChild
EndChanges
ExportToDatabase
ExportToText
GenerateDTDOrSchema
GetExportElementList
IsValid
IsWellFormed
Save
SaveInString
SetActiveDocument
SetEncoding
SetPathName
StartChanges
TransformXSL
UpdateViews
ConvertDTDOrSchema
SaveToURL

Properties
GridView
RootElement
Title

Description
Document Class


Documents

See also

Methods
NewFile
OpenFile
OpenURL

Properties
Count
Item

Description
Documents Class


ElementList

See also

Methods
RemoveElement

Properties
Count
Item

Description
ElementList Class


ElementListItem

See also

Properties
ElementKind
FieldCount
Name
RecordCount

Description
ElementListItem Class


ExportSettings

See also

Properties
CreateKeys
ElementList
EntitiesToText
ExportAllElements
FromAttributes
FromSingleSubElements
FromTextValues
IndependentPrimaryKey
SubLevelLimit

Description
ExportSettings Class


GridView

See also

Methods
Deselect
Select
SetFocus

Properties
CurrentFocus
IsVisible

Events
OnBeforeStartEditing
OnEditingFinished
OnFocusChanged

Description
GridView Class


SpyProject

See also

Methods
CloseProject
SaveProject
SaveProjectAs

Properties
RootItems

Description
SpyProject Class


SpyProjectItem

See also

Methods
Open

Properties
ChildItems
FileExtensions
ItemType
Name
Path
ValidateWith
XMLForXSLTransformation
XSLForXMLTransformation
XSLTransformationFileExtension
XSLTransformationFolder

Description
SpyProjectItem Class


SpyProjectItems

See also

Methods
AddFile
AddFolder
AddURL
RemoveItem

Properties
Count
Item

Description
SpyProjectItems Class


TextImportExportSettings

See also

Properties
DestinationFolder
EnclosingCharacter
Encoding
EncodingByteOrder
FieldDelimiter
FileExtension
HeaderRow
ImportFile

Description
TextImportExportSettings Class


XMLData

See also

Methods
AppendChild
EraseAllChildren
EraseCurrentChild
GetCurrentChild
GetFirstChild
GetNextChild
InsertChild

Properties
HasChildren
Kind
MayHaveChildren
Name
Parent
TextValue

Description
XMLData Class


Enumerations

Enumerations

This is a list of all enumerations used by the XMLSpy API. Some API methods take them as an input parameter. If your scripting environment does not support enumerations use the number-values instead.

SPYProjectItemTypes:

spyUnknownItem = 0
spyFileItem = 1
spyFolderItem = 2
spyURLItem = 3

SPYURLTypes:

spyURLTypeAuto = -1
spyURLTypeXML = 0
spyURLTypeDTD = 1

SPYXMLDataKind:

spyXMLDataXMLDocStruct = 0
spyXMLDataXMLEntityDocStruct = 1
spyXMLDataDTDDocStruct = 2
spyXMLDataXML = 3
spyXMLDataElement = 4
spyXMLDataAttr = 5
spyXMLDataText = 6
spyXMLDataCData = 7
spyXMLDataComment = 8
spyXMLDataPI = 9
spyXMLDataDefDoctype = 10
spyXMLDataDefExternalID = 11
spyXMLDataDefElement = 12
spyXMLDataDefAttlist = 13
spyXMLDataDefEntity = 14
spyXMLDataDefNotation = 15
spyXMLDataKindsCount = 16

SPYDTDSchemaFormat:

spyDTD = 0
spyDCD = 1
spyXMLData = 2
spyBizTalk = 3
spyW3C = 4

SPYTypeDetection:

spyBestPossible = 0
spyNumbersOnly = 1
spyNoDetection = 2

SPYFrequentElements:

spyGlobalElements = 0
spyGlobalComplexType = 1

SPYNumberDateTimeFormat:

spySystemLocale = 0
spySchemaCompatible = 1

SPYEncodingByteOrder:

spyNONE = 0
spyLITTLE_ENDIAN = 1
spyBIG_ENDIAN = 2

SPYTextDelimiters:

spyTabulator = 0
spySemicolon = 1
spyComma = 2
spySpace = 3

SPYTextEnclosing:

spyNoEnclosing = 0
spySingleQuote = 1
spyDoubleQuote = 2

SPYLoading:

spyUseCacheProxy = 0
spyReload = 1


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.

Please fill in the Questionnaire to provide us with valuable feedback on how we can further improve our product or what additional features you'd like to see in a future version.

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 Oct. 24 CR XML Schema draft 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 and CR Oct. 24 2000

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 either the Internet Explorer 5.5 beta version or the MSXML3 technology preview from Microsoft, which you can download from http://msdn.microsoft.com/downloads/webtechnology/xml/msxml.asp

Once you have installed MSXML3, please make sure that you execute the utility program 'XMLINST.EXE' that Microsoft has installed into your \WINDOWS\SYSTEM32\ directory. This step is necessary to ensure that MSXML3 is actually set to be the default XML module instead of the old MSXML.ALL version.

Alternatively you can also use any external XSLT processor that supports the final XSL Transformation recommendation. Please see the XSL Settings for details.

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, and Windows 2000. 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 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 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 settings 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 (" [image] Unicode [image] ") - 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 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 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 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-2000 Altova GmbH

All rights reserved.


Software Product License

Software Product License

SOFTWARE PRODUCT LICENSE

The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.

1. GRANT OF LICENSE. This license agreement grants you the following rights:

Installation and Use. You may install and use SOFTWARE PRODUCT on one computer solely for your personal or company use. If you have acquired multiple licenses or a special multi-user license, you may install the software on as many computers as specified in your license (per-seat licensing). You may also make copies of the SOFTWARE PRODUCT for backup and archival purposes.

Distribution. You may not reproduce or distribute license key-codes or licensed versions of the product except under the express and written permission of Altova GmbH.

2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.

Limitations on Reverse Engineering, Decompilation, and Disassembly. You may not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.

Software Transfer. You may permanently transfer all of your rights under this license agreement provided the recipient agrees to the terms of this license agreement

Termination. Without prejudice to any other rights, Altova GmbH may terminate this license agreement if you fail to comply with the terms and conditions of this license agreement. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.

Rental. You may not sell, rent, or lease the SOFTWARE PRODUCT.

3. 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.

WARRANTY AND LIMITATION OF LIABILITY

LIMITED WARRANTY. Altova GmbH warrants that (a) the SOFTWARE PRODUCT 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 GmbH shall be substantially as described in applicable written materials provided to you by Altova GmbH, and Altova GmbH 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 PRODUCT, if any, are limited to ninety (90) days.

CUSTOMER REMEDIES. Altova GmbH's and its suppliers' entire liability and your exclusive remedy shall be, at Altova GmbH's option, either (a) return of the price paid, if any, or (b) repair or replacement of the SOFTWARE PRODUCT that does not meet Altova GmbH's Limited Warranty and which is returned to Altova GmbH with a copy of your receipt. This Limited Warranty is void if failure of the SOFTWARE PRODUCT has resulted from accident, abuse, or misapplication. Any replacement SOFTWARE PRODUCT will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer.

NO OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, Altova GmbH 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, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE PRODUCT, 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.

LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL Altova GmbH OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 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 PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF Altova GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY CASE, Altova GmbH's ENTIRE LIABILITY UNDER ANY PROVISION OF THIS EULA SHALL BE LIMITED TO THE GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE PRODUCT OR U.S.$5.00; PROVIDED, HOWEVER, IF YOU HAVE ENTERED INTO A Altova GmbH SUPPORT SERVICES AGREEMENT, Altova GmbH'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.

TRADEMARKS. All names of products and companies used in this document, the software, or the enclosed documentation may be trademarks of their corresponding owners. Their use in this document is intended to be in compliance with the respective guidelines and licenses. Unicode and the Unicode Logo are trademarks of Unicode, Inc. Windows, Windows 95, Windows 98, Windows NT, and Windows 2000 are trademarks of Microsoft. Cyberbit is a trademark of Bitstream, Inc. 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.


Credits

[Previous] [Main]

Credits

We would like to thank the following people for their contribution to this product:

Vladislav Gavrielov | Chief Engineer
Alexander Falk | Parser, Schema Validation & Conversion
Joachim Legat | User-Interface & Web Design
Thomas Kefer | Microsoft Office Data Exchange
Michael Pallinger | Database Import/Export
Clemens Uhlenhut | COM Interface & Automation
Alexander Pilz | Documentation
Ben Abell | Technical Support & IT
Tina Eisinger | Marketing
Veronika Aggarwal | Accounting
Irma Dolezal | Sales
Lea Gavrielova | Excellent Office Lunch

XML Spy 3.5 wouldn't have come this far without your time and dedication. Thank you!


Application.AddMacroMenuItem

See also

Declaration: AddMacroMenuItem(strMacro as String, strDisplayText as String)

Return Value

Description
Adds an menu item to the scripting menu. This new menu item invokes the macro defined by strMacro.


Application.ClearMacroMenu

See also

Declaration: ClearMacroMenu

Return Value

Description
Removes all menu items from the scripting menu.


Application.CurrentProject

See also

Declaration: CurrentProject as SpyProject

Description
Reference to the active document.


Application.Quit

See also

Declaration: Quit

Return Value
none

Description
This method terminates XMLSpy. All modified documents will be closed without saving the changes. This is also true for an open project.


Application.ShowApplication

See also

Declaration: ShowApplication(bShow as Boolean)

Return Value
none

Description
The method shows (bShow = True) or hides (bShow = False) XMLSpy.


Application.ShowForm

See also

Declaration: ShowForm(strFormName as String) As Long

Return Value
Returns zero if the user pressed a cancel-button or the form calls TheView.Cancel().

Description
Displays the form strFormName.

Forms, event handlers and macros can be created with the XMLSpyFormEditor. Select "Switch to scripting environment" from the "Scripting" menu to invoke the scripting environment.


Application.URLDelete

See also

Declaration: URLDelete(strURL as String,strUser as String,strPassword as String)

Return Value
none

Description
The method deletes the file at the URL strURL.


Application.URLMakeDirectory

See also

Declaration: URLMakeDirectory(strURL as String,strUser as String,strPassword as String)

Return Value
none

Description
The method creates a new directory at the URL strURL.


.topic 10001
XML Spy is the first true Integrated Development Environment (IDE) for the eXtensible Markup Language (XML) and contains many useful functions that can simplify typical XML editing tasks for you. This help system is provided to help you get started with using our software and provides detailed information on all aspects of the product.

It includes a Tutorial section 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.

You may also want to periodically check our XML Spy web-server for news, updates, and new examples:

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.

.topic 10002
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 3.5 online help and printable documentation contain a Tutorial section that give you a general overview of XML and XML Spy.

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.

.topic 20000
This Tutorial will introduce you to XML, and how to use XML Spy for all your XML-related editing needs.

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.

.topic 20001
This screen shot shows the XML Spy application window.

The Enhanced Grid View   is enabled , and the Altova.xml file is the active document.
The "Display as Table"   function has been activated for the Division element. "Display as Table" displays recurring elements in tabular form. This embedded view, is available in all XML spy views wherever recurring elements occur. Click on the same icon to return to the grid view.

.topic 20002
This screen shot shows the main window containing a XML document, and the same document in Browser view.
Click on the Browser view icon,   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 documents for the current project.

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

To see graphical representation of each particle:
1. Click on the   icon next to the particle you want to display.
The content model for that particle appears in a tree view.

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

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

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

.topic 20005
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.

.topic 30000
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.

.topic 31000
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, text view, embedded database/table view, or browser view.

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

.topic 31100
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 five advanced views on your documents:
An Enhanced Grid View for structured editing
An embedded  Database/Table view, which is available in all views, 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, 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 Settings dialog. Select the menu option Edit | Settings to open this dialog.

.topic 31102
Click the Enhanced Grid View icon   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  icon, eg.  header
An attribute is denoted with the  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  .

The heights of the cells are determined by their contents alone and cannot be adjusted by the user.

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:

.topic 31103
Having clicked the Enhanced Grid View icon,   click on the "Display as Table" icon  .

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 is 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   to activate the Table View, or select the menu option 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 Table | Ascending Sort
Append (or insert) rows using the menu command Table | Insert Row.

Exchanging data from the Database/Table view
To exchange with other applications, select elements in this table and  copy/paste them directly into Access or Excel. 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 lets directly you import or export XML data from any text file, Word document or database.

.topic 31101
Click the Text view icon,   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.

.topic 31104
Click the Browser View icon,   to open this view.

The Browser view requires Microsoft Internet Explorer 5, and we highly recommend you to also download the MSXML3 technology preview if you intend to work with XSLT in XML Spy, as MSXML3 already supports most of the W3C XSLT Recommendation. Please see our FAQ on the Internet 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.

.topic 31200
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).

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.

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

.topic 31400
XML Spy 3.5 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.

.topic 31401
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 Particle Navigator, and displays information on Global Particles: elements, groups, complex types, simple types, attributes and attribute groups.

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

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

.topic 31402
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.

.topic 31403
If you are editing DTDs or documents based upon a DTD content-model (such as XHTML), 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

.topic 31300
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.

.topic 32000
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.

.topic 32100
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).

.topic 32101
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.

Opening files not available in the Create new document dialog
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 File Type Settings dialog.

Assigning a DTD / Schema to a new XML document
XML Spy contains built-in templates for most XML-based document types and will automatically provide 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 \Templates directory, automatically created one level below the XML Spy installation directory.

If you select the ".xml XML Document" entry, (typically a new XML instance document) in the above dialog, 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, 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.

.topic 32102
The "Open..." command, opens any XML-related document or text file from your PC. The familiar Windows "Open" dialog 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 (the list of available file types can be configured through the File Type page on the Settings 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   or   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 Settings dialog.

.topic 32103
The "Open URL..." command, allows you to open non-local files from a URL (uniform resource locator) address.

To open an URL address:
1. Enter the URL in the URL field
2. Click the Browse button to see and navigate the directory structure of the server.
3. Double click the file you want to load, or select the file and click the OK button.

The file you open appears in the main window. If the XML file refers to a schema file that is also available in the same server directory, then the schema file will also be loaded into XML Spy.

The Up button moves you up one directory in the directory structure, while the New Folder button creates a new directory on the server if your access rights permit it.

The Browse function is only available on servers which support the following protocols:
FTP
HTTP
HTTPS
or servers supporting WebDAV

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

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 and FTP servers, the other repository interfaces will be available in future versions.

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

XML Spy automatically monitors all open files 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 page of the Settings 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.

.topic 32105
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 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.

.topic 32106
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.

.topic 32107
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.

.topic 32108
The "Save" command, saves the contents of the active document to the file it has been opened from. If the document was opened from a URL, the Save as... dialog is opened, allowing you to save the document under a different name.

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 page on the Settings 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.

.topic 32109
The "Save As..." command shows the familiar Windows "Save as..." dialog 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.

.topic 32110
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 is presented for that document.

.topic 32111
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:

.topic 32112
The "Print..." command, opens the "Print" dialog where you can control what appears on the printout. This dialog will 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 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 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 without starting the print process.

.topic 32113
The "Print Setup..." command, displays the printer-specific "Print Setup" dialog, 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:).

.topic 32114
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.

.topic 32115
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.

.topic 32200
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.

You can also edit XML Spy settings by clicking on the "Settings..." option in this menu.

.topic 32201
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).

.topic 32202
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.

.topic 32203
Hotkey: CTRL + X

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

.topic 32204
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 Edit tab on the Settings dialog to choose which operation should be performed when you use the copy command on the Edit menu or the Ctrl-C shortcut.

.topic 32205
Hotkey: CTRL + V

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

.topic 32206
Keyboard: Del.

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

.topic 32207
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 3.5 FAQ</link_text>
            </link>
            <link mode="internal">
                <link_section>support</link_section>
                <link_subsection>faq25</link_subsection>
                <link_text>XML Spy 2.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 Settings dialog).

.topic 32208
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

.topic 32209
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.

.topic 32210
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.

.topic 32211
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.

.topic 32212
Hotkey: F3

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

.topic 32213
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.

.topic 32220
The "Settings" command, allows you to define the global program settings in a tabbed dialog. 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.

.topic 32221
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 3.5 http://www.xmlspy.com --> near the top of the file. 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).

.topic 32222
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 you want XML Spy 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. You should not modify these settings unless you are adding a new file type and are sure of what you are doing.

Default view
You can define the default XML Spy view to be used, for each file type.

Grid view
You can define if the Enhanced Grid View should automatically build tables.

Text view
You can turn off 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
You can add new file types (or remove them) from the File types list, with the respective buttons.

.topic 32223
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.

.topic 32224
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.

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.

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.

.topic 32225
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, 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").

.topic 32226
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.

.topic 32227
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.

.topic 32228
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 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.

.topic 32229
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 parser or any external XSLT processor for this purpose.

Use Microsoft XML Parser (MSXML) 3.0
If you are using Internet Explorer 5 (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.

Use 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 ons XSLT Processors for further details.

.topic 32300
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.

.topic 32301
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.

.topic 32302
Opens an existing project in XML Spy.

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

.topic 32303
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!

.topic 32304
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.

.topic 32305
Saves the current project.

.topic 32306
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.

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.

.topic 32307
Adds a 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.

.topic 32308
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.

.topic 32309
Adds the 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.

.topic 32310
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.

.topic 32311
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.

.topic 32312
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. (Edit | Settings | File tab, Project | Open last project on program start)

.topic 32400
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.

.topic 32410
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.

.topic 32411
Hotkey: CTRL+SHIFT+I

Insert 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.

.topic 32412
Hotkey: CTRL+SHIFT+E

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.

.topic 32413
Hotkey: CTRL+SHIFT+T

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.

.topic 32414
Hotkey: CTRL+SHIFT+D

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.

.topic 32415
Hotkey: CTRL+SHIFT+M

Inserts 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.

.topic 32416
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.

.topic 32417
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.

.topic 32418
Insert 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.

.topic 32419
Inserts an external ID (SYSTEM or PUBLIC) into a DOCTYPE declaration before the selected item.

.topic 32420
Inserts an element declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.

.topic 32421
Inserts an attribute list declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.

.topic 32422
Inserts an entity declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.

.topic 32423
Inserts a notation declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) before the selected item.

.topic 32430
Appends a new 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.

.topic 32431
CTRL+I

Appends a new attribute after the last element within the same parent.

.topic 32432
CTRL+E

Appends a new element after the last element within the same parent.

.topic 32433
CTRL+T

Appends a new text content block after the last element within the same parent.

.topic 32434
CTRL+D

Appends a new CDATA block after the last element within the same parent.

.topic 32435
CTRL+M

Appends a new Comment after the last element within the same parent.

.topic 32436
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 that it must appear at the very top of the file.

.topic 32437
Appends a new Processing Instruction (PI) after the last element within the same parent.

.topic 32438
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, that 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.

.topic 32439
Appends an external ID (SYSTEM or PUBLIC) in a DOCTYPE declaration after the last element of the same parent.

.topic 32440
Appends an element declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32441
Appends an attribute list declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32442
Appends an entity declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32443
Appends a notation declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32450
Adds a child item to the currently selected element.
This is useful for adding attributes to an item or creating child elements.

.topic 32451
Hotkey: CTRL+ALT+I

Inserts a new attribute as a child of the selected item.

.topic 32452
Hotkey: CTRL+ALT+E

Inserts a new element as a child of the selected item.

.topic 32453
Hotkey: CTRL+ALT+T

Inserts new text content as a child of the selected item.

.topic 32454
Hotkey: CTRL+ALT+D

Inserts a new CDATA block as a child of the selected item.

.topic 32455
Hotkey: CTRL+ALT+M

Inserts new Comment as a child of the selected item.

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

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

.topic 32457
Inserts a new Processing Instruction (PI) as a child of the selected item.

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

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.

.topic 32459
Inserts an external ID (SYSTEM or PUBLIC) into a DOCTYPE declaration as a child of the selected item.

.topic 32460
Inserts an element declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.

.topic 32461
Inserts an attribute list declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.

.topic 32462
Inserts an entity declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.

.topic 32463
Inserts a notation declaration into a DOCTYPE declaration or into an external Document Type Definition (DTD) as a child of the selected item.

.topic 32470
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 will appear.

.topic 32471
Converts the selected item into a new attribute.

.topic 32472
Converts the selected item into an element.

.topic 32473
Converts the selected item into text content.

.topic 32474
Converts the selected item into a CDATA block.

.topic 32475
Converts the selected item into a Comment.

.topic 32476
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.

.topic 32477
Converts the selected item to a new Processing Instruction (PI)

.topic 32478
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.

.topic 32479
Converts the selected item to an external ID (SYSTEM or PUBLIC) in a DOCTYPE declaration.

.topic 32480
Converts the selected item to an element declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32481
Converts the selected item to an attribute list declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32482
Converts the selected item to an entity declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32483
Converts the selected item to a notation declaration in a DOCTYPE declaration or in an external Document Type Definition (DTD).

.topic 32490
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.

.topic 32491
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.

.topic 32492
When you are 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.

.topic 32493
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 also automatically checks for well-formedness whenever a document is opened, saved, or the view mode is switched from Text to Enhanced Grid or Browser.

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 mal-formed 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.

.topic 32494
XML Spy can validate 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:

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 "Check well-formedness" icon.

.topic 32497
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).

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

You can validate these schemas against their specification, to make sure that they can be used to create, edit, and validate XML instance documents that are based on these schemata.

.topic 32495
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.

.topic 32496
To make working with XML namespaces a bit easier, XML Spy provides a "Set Namespace" command that lets you set the namespace 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.

.topic 32500
XML Spy 3.5 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.

.topic 32501
This command allows you to assign a Document Type Definition (DTD) to an XML document to be used for 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">

.topic 32502
This command allows you to assign a Schema to an XML document that is to be used for 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.

.topic 32503
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.

.topic 32504
This command is available in the Text view.

If your XML instance document is based on a certain Document Type Definition (DTD) use this command to open the corresponding DTD file.

.topic 32505
This command is available in the Text view.

If your XML instance document is based on a certain Schema use this command to open the corresponding Schema definition file.

.topic 32506
"Go to Definition" icon  .

This command is available in the Enhanced Grid and Text view.

While editing an XML document it can be useful to look up 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 Text view:
1. Click on the item definition in one of the Entry helper windows
2. Select the menu item 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.

.topic 32507
If you are defining a new schema or DTD it is often helpful to create a few example XML documents as a starting point.

XML Spy then allows you to generate a new schema from an XML document (or from a set of documents in the project window).

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.

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.

.topic 32508
In the of ever-changing world of schema versions it is important to have a tool at hand that can easily convert your content model between the various schema dialects.

Open your existing Schema or DTD, and use this command to convert your DTDs into XML Schemas compliant with the Oct. 24 2000 CR  - or the other way round.

.topic 32509
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.

If memory is tight on your system, or if you have been using many different documents based on different schemas recently, use this command to flush all cached Schema and DTD documents from memory.

.topic 32600
The eXtensible Stylesheet Language (XSL) and in particular the XSL Transformation (XSLT) lets 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.

.topic 32601
Hotkey: F10

To perform 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 Settings dialog (Select Edit | Settings to open this dialog.)

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 ons XSLT Processors for further details.

.topic 32602
This command allows you to assign an XSL stylesheet to an XML document to be used for XSL Transformation or rendering by any 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"?>

.topic 32603
If your XML document contains a reference to an XSL stylesheet, this command lets you  open the corresponding XSL or XSLT document.

.topic 32700
XML Spy 3.5 provides powerful data exchange functions that allow you to convert back and forth between text, word processor, database, and XML files.

.topic 32701
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, 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.

.topic 32702
This command allows you to import database data from many sources. You can select an existing Microsoft Access (i.e. Jet Engine) file or specify any ActiveX Data Object (ADO) data source (such as SQL Server, Oracle, or any other ODBC-conformant database).

Source database
Once you have selected your data source, you can either choose a 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.

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.

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.

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.

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 - is imported as an attribute
    Contacts.Company - is not imported
    FirstName, LastName - are imported as elements.

.topic 32703
This command allows you to directly import any Word document and convert it to 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 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.

.topic 32704
This command allows you to export 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.

.topic 32705
This command 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 and can also set the same options that are also available in the Import text file dialog.

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.

.topic 32706
This command 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 ADO-compliant database system (such as SQL Server or Oracle).

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

.topic 32800
The Table menu 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!

.topic 32801
Hotkey: F9 	icon:

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

Select the first element of any sequence of repeated elements, and use this command to display the elements in a tabular fashion. This will effectively break out all attributes and sub-elements, and show them as columns similar to any spreadsheet- or database-like application.

.topic 32802
Hotkey: SHIFT+F9	icon:

If you are displaying repeated elements in the Database/Table View, you can add new rows by:

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

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

.topic 32803
Hotkey: CTRL+F9	icon:

If you are displaying repeated elements in the Database/Table View, you can append a new row to the table by:

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

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

.topic 32804
Icon:

If you are displaying repeated elements in the Database/Table View, you can sort the column elements in ascending order by:

1. Clicking a column header in the table, and
2. Selecting the menu option 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 to prompt for help:

.topic 32805
Icon:

If you are displaying repeated elements in the Database/Table View, you can sort the column elements in descending order by:

1. Clicking a column header in the table, and
2. Selecting the menu option 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 this dialog to prompt for help:

.topic 32900
The View menu controls the display of the active Main window and allows you to change the way XML Spy displays your XML documents.

.topic 32901
Icon:

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.

.topic 32902
Icon:

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 Settings dialog). Use the menu command Edit | Settings 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.

.topic 32903
Icon:

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 Settings dialog). Use the menu command Edit | Settings 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.

.topic 32904
This command  allows you to synchronize the Enhanced Grid view and Tree view in the main window, to locate an item in a large document.

To see the Tree view, you must activate the "Show Tree" checkbox in the File tab of the Settings dialog). Use the menu command Edit | Settings to open this dialog.

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.

.topic 32905
Hotkey: Num +		icon:

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.

.topic 32906
Hotkey: Num +		icon:

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.

.topic 32907
Hotkey: Num *		icon:

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.

.topic 32908
Hotkey: CTRL -		icon:

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.

.topic 32909
Icon

This command  adjusts the widths of all columns so that the text of the entire document comfortably fits 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.

.topic 32910
Hotkey: CTRL+G

This command  allows you go to a specific line number and/or character position in an XML document.

If you are working with an external XSLT processor (see the XSL page on the Settings 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.

.topic 32911
Icon:

This command  allows you to open 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 cursor is between quotes, XML Spy will automatically use the entire string that is enclosed by the quotes.

.topic 33000
This menu contains commands that are only available when the Browser View has been activated.

.topic 33001
This command  displays the previously viewed page. This can be useful if you click a link in your XML document and want to return to it.

.topic 33002
This command  is only available once you have used the Back command.

Use this command to retrace your steps.

.topic 33003
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.

.topic 33004
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.

.topic 33005
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.

.topic 33006
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, you can now press F5 in the editing view to automatically refresh the corresponding browser view.

.topic 33100
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.

.topic 33101
This command rearranges all open document windows so that they are all cascaded (i.e. staggered) on top of each other.

.topic 33102
This command rearranges all open document windows as horizontal tiles, making them all visible at the same time.

.topic 33103
This command rearranges all open document windows as vertical tiles, making them all visible at the same time.

.topic 33104
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.

.topic 33105
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.

.topic 33106
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.

.topic 33107
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.

.topic 33108
XML Spy lets you define your own toolbars, create new toolbars, and assign all major commands to toolbars to suit your personal editing style.

Use the Toolbars tab to define or modify the list of toolbars you would like to have. The New... button creates a new empty toolbar that you can then populate using the Commands tab. The Reset button allows you to return each toolbar to its predefined state.

The Commands tab lets you assign commands to toolbars by dragging the available command buttons to the toolbars on your screen.

You can select commands from many different categories and will always see a short description of each command in the dialog.

To remove a button from a toolbar, drag the button back to the customize dialog.

.topic 33109
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.

.topic 33200
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.

.topic 33201
XML Spy 3.5 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 and window from within XML Spy.

Press the "F1" button on your keyboard to access the context-sensitive help for the currently open dialog, 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.

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.

.topic 33202
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.

.topic 33203
This command accesses the keyword index of XML Spy 3.5 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:

.topic 33204
The Search command lets you perform a full-text search on the entire text of the electronic documentation to access all the information available in the 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.

.topic 33205
When you start XML Spy for the first time, you are automatically presented with the Registration dialog, 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!

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 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 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. 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 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).

.topic 33207
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.

.topic 33208
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.

.topic 33213
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.

.topic 33209
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.

.topic 33206
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.

.topic 33211
If you are located in Japan, you may prefer to contact our Japanese distributor on the Internet by using this menu command.

.topic 33212
This command shows the XML Spy splash screen and copyright information dialog, which includes the XML Spy logo.

Please note that this dialog always shows the version number 3.5 - 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.

.topic 34000
The XML Spy toolbars contains symbols for the most frequently used menu commands.

For each symbol you'll 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 also drag the toolbars from their standard position to any location on the screen, where they will be available as a floating palette window. Alternatively you can also dock them to the left or right edge of the main XML Spy window.

Please note that XML Spy 3.5 lets you fully customize all toolbars to assign any frequently used command to an icon.

.topic 35000
Most dialogs 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 chapter describes standard dialogs, that are used by more than one command.

.topic 35100
The Assign File dialog 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), or
use the Window button to select any currently open window or any file that is part of the current project.

.topic 35200
The Select File dialog 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.

.topic 40000
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.

Please fill in the Questionnaire to provide us with valuable feedback on how we can further improve our product or what additional features you'd like to see in a future version.

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.

.topic 50000
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.

.topic 54000
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!

.topic 54002
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 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 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 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!


Document.SaveToURL

See also

Declaration: SaveToURL(strURL as String,strUser as String,strPassword as String)

Return Value

Description
SaveToURL() writes the document to the URL strURL. This method does not set the permanent file path of the document.


Documents.OpenURL

See also

Declaration: OpenURL(strURL as String,nURLType as SPYURLTypes,nLoading as SPYLoading,strUser as String,strPassword as String) as Document

Return Value
The method returns the opened document.

Description
OpenURL opens the URL strURL.

Example


GridView.OnBeforeStartEditing

See also
Declaration: OnBeforeStartEditing(pXMLData as XMLData)
Description
method OnBeforeStartEditing


GridView.OnEditingFinished

See also
Declaration: OnEditingFinished(pXMLData as XMLData)
Description
method OnEditingFinished


GridView.OnFocusChanged

See also
Declaration: OnFocusChanged(pXMLData as XMLData,bFocusSet as Boolean) as VT_0019
Description
method OnFocusChanged


Application.GetDatabaseImportElementList

See also

Declaration: GetDatabaseImportElementList(pImportSettings as DatabaseConnection) as ElementList

Return Value
The function returns a collection of ElementListItems.

Description
GetDatabaseImportElementList retrieves information about the database as specified in pImportSettings to create the list of elements ppElementList. This list is used to exclude elements from import and to set the kind of the imported elements. See also ImportFromDatabase. The items of the collection are described in ElementListItem.

Example
See example of ImportFromDatabase.


Application.GetDatabaseSettings

See also

Declaration: GetDatabaseSettings as DatabaseConnection

Return Value
Returns a DatabaseConnection object.

Description
GetDatabaseSettings creates a new object of database settings. The object is used to define a connection to a database. See also ImportFromDatabase.

Example
See example of ImportFromDatabase.


Application.GetDatabaseTables

See also

Declaration: GetDatabaseTables(pImportSettings as DatabaseConnection) as ElementList

Return Value
The function returns a collection of ElementListItems.

Description
GetDatabaseTables reads the table names from the database.

Example

Dim objImpSettings As DatabaseConnection
Set objImpSettings = objSpy.GetDatabaseSettings
objImpSettings.ADOConnection = TxtADO.Text

'store table names in list box
ListTables.Clear

Dim objList As ElementList
Dim objItem As ElementListItem
On Error GoTo ErrorHandler
Set objList = objSpy.GetDatabaseTables(objImpSettings)

For Each objItem In objList
ListTables.AddItem objItem.Name
Next


Application.GetExportSettings

See also

Declaration: GetExportSettings as ExportSettings

Return Value
The method returns a ExportSettings object.

Description
GetExportSettings creates a new object of common export settings. This object is used to pass the parameters to the export functions and defines the behaviour of the export calls. See also the export functions from Document.


Application.GetTextImportElementList

See also

Declaration: GetTextImportElementList(pImportSettings as TextImportExportSettings) as
ElementList

Return Value
The method returns a collection of ElementListItems.

Description
GetTextImportElementList gets information about the text-file as specified in pImportSettings. See also ImportFromText.

Example

Dim objImpSettings As TextImportExportSettings
Set objImpSettings = objSpy.GetTextImportExportSettings

objImpSettings.ImportFile = "C:\ImportMe.txt"
objImpSettings.HeaderRow = False

Dim objList As ElementList
Set objList = objSpy.GetTextImportElementList(objImpSettings)

'exclude first column
objList.RemoveItem 1

Dim objImpDoc As Document
On Error Resume Next
Set objImpDoc = objSpy.ImportFromText(objImpSettings, objList)
CheckForError


Application.GetTextImportExportSettings

See also

Declaration: GetTextImportExportSettings as TextImportExportSettings

Return Value

Description
GetTextImportExportSettings creates a new object of common import and export settings for text-files. See also the example for Application.GetTextImportElementList.


Application.ImportFromDatabase

See also

Declaration: ImportFromDatabase(pImportSettings as DatabaseConnection,pElementList as ElementList) as Document

Return Value
Creates a new document.

Description
ImportFromDatabase imports the database as specified in pImportSettings. pElementList declares the tables to import. See Application.GetDatabaseImportElementList for more information about the list of elements.

Example

Dim objImpSettings As DatabaseConnection
Set objImpSettings = objSpy.GetDatabaseSettings

objImpSettings.ADOConnection = strADOConnection
objImpSettings.SQLSelect = strSelect

Dim objDoc As Document
On Error Resume Next
Set objDoc = objSpy.ImportFromDatabase(objImpSettings, objSpy.GetDatabaseImportElementList(objImpSettings))
CheckForError


Application.ImportFromText

See also

Declaration: ImportFromText(pImportSettings as TextImportExportSettings,pElementList as ElementList) as Document

Return Value
Creates a new document.

Description
ImportFromText imports the text-file as specified in pImportSettings. pElementList declares the tables to import.

Example

Dim objImpSettings As TextImportExportSettings
Set objImpSettings = objSpy.GetTextImportExportSettings
objImpSettings.ImportFile = strFileName
objImpSettings.HeaderRow = False
Dim objImpDoc As Document
On Error Resume Next
Set objImpDoc = objSpy.ImportFromText(objImpSettings, objSpy.GetTextImportElementList(objImpSettings))
CheckForError


Application.ImportFromWord

See also

Declaration: ImportFromWord(strFile as String) as Document

Return Value
The method creates a new document.

Description
ImportFromWord imports the Word-Document strFile.


Application.NewProject

See also

Declaration: NewProject(strPath as String,bDiscardCurrent as Boolean)

Return Value

Description
NewProject creates a new project.


Application.OpenProject

See also

Declaration: OpenProject(strPath as String,bDiscardCurrent as Boolean,bDialog as Boolean)

Return Value

Description
OpenProject opens an existing project.


Document.AssignDTD

See also

Declaration: AssignDTD(strDTDFile as String,bDialog as Boolean)

Description
The method places a reference to the DTD file "strDTDFile" into the document. Note that no error occures if the file does not exist or is not accessible.

If bDialog is true XMLSpy presents a dialog to set the file.


Document.AssignSchema

See also

Declaration: AssignSchema(strSchemaFile as String,bDialog as Boolean)

Description
The method places a reference to the schema file "strSchemaFile" into the document. Note that no error occures if the file does not exist or is not accessible.

If bDialog is true XMLSpy presents a dialog to set the file.


Document.AssignXSL

See also

Declaration: AssignXSL(strXSLFile as String,bDialog as Boolean)

Description
The method places a reference to the XSL file "strXSLFile" into the document. Note that no error occures if the file does not exist or is not accessible.

If bDialog is true XMLSpy presents a dialog to set the file.


Document.Close

See also

Declaration: Close(bDiscardChanges as Boolean)

Description
method Close


Document.CreateChild

See also

Declaration: CreateChild(nKind as SPYXMLDataKind) as XMLData

Return Value

Description
method CreateChild


Document.EndChanges

See also

Declaration: EndChanges

Description
method EndChanges


Document.ExportToDatabase

See also

Declaration: ExportToDatabase(pFromChild as XMLData, pExportSettings as ExportSettings, pDatabase as DatabaseConnection)

Description
ExportToDatabase exports the xml-document starting with the element pFromChild. pExportSettings defines the behaviour of the export (see Application.GetExportSettings), pDatabase defines the destination of the export (see Application.GetDatabaseSettings).

Example

Dim objDoc As Document
Set objDoc = objSpy.ActiveDocument

'set the behaviour of the export with ExportSettings
Dim objExpSettings As ExportSettings
Set objExpSettings = objSpy.GetExportSettings

'set the destination with DatabaseConnection
Dim objDB As DatabaseConnection
Set objDB = objSpy.GetDatabaseSettings

objDB.CreateMissingTables = dlgDest.CheckTables.Value
objDB.CreateNew = dlgDest.OptionNewDB.Value
objDB.File = "C:\Export.mdb"

objDoc.ExportToDatabase objDoc.RootElement, objExpSettings, objDB
If Err.Number <> 0 Then
a = MsgBox("Error: " & (Err.Number - vbObjectError) & Chr(13) & "Description: " & Err.Description)
End If


Document.ExportToText

See also

Declaration: ExportToText(pFromChild as XMLData,pExportSettings as ExportSettings,pTextSettings as TextImportExportSettings)

Description
method ExportToText

Example

Dim objDoc As Document
Set objDoc = objSpy.ActiveDocument

Dim objExpSettings As ExportSettings
Set objExpSettings = objSpy.GetExportSettings
objExpSettings.ElementList = objDoc.GetExportElementList(objDoc.RootElement, objExpSettings)

Dim objTextExp As TextImportExportSettings
Set objTextExp = objSpy.GetTextExportSettings
objTextExp.CreateHeaderRow = True
objTextExp.DestinationFolder = "C:\Exports"

On Error Resume Next
objDoc.ExportToText objDoc.RootElement, objExpSettings, objTextExp

If Err.Number <> 0 Then
a = MsgBox("Error: " & (Err.Number - vbObjectError) & Chr(13) & "Description: " & Err.Description)
End If


Document.GenerateDTDOrSchema

See also

Declaration: GenerateDTDOrSchema(nFormat as SPYDTDSchemaFormat,nValuesList as integer,nDetection as SPYTypeDetection, nFrequentElements as SPYFrequentElements)

Description
method GenerateDTDOrSchema


Document.GetExportElementList

See also

Declaration: GetExportElementList(pFromChild as XMLData,pExportSettings as ExportSettings) as ElementList

Return Value

Description
method GetExportElementList


Document.IsValid

See also
Declaration: IsValid(strError as Variant,nErrorPos as Variant,pBadData as Variant) as Boolean
Return Value
Description
method IsValid


Document.IsWellFormed

See also
Declaration: IsWellFormed(pData as XMLData,bWithChildren as Boolean,strError as Variant,nErrorPos as Variant,pBadXMLData as Variant) as Boolean
Return Value
Description
method IsWellFormed


Document.Save

See also

Declaration: Save

Description
method Save


Document.SaveInString

See also

Declaration: SaveInString(pData as XMLData,bMarked as Boolean) as String

Return Value

Description
method SaveInString


Document.SetActiveDocument

See also
Declaration: SetActiveDocument
Description
method SetActiveDocument


Document.SetEncoding

See also
Declaration: SetEncoding(strEncoding as String)
Description
method SetEncoding


Document.SetPathName

See also
Declaration: SetPathName(strPath as String)
Description
method SetPathName


Document.StartChanges

See also

Declaration: StartChanges

Description
method StartChanges


Document.TransformXSL

See also

Declaration: TransformXSL

Description
method TransformXSL


Document.UpdateViews

See also

Declaration: UpdateViews

Description
method UpdateViews


Documents.NewFile

See also

Declaration: NewFile(strFile as String,strType as String) as Document

Return Value
Returns the new file.

Description
NewFile creates a new file of type strType (i.e. "xml").

The just now created file is also the ActiveDocument.


Documents.OpenFile

See also

Declaration: OpenFile(strPath as String,bDialog as Boolean) as Document

Return Value

Description
OpenFile opens the file strPath. If bDialog is TRUE, a file-dialog will be displayed.

Example

Dim objDoc As Document
Set objDoc = objSpy.Documents.OpenFile(strFile, False)


ElementList.RemoveElement

See also

Declaration: RemoveElement(Index as long)

Description
RemoveElement removes the element Index from the collection.


GridView.Deselect

See also
Declaration: Deselect(pData as XMLData)
Description
method Deselect


GridView.Select

See also
Declaration: Select(pData as XMLData)
Description
method Select


GridView.SetFocus

See also
Declaration: SetFocus(pFocusData as XMLData)
Description
method SetFocus


SpyProject.CloseProject

See also
Declaration: CloseProject(bDiscardChanges as Boolean,bCloseFiles as Boolean,bDialog as Boolean)
Description
CloseProject closes the current project. If bCloseFiles is TRUE, all open files from the project will be closed too.


SpyProject.SaveProject

See also
Declaration: SaveProject
Description
SaveProject saves the current project


SpyProject.SaveProjectAs

See also
Declaration: SaveProjectAs(strPath as String,bDialog as Boolean)
Description
SaveProjectAs stores the project data into the file strPath. If bDialog is TRUE, a file-dialog will be displayed.


SpyProjectItem.Open

See also
Declaration: Open as Document
Return Value
Description
Opens the project item.


SpyProjectItems.AddFile

See also
Declaration: AddFile(strPath as String)
Description
method AddFile


SpyProjectItems.AddFolder

See also
Declaration: AddFolder(strName as String)
Description
method AddFolder


SpyProjectItems.AddURL

See also

Declaration: AddURL(strURL as String,lURLType as long,strUser as String,strPassword as String,bSave as Boolean)

Description
method AddURL


SpyProjectItems.RemoveItem

See also
Declaration: RemoveItem(pItem as SpyProjectItem)
Description
method RemoveItem


XMLData.AppendChild

See also

Declaration: AppendChild(pNewData as XMLData)

Description
method AppendChild


XMLData.EraseAllChildren

See also

Declaration: EraseAllChildren

Description
method EraseAllChildren


XMLData.EraseCurrentChild

See also

Declaration: EraseCurrentChild

Description
method EraseCurrentChild


XMLData.GetCurrentChild

See also

Declaration: GetCurrentChild as XMLData

Return Value
Returns a xml element as XMLData object.

Description
GetCurrentChild gets the current child. Before you call GetCurrentChild you must initialize an intern iterator with XMLData.GetFirstChild.


XMLData.GetFirstChild

See also

Declaration: GetFirstChild(nKind as SPYXMLDataKind) as XMLData

Return Value
Returns a xml element as XMLData object.

Description
GetFirstChild initializes a new iterator and returns the first child. Set nKind = -1 to get an iterator for all kinds of children.

Example
See the example at XMLData.GetNextChild.


XMLData.GetNextChild

See also

Declaration: GetNextChild as XMLData

Return Value
Returns a xml element as XMLData object.

Description
GetNextChild steps to the next child of this element. Before you call GetNextChild you must initialize an intern iterator with XMLData.GetFirstChild.

Check for the last child of the element as shown in the sample below.

Example

On Error Resume Next
Set objParent = objSpy.ActiveDocument.RootElement

'get elements of all kinds
Set objCurrentChild = objParent.GetFirstChild(-1)

Do
'do something useful with the child

'step to next child
Set objCurrentChild = objParent.GetNextChild
Loop Until (Err.Number - vbObjectError = 1503)


XMLData.InsertChild

See also

Declaration: InsertChild(pNewData as XMLData)

Description
InsertChild inserts the new child before the current child (see also XMLData.GetFirstChild, XMLData.GetNextChild).


Application.ActiveDocument

See also

Declaration: ActiveDocument as Document

Description
Reference to the active document.


Application.Documents

See also
Declaration: Documents as Documents
Description
Collection of all open documents.


Application.WarningNumber

See also
Declaration: WarningNumber as integer
Description
property WarningNumber


Application.WarningText

See also
Declaration: WarningText as String
Description
property WarningText


DatabaseConnection.ADOConnection

See also

Declaration: ADOConnection as String

Description
The property ADOConnection contains a connection string.

Example

Dim objSpyConn As DatabaseConnection
Set objSpyConn = objSpy.GetDatabaseSettings

Dim objADO As DataLinks
Set objADO = CreateObject("DataLinks")

If Not (objADO Is Nothing) Then
Dim objConn As Connection
Set objConn = objADO.PromptNew
objSpyConn.ADOConnection = objConn.ConnectionString
End If


DatabaseConnection.CreateMissingTables

See also

Declaration: CreateMissingTables as Boolean

Description
property CreateMissingTables


DatabaseConnection.CreateNew

See also

Declaration: CreateNew as Boolean

Description
property CreateNew


DatabaseConnection.File

See also

Declaration: File as String

Description
property File


DatabaseConnection.NumberDateTimeFormat

See also

Declaration: NumberDateTimeFormat as SPYNumberDateTimeFormat

Description
property NumberDateTimeFormat


DatabaseConnection.SQLSelect

See also

Declaration: SQLSelect as String

Description
property SQLSelect


DatabaseConnection.TextFieldLen

See also

Declaration: TextFieldLen as long

Description
property TextFieldLen


Document.GridView

See also

Declaration: GridView as GridView

Description
property GridView


Document.RootElement

See also

Declaration: RootElement as XMLData

Description
property RootElement


Document.Title

See also

Declaration: Title as String

Description
Title is the file name of the document.


Documents.Count

See also

Declaration: Count as long

Description
Count of open documents.


Documents.Item

See also

Declaration: Item(n as long) as Document

Description
Gets the document with the index n in this collection.


ElementList.Count

See also

Declaration: Count as long

Description
Count of elements in this collection.


ElementList.Item

See also

Declaration: Item(n as long) as ElementListItem

Description
Gets the element with the index n from this collection.


ElementListItem.ElementKind

See also

Declaration: ElementKind as SPYXMLDataKind

Description
Kind of element.


ElementListItem.FieldCount

See also

Declaration: FieldCount as long

Description
Count of fields for this element. The actual value depends on the current export settings.


ElementListItem.Name

See also

Declaration: Name as String

Description
Name of the element.


ElementListItem.RecordCount

See also

Declaration: RecordCount as long

Description
Count of records for this element. The actual value depends on the current export settings.


ExportSettings.CreateKeys

See also

Declaration: CreateKeys as Boolean

Description
Default is True.

This property turns creation of keys on or off.


ExportSettings.ElementList

See also

Declaration: ElementList as ElementList

Description
Default is empty list.

This list of elements defines the rows for the export. It is possible to remove elements from export with ElementList.RemoveElement.


ExportSettings.EntitiesToText

See also

Declaration: EntitiesToText as Boolean

Description
Default is True.


ExportSettings.ExportAllElements

See also

Declaration: ExportAllElements as Boolean

Description
Default is True.

If ExportAllElements is False, then ExportSettings.SubLevelLimit is used to restrict the number of sub levels to export.


ExportSettings.FromAttributes

See also

Declaration: FromAttributes as Boolean

Description
Default is True.


ExportSettings.FromSingleSubElements

See also

Declaration: FromSingleSubElements as Boolean

Description
Default is True.


ExportSettings.FromTextValues

See also

Declaration: FromTextValues as Boolean

Description
Default is True.


ExportSettings.IndependentPrimaryKey

See also

Declaration: IndependentPrimaryKey as Boolean

Description
Default is True.

Turns creation of independent primary key counter for every element on or off. If ExportSettings.CreateKeys is False, this property will be ignored.


ExportSettings.SubLevelLimit

See also

Declaration: SubLevelLimit as integer

Description
Default is 0.

Defines the number of sub levels to include for the export.
This property is ignored if ExportSettings.ExportAllElements is True.


GridView.CurrentFocus

See also
Declaration: CurrentFocus as XMLData
Description
property CurrentFocus


GridView.IsVisible

See also
Declaration: IsVisible as Boolean
Description
property IsVisible


SpyProject.RootItems

See also
Declaration: RootItems as SpyProjectItems
Description
Root level of collection of project items.


SpyProjectItem.ChildItems

See also
Declaration: ChildItems as SpyProjectItems
Description
If the item is a folder, ChildItems is the collection of the folder content.


SpyProjectItem.FileExtensions

See also
Declaration: FileExtensions as String
Description
property FileExtensions


SpyProjectItem.ItemType

See also
Declaration: ItemType as SPYProjectItemTypes
Description
property ItemType


SpyProjectItem.Name

See also
Declaration: Name as String
Description
property Name


SpyProjectItem.Path

See also
Declaration: Path as String
Description
property Path


SpyProjectItem.ValidateWith

See also
Declaration: ValidateWith as String
Description
property ValidateWith


SpyProjectItem.XMLForXSLTransformation

See also
Declaration: XMLForXSLTransformation as String
Description
property XMLForXSLTransformation


SpyProjectItem.XSLForXMLTransformation

See also
Declaration: XSLForXMLTransformation as String
Description
property XSLForXMLTransformation


SpyProjectItem.XSLTransformationFileExtension

See also
Declaration: XSLTransformationFileExtension as String
Description
property XSLTransformationFileExtension


SpyProjectItem.XSLTransformationFolder

See also
Declaration: XSLTransformationFolder as String
Description
property XSLTransformationFolder


SpyProjectItems.Count

See also
Declaration: Count as long
Description


SpyProjectItems.Item

See also
Declaration: Item(n as long) as SpyProjectItem
Description


TextImportExportSettings.DestinationFolder

See also
Declaration: DestinationFolder as String
Description
property DestinationFolder


TextImportExportSettings.EnclosingCharacter

See also
Declaration: EnclosingCharacter as SPYTextEnclosing
Description
property EnclosingCharacter


TextImportExportSettings.Encoding

See also
Declaration: Encoding as String
Description
property Encoding


TextImportExportSettings.EncodingByteOrder

See also
Declaration: EncodingByteOrder as SPYEncodingByteOrder
Description
property EncodingByteOrder


TextImportExportSettings.FieldDelimiter

See also
Declaration: FieldDelimiter as SPYTextDelimiters
Description
property FieldDelimiter


TextImportExportSettings.FileExtension

See also
Declaration: FileExtension as String
Description
property FileExtension


TextImportExportSettings.HeaderRow

See also
Declaration: HeaderRow as Boolean
Description
property HeaderRow


TextImportExportSettings.ImportFile

See also
Declaration: ImportFile as String
Description
property ImportFile


XMLData.HasChildren

See also

Declaration: HasChildren as Boolean

Description
The property is true, if the element is parent of other elements.


XMLData.Kind

See also

Declaration: Kind as SPYXMLDataKind

Description
Kind of this element.


XMLData.MayHaveChildren

See also

Declaration: MayHaveChildren as Boolean

Description
Shows if it is allowed to add children to this element.


XMLData.Name

See also

Declaration: Name as String

Description
Used to modify and to get the name of the element.


XMLData.Parent

See also

Declaration: Parent as XMLData

Return value
Parent as XMLData object.
Nothing (or NULL) if there is no parent element.

Description
Parent of this element.


XMLData.TextValue

See also

Declaration: TextValue as String

Description
Used to modify and to get the text value of this xml element.


Document.ConvertDTDOrSchema

See also

Declaration: ConvertDTDOrSchema(nFormat as SPYDTDSchemaFormat, nFrequentElements as SPYFrequentElements)

Description
method ConvertDTDOrSchema