XML Schema Essentials

pdf
Số trang XML Schema Essentials 403 Cỡ tệp XML Schema Essentials 5 MB Lượt tải XML Schema Essentials 0 Lượt đọc XML Schema Essentials 40
Đánh giá XML Schema Essentials
5 ( 22 lượt)
Nhấn vào bên dưới để tải tài liệu
Đang xem trước 10 trên tổng 403 trang, để tải xuống xem đầy đủ hãy nhấn vào bên trên
Chủ đề liên quan

Nội dung

TE AM FL Y XML Schema Essentials R. Allen Wyke Andrew Watt Wiley Computer Publishing John Wiley & Sons, Inc. XML Schema Essentials R. Allen Wyke Andrew Watt Wiley Computer Publishing John Wiley & Sons, Inc. Publisher: Robert Ipsen Editor: Cary Sullivan Developmental Editor: Scott Amerman Associate Managing Editor: Penny Linskey Associate New Media Editor: Brian Snapp Text Design & Composition: D&G Limited, LLC Designations used by companies to distinguish their products are often claimed as trademarks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the product names appear in initial capital or ALL CAPITAL LETTERS. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration. This book is printed on acid-free paper. Copyright © 2002 by R. Allen Wyke and Andrew Watt. All rights reserved. Published by John Wiley & Sons, Inc. Published simultaneously in Canada. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4744. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax (212) 8506008, E-Mail: PERMREQ @ WILEY.COM. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold with the understanding that the publisher is not engaged in professional services. If professional advice or other expert assistance is required, the services of a competent professional person should be sought. Library of Congress Cataloging-in-Publication Data: ISBN: 0-471-412597 Printed in the United States of America. 10 9 8 7 6 5 4 3 2 1 CHAPTER Contents Introduction ix Acknowledgments xi About the Authors xiii Part One Getting Started 1 Chapter 1 Elementary XML Schema 3 What Is XML Schema? 5 How Does an XML Schema Processor Work? 6 What Is XML Schema for? 7 XSD Schema Schema Components 7 Other Schema Languages for XML 8 The DTD Descended from SGML 8 XSD Schema Tools 9 XML Schema Document 14 iii iv Contents Root of an XML Schema Document 16 Declaring the Location of Your XML Schema Document 16 Declaring Elements and Defining Types Defining Simple Types 17 Defining Complex Types 25 Anonymous Complex Types 25 Named Complex Types 26 Using Anonymous or Named Complex Types 29 Declarations 34 Annotations in Schema 42 Standard XML Comments 42 The Element 43 Empty Element Declaration 45 The anyType Type 50 Occurrence Constraints 51 Cardinality in DTDs 51 minOccurs and maxOccurs 51 Defining Your Own Simple Type 56 Model Groups in Schema 57 Sequence Group 57 Choice Group 57 All Group 58 Attribute Groups 61 More about the XML 1.0 DTD Content Model 62 Validation in XSD Schema Chapter 2 17 63 Validation versus Assessment 64 XML Information Set 67 Post-Schema Validation Infoset 69 Summary 69 XSD Elements 71 XML Elements 72 Defining within a DTD 72 Limitations 76 Contents Moving On to XSD Elements : A Closer Examination 81 Default Values 83 Substitution Groups 85 Null Values 92 Attributes 93 Complex Content 99 Importing Elements from Other Locations 107 Redefining Elements 111 More on Chapter 3 77 112 Using a Sequence 114 Grouping 114 Summary 119 Adding Attributes 121 What Are Attributes? 122 Additional Metadata 122 Application Uses 125 Storing Data 126 Hybrid Approaches 128 Considerations for Using Attributes 130 XML Attributes Foundation 130 Syntax 130 Capabilities 131 XSD Attributes: The Next Generation 132 Syntax Changes 132 Further Capabilities 134 Using Attributes 136 Scope 136 Qualification 138 Defaults 140 Grouping 141 Inclusion of Other Attributes 142 Summary 142 v vi Contents Part Two Going Beyond DTDs 145 Chapter 4 Applying Datatypes 147 What Are Datatypes? 147 Primitive Datatypes 149 Derived Datatypes 152 Defining Our Own Datatypes 152 More on Simple Types Defining Lists 160 Creating a Union 162 Constraining Type Definitions Chapter 5 Chapter 6 157 167 Controlling Digits 171 Handling White Space 174 Pattern Matching 180 Applicability of Facets 181 Summary 183 Data Facets 185 Fundamental and Constraining Facets 186 Constraining Facets in XSD Schema 186 The length Element 187 The minLength Element 195 The maxLength Element 198 The pattern Element 200 Parts Catalog Example 202 Postal Code Examples 206 The enumeration Element 211 Simple Enumeration Example 212 U.S. States Example 213 The whiteSpace Element 216 Summary 217 More about Data Facets 219 The maxExclusive Element 220 The maxInclusive Element 223 The minExclusive Element 225 Contents Chapter 7 Chapter 8 The minInclusive Element 228 The totalDigits and fractionDigits Facets 233 Summary 238 Grouping Elements and Attributes 239 Reusing Definitions with Groups 240 Nesting Sequence Groups 245 Nesting Choice Groups 246 Substitution Groups 250 Attribute Groups 257 Summary 258 Deriving Types 259 Deriving Types by Extension 260 Deriving Types by Restriction 271 The enumeration Element 279 The pattern Element 282 The xsi:type Attribute 284 Summary 285 Part Three Next Steps 287 Chapter 9 Uniqueness and Keys in XSD Schema 289 Identity-Constraint Definitions 289 The Element 290 The and Elements 298 Summary 303 Chapter 10 Bringing the Parts Together Modularizing Schemas How to Use Schema Modules 305 305 306 Creating the Example 325 Planning the Example 325 Defining the Information Needs 325 Documenting the Schema 326 Basic Schema Templates 327 Modularizing the Schemas 328 vii
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.