
Tutorial Altova XMLSpy 2007 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: 2007 © 2007 Altova GmbH Table of Contents 1 The XMLSpy interface 2 2 Creating a basic XML Schema 3 2.1 Creating a new XML...................................................................................................... Schema file 4 2.2 Defining namespaces...................................................................................................... 7 2.3 Defining a content...................................................................................................... model 8 2.4 Adding elements...................................................................................................... with drag-and-drop 12 2.5 Configuring the...................................................................................................... Content Model View 13 2.6 Completing the...................................................................................................... basic schema 15 3 Advanced XML Schema definitions 18 3.1 Working with Complex...................................................................................................... Types and Simple Types 19 3.2 Referencing global...................................................................................................... elements 27 3.3 Attributes and ......................................................................................................attribute enumerations 29 4 Schema navigation and documentation 32 4.1 Schema navigation...................................................................................................... 33 4.2 Schema documentation...................................................................................................... 35 5 Creating an XML document 39 5.1 Creating a new...................................................................................................... XML file 40 5.2 Specifying the ......................................................................................................type of an element 42 5.3 Entering data in...................................................................................................... Grid View 44 5.4 Entering data in...................................................................................................... Text View 45 5.5 Validating the ......................................................................................................document 49 5.6 Appending elements...................................................................................................... and attributes in Grid View 53 5.7 Editing in Database/Table...................................................................................................... View 55 5.8 Modifying the ......................................................................................................schema 59 6 Using XSLT to transform XML 61 6.1 Assigning an XSL...................................................................................................... file 62 6.2 Transforming the...................................................................................................... XML file 63 6.3 Modifying the ......................................................................................................XSL file 64 7 Project management 66 7.1 Benefits of projects...................................................................................................... 67 7.2 Building a project...................................................................................................... 68 Altova XMLSpy 2007 Tutorial 1 8 That's it ! 70 Index 71 2 Altova XMLSpy 2007 Tutorial XMLSpy Tutorial 1 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 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 an XML document based on the schema file Copy XML data to a third party product (Excel) and reinsert it in XMLSpy Validate the XML document against its schema Update Schema settings while editing the XML document Transform the XML document into HTML using XSLT, and see the result in the Browser view Import and export database data to and from XMLSpy Create a schema from an MS Access database Create an XMLSpy project to organize all your XML documents Installation and configuration This tutorial assumes that you have successfully installed XMLSpy on your computer and received a free evaluation key-code, or are a registered user. The evaluation version of XMLSpy 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 application folder: XMLSpy2007\Examples\Tutorial The Examples folder contains various XML files for you to experiment with, while the Tutorial folder contains all the files used in this 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. © 2007 Altova GmbH Altova XMLSpy 2007 Tutorial 2 XMLSpy Tutorial The XMLSpy interface 1 The XMLSpy interface The XMLSpy interface is structured into three vertical areas. The central area provides you with multiple views of your XML document. The areas on either side of this central area contain windows that provide information, editing help, and file management features. The left area consists of the Project and Info windows. The central area, called the Main window, is where you edit and view all types of XML documents. You can switch between different views: Text View, Grid View, Schema/WSDL Design View, Authentic View, and Browser View. These views are described in detail in the respective sections on them. The right area contains the three Entry Helper windows, which enable you to insert or append elements, attributes, and entities. What entries are displayed in the Entry Helper windows depends on the current selection or cursor location in the XML file. The details of the interface are explained as we go along. Note that the interface changes dynamically according to the document that is active in the Main Window and according to the view selected. Altova XMLSpy 2007 Tutorial © 2007 Altova GmbH XMLSpy Tutorial Creating a basic XML Schema 3 2 Creating a basic XML Schema An XML Schema describes the structure of an XML document. An XML document can be validated against an XML Schema to check whether it conforms to the requirements specified in the schema. If it does, it is said to be valid; otherwise it is invalid. XML Schemas enable document designers to specify the allowed structure and content of an XML document and to check whether an XML document is valid. The structure and syntax of an XML Schema document is complex, and being an XML document itself, an XML Schema must be valid according to the rules of the XML Schema specification. In XMLSpy, the Schema/WSDL Design View enables you to easily build valid XML Schemas by using graphical drag-and-drop techniques. The XML Schema document you construct is also editable in Text View and Grid View, but is much easier to create and modify in Schema/WSDL View. Objective In this section of the tutorial, you will learn how to edit XML Schemas in Schema/WSDL View. Specifically, you will learn how to do the following: Create a new schema file Define namespaces for the schema Define a basic content model Add elements to the content model using context menus and drag-and-drop Configure the Content Model View After you have completed creating the basic schema, you can go to the next section of the tutorial, which teaches you how to work with the more advanced features of XML Schema in XMLSpy. This advanced section is followed by a section about schema navigation and documentation in XMLSpy. Commands used in this section In this section of the tutorial, you will use the Schema/WSDL View exclusively. The following commands are used: Display Diagram (or Display Content Model View). This icon is located to the left of all global components in Schema Overview. Click this icon to display the content model of the associated global component. © 2007 Altova GmbH Altova XMLSpy 2007 Tutorial 4 XMLSpy Tutorial Creating a basic XML Schema 2.1 Creating a new XML Schema file To create a new XML Schema file
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages77 Page
-
File Size-