Tutorial
All rights reserved. No parts of this work may be reproduced in any form or by any means
- graphic, electronic, or mechanical, including photocopying, recording, taping, or
information storage and retrieval systems - without the written permission of the publisher.
Products that are referred to in this document may be either trademarks and/or registered
trademarks of the respective owners. The publisher and the author make no claim to
these trademarks.
While every precaution has been taken in the preparation of this document, the publisher
and the author assume no responsibility for errors or omissions, or for damages resulting
from the use of information contained in this document or from the use of programs and
source code that may accompany it. In no event shall the publisher and the author be
liable for any loss of profit or any other commercial damage caused or alleged to have
been caused directly or indirectly by this document.
Published: 2005
© 2005 Altova GmbH 1998-2005 Altova GmbH
Altova XMLSpy Tutorial
Table of Contents
2
The XMLSpy interface1
3
Creating a basic XML Schema2
2.1 ...................................................................................................... 4Creating a new XML Schema file
2.2
...................................................................................................... 7
Defining namespaces
2.3 ...................................................................................................... 8Defining a content model
2.4 ...................................................................................................... 12Adding elements with drag-and-drop
2.5 ...................................................................................................... 13Configuring the Content Model View
2.6
...................................................................................................... 15
Completing the basic schema
18
Advanced XML Schema definitions3
3.1 ...................................................................................................... 19Working with Complex Types and Simple Types
3.2
...................................................................................................... 27
Referencing global elements
3.3 ...................................................................................................... 29Attributes and attribute enumerations
31
Schema navigation and documentation4
4.1
...................................................................................................... 32
Schema navigation
4.2 ...................................................................................................... 34Schema documentation
38
Creating an XML document5
5.1
...................................................................................................... 39
Creating a new XML file
5.2 ...................................................................................................... 41Specifying the type of an element
5.3 ...................................................................................................... 43Entering data in Grid View
5.4 ...................................................................................................... 44Entering data in Text View
5.5
...................................................................................................... 48
Validating the document
5.6 ...................................................................................................... 52Appending elements and attributes in Grid View
5.7 ...................................................................................................... 54Editing in Database/Table View
5.8 ...................................................................................................... 58Modifying the schema
60
Using XSLT to transform XML6
6.1 ...................................................................................................... 61Assigning an XSL file
6.2 ...................................................................................................... 62Transforming the XML file
6.3
...................................................................................................... 63
Modifying the XSL file
65
Working with databases7
7.1 ...................................................................................................... 66Exporting XML data to external databases
7.2
...................................................................................................... 69
Importing database data
1Altova XMLSpy Tutorial
7.3
...................................................................................................... 73
Creating a database schema
78
Project management8
8.1 ...................................................................................................... 79Benefits of projects
8.2
...................................................................................................... 80
Building a project
82
That's it !9
Index
83
Altova XMLSpy Tutorial
2
© 2005 Altova GmbH
1XMLSpy Tutorial
Altova XMLSpy Tutorial
XMLSpy Tutorial
This tutorial gives a short overview of XML and takes you through several tasks which provide
an overview of how to use
XMLSpy 2005
to its fullest.
You will learn how to:
·
Create a
simple schema
from scratch
·
Generalize
the schema
using simple and complex types
·
Create schema
documentation
·
Create a
n
XML
document
based on the schema file
·
Copy XML data to a
third party product
(Excel) and reinsert it in
XMLSpy 2005
·
Validate
the XML document against its schema
·
Update
Schema settings
while editing the XML document
·
Transform
the XML document into HTML using XSL
T, and see the result in the
Browser view
·
Import
and
export
database data to and from
XMLSpy 2005
·
Create a
schema
from a MS Access database
·
Create an
XMLSpy 2005
project
to organize all your XML documents
Installation and configuration
This tutorial assumes that you have successfully installed
XMLSpy 2005
on your computer and
received a free evaluation key-code, or are a registered user. The evaluation version of
XMLSpy
2005
is fully functional but limited to a 30-day period. You can request a regular license from our
secure web server or through any one of our resellers.
Tutorial example files
The tutorial files are available in the
.
..\
Examples\
T
utorial
folder.
The
Examples
folder
contains various XML files for you to experiment with,
while the
Tutorial
folder contains
all the files used in th
is
tutorial.
The
Template
folder
contains all the XML template files that are used whenever you select the
menu option
File | New
. These files supply the necessary data (namespaces and XML
declarations) for you to start working with the respective XML document immediately.