Altova Xmlspy 2019 Enterprise Edition 1 7 Project Management 81 7.1 Benefits O..F
Total Page:16
File Type:pdf, Size:1020Kb
Altova XMLSpy 2019 Tutorial Altova XMLSpy 2019 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: 2019 © 2019 Altova GmbH Table of Contents 1 XMLSpy Interface 2 1.1 The Views.. .................................................................................................... 4 1.2 The Windo..w..s.. ................................................................................................ 6 1.3 Menus and.. .T..o..o.l.b..a..r.s. ....................................................................................... 8 1.4 Text View... .S..e..t.t.in..g..s. ....................................................................................... 10 2 XML Schemas: Basics 14 2.1 Creating .a. .N...e..w... .X..M...L... .S..c.h..e..m...a. .F..i.l.e.. ............................................................... 15 2.2 Defining .N..a..m...e..s.p..a..c.e..s.. .................................................................................. 17 2.3 Defining .a. .C...o..n.t.e..n..t. .M...o..d..e.l. ............................................................................. 19 2.4 Adding E.l.e.m...e..n..t.s. .w...i.t.h. .D...r.a..g..-.a..n..d.-..D..r..o.p.. ........................................................... 24 2.5 Configuri.n.g.. .t.h..e.. .C..o..n..t.e.n..t. .M...o..d..e..l .V...i.e..w.. ............................................................. 26 2.6 Completin..g.. .t.h.e.. .B...a.s..i.c. .S..c..h..e..m..a.. ....................................................................... 28 3 XML Schemas: Advanced 31 3.1 Working .w..i.t.h.. .C..o..m...p..le..x.. .T..y..p..e.s.. .a..n.d.. .S..i.m...p.l.e.. .T..y..p..e.s.. ............................................ 32 3.2 Referenc.i.n.g.. .G...lo..b..a..l .E...le..m...e..n.t.s.. ........................................................................ 40 3.3 Attributes.. .a.n..d.. .A...t.t.r.i.b.u..t.e.. .E..n..u..m..e..r.a..t.i.o..n.s.. ........................................................... 43 4 XML Schemas: XMLSpy Features 46 4.1 Schema N...a.v..i.g..a.t.i.o..n.. ...................................................................................... 47 4.2 Schema D...o.c..u..m...e.n..t.a..t.i.o.n.. ................................................................................ 50 5 XML Documents 54 5.1 Creating .a. .N...e..w... .X..M...L... .F..il.e.. ............................................................................ 55 5.2 Specifyin.g. .t.h..e.. .T..y..p..e. .o..f. .a..n.. .E..l.e..m..e..n..t. ................................................................ 57 5.3 Entering D...a..t.a.. .in.. .G...r.i.d. .V...i.e..w.. ........................................................................... 59 5.4 Entering D...a..t.a.. .in.. .T..e..x..t. .V...ie..w... .......................................................................... 60 5.5 Validating.. .t.h..e. .D...o..c..u.m...e..n..t. .............................................................................. 64 5.6 Adding E.l.e.m...e..n..t.s. .a..n..d. .A...t.t.r.i.b..u..t.e.s.. .................................................................... 68 5.7 Editing in. .D..a..t.a..b..a.s..e../.T..a..b.l.e.. .V...ie..w... .................................................................... 70 5.8 Modifying.. .t.h..e. .S..c..h..e..m..a.. .................................................................................. 74 6 XSLT Transformations 76 6.1 Assigning. .a..n.. .X..S..L...T.. .F..i.le.. ................................................................................ 77 6.2 Transform...in..g.. .t.h..e. .X...M...L.. .F..i.l.e.. .......................................................................... 78 6.3 Modifying.. .t.h..e. .X...S..L.. .F..i.l.e. ................................................................................. 79 Altova XMLSpy 2019 Enterprise Edition 1 7 Project Management 81 7.1 Benefits o..f. .P...r.o..je..c..t.s. ...................................................................................... 82 7.2 Building a.. .P..r.o..j.e.c..t. ......................................................................................... 83 8 That's It 85 Index 86 2 Altova XMLSpy 2019 Enterprise Edition XMLSpy Tutorial 1 XMLSpy Tutorial This tutorial provides an overview of XML and takes you through a number of key XML tasks. In the process you will learn how to use some of XMLSpy's most powerful features. The tutorial is divided into the following parts: XMLSpy Interface, which helps you to familiarize yourself with the applications's graphical user interface (GUI). Creating an XML Schema. You will learn how to create an XML Schema in XMLSpy's intuitive Schema View, how to create complex content models using drag-and-drop mechanisms, and how to configure Schema View. Using Schema View features to create complex and simple types, global element references, and attribute enumerations. Learning how to navigate schemas in Schema View, and how to generate documentation of schemas. Creating an XML document. You will learn how to assign a schema for an XML document, edit an XML document in Grid View and Text View, and validate XML documents using XMLSpy's built-in validator. Transforming an XML file using an XSLT stylesheet. This involves assigning an XSLT file and carrying out the transformation using XMLSpy's built-in XSLT engines. Working with XMLSpy projects, which enable you to easily organize 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: C:\Documents and Settings\<username>\My Documents\Altova\XMLSpy2019\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 in the application folder (typically in c:\Program Files\Altova) 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. © 2019 Altova GmbH Altova XMLSpy 2019 Tutorial 2 XMLSpy Tutorial XMLSpy Interface 1 XMLSpy Interface In this section of the tutorial, you will start XMLSpy and get to know the interface. Starting XMLSpy To start XMLSpy, double-click the XMLSpy icon on your desktop or use the Start | All Programs menu to access the XMLSpy program. XMLSpy is started with no documents open in the interface. Open XMLSpy now. Overview of the interface The default view of the XMLSpy interface is structured into three vertical areas (figure below). These three areas contain, from left to right: (i) the Project and Info windows; (ii) the Main and Output windows; and (iii) the Entry Helper windows. Look at the Project window. It will contain the Examples project, which is opened by default when you start XMLSpy for the first time. Given below are key points that will help you to understand the layout of the interface and the functions of its various components. The sub-sections of this first part of the tutorial will help you get familiar with the interface. Document bar in the Main window: When multiple documents are open, each document is displayed in a tab in the document bar of the Main window (see figure). Clicking a tab makes that document the active document. You can scroll document tabs by clicking the arrows on the right hand side of the document bar. Open two or more files (for example, from the Examples project), and check how the tabs work. Altova XMLSpy 2019 Tutorial © 2019 Altova GmbH XMLSpy Tutorial XMLSpy Interface 3 Document editing views: The active document can be viewed in one of multiple applicable editing views. For example: An XML (.xml) document can be viewed in Text View, Grid View, Authentic View, and Browser View, but cannot be viewed in other views, such as Schema View. An XML Schema (.xsd) document, on the other hand can be viewed in Text View, Grid View, Schema View, and Browser View, but not in Authentic View. The following views are available: Text View, Grid View, Schema View, Authentic View, and Browser View. Entry helpers: The entry helper windows change according to the kind of the active document (for example, XML or XSD or CSS or WSDL) and according to the currently active document