XML Grammars

  • Introduction
  • Element Declaration
  • Attribute Declaration
  • Attribute Types
  • Attribute Defaults
  • DOCTYPE Declaration
  • Root Element
  • String Types
  • Number Types
  • Date and Time Types
  • Other Types
  • Constraining Facets
  • Simple Type
  • Complex Type
  • Schema Reference
  • Tool Support
  • simple types
  • enumeration
  • occurrences
  • choice/group
  • Conclusions

Referencing an XML Schema

A XML Schema can be referenced from an XML document by defining the schemaLocation and noNamespaceSchemaLocation attributes.

The 'schemaLocation' attribute is used to reference XML Schema(s) that are defined in a target-namespace.

The schemaLocation attribute can contain a list of namespaces and schema-locations, separated by white-space.

You can define multiple namespaces/schema-location pairs to validate elements and attributes in different namespaces.

The 'noNamespaceSchemaLocation' attribute is used to reference XML Schema(s) that are not defined in a target-namespace.

The noNamespaceSchemaLocation attribute only contains schema-locations and no namespace-uris.

The schemaLocation/noNamespaceSchemaLocation attributes are in is the 'http://www.w3.org/2001/XMLSchema-instance' namespace.

The schemaLocation/noNamespaceSchemaLocation attributes are provided as a hint for the XML Processor (the XML Processor is not obliged to use it).

W3C

The XML Schema Working Group is closed, having completed its work successfully. The specifications are now maintained by the W3C XML Core Working Group .

Tools · Usage · Resources · Specifications and Development

XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content and semantics of XML documents. in more detail. XML Schema 1.0 was approved as a W3C Recommendation on 2 May 2001 and a second edition incorporating many errata was published on 28 October 2004; see reference list for pointers.

The XML Schema Working Group, part of the XML Activity , is responsible for the W3C's work on this topic -- for details see the Working Group's charter . W3C Members can also participate in the W3C XML Schema Interest Group, a forum for the discussion of technical issues relating to the development of XML Schema.

See also: Robin Cover's index of XML Schema materials .

Grégory Chazalon has provided un sommaire en français .

XML Schema 1.1 Status

XML Schema 1.1 (in two parts) is a W3C Recommendation. It is intended to be mostly compatible with XML Schema 1.0 and to have approximately the same scope, but also to fix bugs and make whatever improvements we can, consistent with the constraints on scope and compatibility.

XML Schema 1.1 Part 2: Datatypes and XML Schema 1.1 Part 1: Structures are available.

There is also a Test Collection aimed at determining which parts of XSD 1.1 have been implemented; several implementations are under development.

If you find errors in Schema 1.1, please let us know. The best way to do that is to add an entry to the W3C's public installation of Bugzilla , which the WG uses to track issues and enhancement requests, specifying "XML Schema" as the 'product' name. Full instructions can be found at http://www.w3.org/XML/2006/01/public-bugzilla . If access to Bugzilla is not feasible, please send your comments to the W3C XML Schema Working Group's public comments mailing list, www-xml-schema-commentsAw3.org ( archive ). Please note that both the Bugzilla installation and the comments list are not only public-write but also public-read; don't say things you don't want seen in public. Each Bugzilla entry and email message should contain only one comment.

The Bugzilla system should also be used to report errors with XML Schema 1.0.

Please send any related announcements to xmlschema-dev .

[This list is not actively maintained because the Working Group no loner exists.]

  • 2010-01-05 generate bindings from XML Schema
  • 2009-11-19 Python XML Schema Bindings
  • 2008-01-06 Visual Schema
  • 2007-12-12 Stylus Studio 2008 released
  • 2007-11-13 CodeSynthesis XSD/e 2.0.0 released
  • 2007-11-04 Saxon 9.0
  • 2007-10-23 Liquid XML Studio 2008
  • 2007-10-17 Intel XML Software
  • 2007-09-20 XSD/e version 1.1.0
  • 2007-09-17 XMLSpy/Altova
  • 2007-09-03 Xerces-C++ 2.8.0
  • 2007-08-22 LMX V3.4
  • 2007-08-01 CodeSynthesis XSD 3.0.0
  • 2007-06-05 xchecker
  • 2007-05-17 oNVDL
  • 2007-05-08 oXygen XML version 8.2
  • 2007-01-22 DocFlex/XSD
  • 2006-11-28 LINQ to XSD
  • 2006-11-17 SchemaAgent 2007
  • 2006-10-18 XSDBench
  • 2006-09-22 XmlPad
  • 2006-09-19 xnsdoc 1.2 - XML Schema documentation generator
  • 2006-09-13 BRICS Schematools
  • 2006-09-07 EditiX

Tools are listed alphabetically: BRICS Schematools , CodeSynthesis XSD , CodeSynthesis XSD/e , DocFlex/XSD , EDIFIX , EditiX , Intel XML Software , JAXB Reference Implementation , JaxFront , JaxMe , JBind , KLEEN , LINQ to XSD , Liquid XML , LMX , MSXML , NetBeans Schema support , oNVDL , oXygen , PyXB , Saxon , SchemaAgent , Schema-Forms , Schematron Validator , Schema Viewer , SQC , Stylus Studio , Visual Schema XBinder , XBuilder , xchecker , Xerces-C(++) , Xerces-J , XML Architect , XML Beans , XML Datatypes Library , XMLEspresso , XMLFox , XML Infoset Browser , XML Nanny , XMLObjective , XmlPad , XML Schema Object Model , XML Schema Validator , XML Spy , XML ValidatorBuddy , XML::Validator::Schema , xnsdoc , XS3P , xsd2cpp , XSDBench , XSD Inference Tool , XSD/e , xsddoc , XSDDoc , xsdregex , XSD-to-C++ , XSDValid , XSU , XSV

[announce] who when

describe q.v.

Altova XML (XML Spy)

Version 2008 of the Altova XML product line is available 2007-09-17

Just a quick note to announce general availability of Version 2008 of the Altova XML product line. A few new features are:

  • Support for working with Open XML data in Microsoft(r) Word, Excel, and now PowerPoint 2007 files in XMLSpy
  • Database content editing in XMLSpy and DatabaseSpy
  • XInclude and XPointer support in XMLSpy
  • Multi-file XPath evaluation in XMLSpy
  • New aggregate and ValueMap data processing functions for data mapping in MapForce
  • Modular StyleVision design files for re-using stylesheet constructs
  • Support for visualizing & managing XSLT and WSDL file relationships in SchemaAgent

More info and screenshots: http://www.altova.com/whatsnew.html . Download an upgrade or free trial: http://www.altova.com/download.html

BRICS Schematools

dk.brics.schematools - XML Schema, RELAX NG, DTD, XML graphs Anders Møller 2006-09-13

dk.brics.schematools is a Java package for manipulation and validation of XML graphs (also known as Summary Graphs) and schemas written in Restricted RELAX NG, DTD, or XML Schema, and for XPath evaluation on XML graphs. The first public release is now available from http://www.brics.dk/schematools/

Codalogic LMX

Codalogic LMX - XSD to C++ data binding compiler Pete Cordell 2007-09-22

LMX is an XML to C++ data binding code generation tool offering comprehensive XSD schema (and DTD) feature coverage. Focussing specifically on the nuances of C++, it comes with its own lightweight parser, for which compact and easy to build source code is available. Thus, in addition to being easy to use and deploy on Windows and Linux platforms, it is a great solution for cross-platform development.

For more information, visit http://www.codalogic.com/lmx/ (or the convenience URL http://www.xml2cpp.com ).

CodeSynthesis XSD - XML Schema to C++ compiler

CodeSynthesis XSD 3.0.0 - Open-source XML Schema to C++ compiler Boris Kolpackov 2007-08-01

CodeSynthesis XSD is an open-source, cross-platform W3C XML Schema to C++ data binding compiler. Provided with a schema, it generates C++ classes that represent the given vocabulary as well as parsing and serialization code. You can then access the data stored in XML using types and functions that semantically correspond to your application domain rather than dealing with elements, attributes, and text in a direct representation of XML such as DOM or SAX.

XSD supports both in-memory and stream-oriented processing models by implementing two C++ mappings: C++/Tree and C++/Parser. The C++/Tree mapping represents the information stored in XML instance documents as a tree-like, in-memory object model. The C++/Parser mapping generates parser skeletons for data types defined in XML Schema. Using these parser skeletons you can build your own in-memory representations or perform immediate processing of XML documents.

XSD is available on AIX, GNU/Linux, HP-UX, Mac OS X, Solaris, and Windows. Supported C++ compilers include: GNU g++, HP aCC, Intel C++, Sun C++, IBM XL C++, and MS Visual C++. More information as well as precompiled binaries for all supported platforms are available from http://www.codesynthesis.com/products/xsd/

CodeSynthesis XSD/e - validating XML processing for embedded systems

CodeSynthesis XSD/e 2.0.0 released Boris Kolpackov 2007-11-13

CodeSynthesis XSD/e is an open-source XML parser/serializer generator for mobile and embedded systems. It provides event-driven, stream-oriented XML parsing, XML serialization, XML Schema validation, and C++ data binding while maintaining a small footprint and portability.

Compared to general-purpose validating XML processors, the XSD/e-generated code is 2-10 times faster while maintaining the lowest static and dynamic memory footprints. For example, a validating parser executable can be as small as 120KB in size. XSD/e is also highly-portable and can be used without STL, RTTI, iostream, C++ exceptions, and C++ templates.

Supported embedded toolchains include GNU g++ 2.95.x-4.x.x, eMbedded Visual C++ 4.0, and Visual Studio 2005 with Smart Devices support. Precompiled binary distributions are available for GNU/Linux, Solaris, and Windows host development platforms.

More information, documentation, source code, and precompiled binaries are available from http://www.codesynthesis.com/products/xsde/

DocFlex/XSD

DocFlex/XSD - a new template-driven XML Schema documentation generator Leonid Ruby 2007-01-22

DocFlex/XSD is a new easy adjustable template-driven XML Schema documentation generator.

It is able to generate professional quality documentation for any W3C XML Schema(s) in the form of both multi-framed hypertext HTML and printable RTF output.

For lots more information and downloads, [see] http://www.filigris.com/products/docflex_xsd/

EDIFIX 5.5R

New CCTS/UBL Data Modeling and Schema Generation Software Sylvia Webb 2005-02-05

The scalable product line GEFEG EDIFIXR supports all processes involved in the preparation of electronic business applications: . . . deriving compatible XML schemata from existing traditional EDI guidelines. . .

The XML-UML EDIFIX is targeted for users who design professional business messages with data modeling technology and as the next step represent and further edit these data models in XML schemas. Available at http://www.gefeg.com/en/index.htm

EditiX 5.0 - XML Editor Released A. Brillant 2006-09-07

We are glad to announce the release 5.0 of your product EditiX : An XML Editor and XSLT Debugger. This release includes about 50 improvements in various application parts (Schema,DTD,FO,XSLT...). Prices starting at $22. Details: http://www.editix.com .

Intel XML Software

Intel's New XML Software Products Thorsten Moeller, 2007-10-17

Intel is delighted to announce the release of the Intel® XML Software Suite Beta. The Beta package provides high performance XSLT processing, XPath, XML Parsing, DOM/SAX support, and XML Schema Validation functionality for Java and C/C++ environments.

You can register yourself to participate in the Intel® XML Software Suite Beta program by visiting http://www.intel.com/cd/software/products/asmo-na/eng/366637.htm .

Additional Intel® XML Software products and information can be found at http://www.intel.com/software/xml .

JAXB Reference Implementation

JAXB 2.0 RI Early Access 3 Released Kohsuke Kawaguchi, 2006-01-23

We are pleased to announce the availability of the 2.0 Reference Implementation Early Access 3 release. This version corresponds to the JAXB Specification proposed final draft, which has already posted to the JAXB project some time ago.

The binary can be downloaded from the following location, as well as online release notes. [ https://jaxb.dev.java.net/jaxb20-ea3/ ]

JAXFront is a java technology to render electronic forms on multiple UI channels (Java Swing, HTML, PDF) on the basis of an xml schema that acts as a business model. The dynamically generated GUIs & Forms allow the user a sophisticated way of editing XML data without being exposed to the underlying XML technology.

Find an online demo and a free trial to download here: www.jaxfront.com

JaxMe 0.5 Jochen Wiedmann 2005-08-10

The ws-jaxme team is proud to announce the availability of JaxMe 0.5. JaxMe aims to become an implementation of the JAXB 1.0 specification.

Apache JaxMe is a Java/XML binding framework and aims to become an implementation of the JAXB specification. http://java.sun.com/webservices/technologies/index.jsp#Core_Web_Services for details on JAXB.

Compared to the version 0.4, the following features have been added: - Mixed content is supported - xs:extension is now properly mapped to Java inheritance.

Compared to the beta release, several important bugs have been fixed.

JaxMe is available on http://ws.apache.org/jaxme/downloads.cgi

A Java-XML databinding framework that supports the complete XML schema with the exception of external parsed entities , Stefan Wachter, 2002-09-13.

Available at http://jbind.sourceforge.net/ .

JBind consists of a schema compiler that generates Java sources corresponding to a supplied schema. In addition it contains a schema validating XML parser. (All of the W3C schema test collection tests were passed with the exception of some tests that seem to be incorrect).

Graphical authoring tool KLEEN Berthold Daum 2003-09-26

Asset Oriented Modeling (AOM) is an open conceptual modeling method combining Higher Order Entity Relationship Modeling with Hedge-Regular Grammars. The graphical tool KLEEN supports the creation and validation of asset oriented models. It can generate code in various formats such as XML Schema, Java, XMI, and SQL. KLEEN supports various refactoring methods for models and generated code, including the translations of non-deterministic structures into deterministic schemata. Available at http://www.aomodeling.org/ .

LINQ to XSD

LINQ to XSD Preview Alpha 0.1 released to the web Ralf Lämmel 2006-11-27

LINQ to XSD is the code name of an incubation project that aims to provide .NET developers with support for typed XML programming on top of LINQ to XML. While the LINQ to XML programmer operates on generic XML trees, the LINQ to XSD programmer operates on typed XML trees -- instances of .NET types that model the XML types of a specific XML schema (XSD). LINQ to XSD can be used whenever you have an XML schema available, or you are willing to infer a schema from the XML data at hand. LINQ to XSD is integrated into Visual Studio; so you just tag an XML schema as an 'LINQ to XSD schema', build your project, and the automatically derived object model is then part of your solution -- just as if XML schemas were .NET types. The derived object model enforces various validation constraints imposed by the underlying XML schema. See http://blogs.msdn.com/xmlteam/archive/2006/11/27/typed-xml-programmer-welcome-to-linq.aspx

Liquid XML 2008

Liquid XML Studio 2008 Released - A Freeware XML Development Environment 2007-10-23

Announcing the release of Liquid XML Studio 2008 a Freeware XML Development Environment.

Key features include

  • An Advanced Graphical Schema Editor
  • XML Editor, with auto-complete, syntax highlighting & validation
  • Web Service Browser, supports calling Soap services
  • XPath Expression Builder, visualise XPath expressions
  • Documentation Generator, HTML Docs from your XML schemas
  • Code Generation, C++, C#, .Net, Java, VB .Net & VB6 (trial)

Download available from http://www.liquid-technologies.com/Product XmlStudio.aspx

NetBeans Schema support

Chris Webster 2006-06-25

The XML schema tools available in the NetBeans Enterprise Pack 5.5 Early Access release allow you to visualize and edit XML schemas. The XML schema tools focus on complex information display and real-world use issues (for example, scalable visualization and editing of massive XML schemas). In addition, the XML schema tools reduce the complexity of creating and editing XML schemas, thus allowing someone who is not a schema expert to create and modify XML schema and other XML documents. Using the XML schema tools, you can reference external schemas and run advanced queries in the Analysis view.

Using XML schema functionality, you can:

  • Visualize and edit an XML schema in a scalable fashion using the Schema view
  • Edit a schema via an abstract instance view which provides an editable visualization of the instance document structure
  • Query and Visualize the Schema
  • Perform refactoring across XML Schema, WSDL, and BPEL

Netbeans Enterprise Pack Download: http://www.netbeans.org/products/

oNVDL version 20070517 adds an XSLT 2.0 implementation of NVDL dispatching George Cristian Bina 2007-05-17

A new version of oNVDL is available from http://www.oxygenxml.com/onvdl.html

oNVDL is an open source implementation of NVDL (Namespace-based Validation and Dispatching Language) in Java, based on Jing. oNVDL supports validation against XML Schema and also against Relax NG and Schematron.

The new version adds an XSLT 2.0 implementation of NVDL dispatching and fixes a couple of issues.

oXygen XML Editor 8.2 George Cristian Bina 2007-05-08

A new version of oXygen XML editor is available from our website http://www.oxygenxml.com . Version 8.2 introduces a concept of validation scenarios. These decouples the current file from the validation and allows you to specify a list of files to be validated instead, as well as the processors to be used. Thus it enables multiple validations in a single action and validating modules in the context they are used from.

The new version adds support for ISO Schematron and that mans also support for XML Schema with ISO Schematron embedded rules including content completion inside annotation/appinfo for ISO Schematron and validation of XML files against XML Schema with embedded ISO Schematron rules.

Other important additions in version 8.2 are an XQuery debugger against MarkLogic 3.2 native XML database, a large file viewer capable of opening files larger than a Gigabyte, multi-line search/replace support, a number of component updates and a lot of other additions.

To find the full list of new additions and more details please visit: http://www.oxygenxml.com/index.html

Microsoft XML Core Services 4.0 SP1 (formerly known as MSXML)

  • Support of the World Wide Web (W3) Consortium final recommendation for XML Schema, with both DOM and SAX.
  • Substantially faster XSLT engine. Our tests show about x4, and for some scenarios x8, acceleration.

It is available free from the MSDN XML site ( exact location ).

Python XML Schema Bindings 1.0.0 Peter A. Bigot 2009-11-18

PyXB version 1.0.0 is now available from SourceForge at: http://sourceforge.net/projects/pyxb/

PyXB (Python XML Schema Bindings; "pixbee") is a pure Python package that generates Python source code for classes that correspond to data structures defined by XMLSchema. In concept it is similar to JAXB for Java and CodeSynthesis XSD for C++. The current release supports XML Schema 1.0.

Version 1.0.0 is feature-complete and suitable for production development where validation of incoming and generated documents is desired.

Saxonica's Saxon Enterprise Edition (Saxon-EE) includes a schema processor that fully implements XSD 1.1. The processor supports:

  • compilation and verification of schema documents to generate a schema component model
  • exporting the schema component model to a (proprietary) XML representation
  • validation of instance documents
  • generating a validity report detailing all errors, in an XML representation
  • generating a typed instance of the XPath/XQuery Data Model (XDM) in which nodes are annotated with their schema-determined type

The processor can be executed from the command line, and APIs are available for Java, .NET, C/C++, and PHP.

SchemaAgent

Altova SchemaAgent 2007 Erin Cavanaugh 2006-11-17

Altova SchemaAgent 2007 represents a new paradigm for modeling and managing advanced schemas and their components in workgroups. It allows you to view and manage XML Schema relationships in a visual way, and construct complex schemas from distributed schema elements using drag-and-drop functionality. In addition to XML Schema files, you can also see XML Schemas used as sources or targets in Altova MapForce data mappings.

See http://www.altova.com/products/schemaagent/xml_schema_management.html for details.

Schema-Forms

Schema-Forms - XML based eForms program released KK Aw 2002-06-11

Multicentric Technology is pleased to announce the release of Schema-Forms, an XML Schema based eForms program.

Schema-Forms generate an eForm based on the XML-Schema and the constraints specified in the schema are applied during data entry. The output can be transformed to HTML with an XSLT document.

A shareware version of the program is available from http://www.multicentric.com .

Schematron Validator

Free Windows tool supports XML Schema with embedded Schematron , Eddie Robertson, Oct 25 2001

Although primarily a Schematron tool, it also "handles DTDs, W3C XML Schemas, and Schematron schemas embedded in W3C XML Schemas", available from Topologi .

Schema Viewer

SchemaViewer 1.0 , Frank Kilkelly 2002-11-08

SchemaViewer 1.0 is a Java application that virtually eliminates tedious browsing of XML Schema documents by representing them as a easily navigatable hierarchical tree. The application is a Swing-based GUI. It is freely available to download at: http://oocities.com/frakilk/software.html

IBM XML Schema Quality Checker . Achille Fokoue 2003-07-26

XML Schema Quality Checker (SQC) is a program which takes as input documents containing XML Schemas written in the W3C XML schema language and diagnoses improper uses of the schema language. Where the appropriate action to correct the schema is not obvious, the diagnostic message may include a suggestion about how to make the fix.

Version 2.2 now available ( http://www.alphaworks.ibm.com/tech/xmlsqc) : "fixes from XML Schema 1.0 Specification Errata (as of June 1, 2003) implemented; use of Xerces 2.4; SQC can now run on JRE 1.4"

Stylus Studio

Stylus Studio 2008 now available Tony Lavinio 2008-12-12

Stylus Studio 2008 is now available for free trial download or online purchase. Here are some of highlights:

  • WSDL Editor with embedded XML Schema editor
  • XML Publisher for writing HTML+CSS or XSL:FO+PDF
  • Multiple XML Schema validation engines included
  • Editing support for gigabyte-sized files
  • Bundled with DataDirect XML Converters 3.1 including support for HL7 (new), EANCOM, EDIFACT, IATA, and X12
  • Bundled with DataDirect XQuery 3.1

You may download a free evaluation copy from http://www.stylusstudio.com/xml_download.html .

Overview of XML Schema support in Stylus studio: http://www.stylusstudio.com/xml_schema.html

Visual Schema

Visual XML Schemas Siva Dirisala 2008-01-06

Even though many of the XML Schemas are meant for functional users so that they can design new systems or map existing systems to be standards compliant, their complexity makes it difficult for these users to study them. Even many software developers have difficulty understanding the XML Schemas due to their complexity. Visual Schema addresses this problem by presenting the XML Schemas as familiar and easily navigable html forms, typically found in enterprise business applications, that help the users easily understand the structure of an XML document.

Serveral open standards such as OAGIS and publicly available web services such as Amazon Web Services are available as Visual XML Schemas at http://www.visualschema.com/

XBinder XSD to C/C++ schema compiler

XBinder XSD to C/C++ schema compiler Ed Day 13-Dec-2005

XBinder is an XML Schema to C/C++ Data Binding Tool. Given an XML schema or WSDL definition, it will produce C or C++ code that consists of type definitions and encode/decode functions. This provides a complete Application Programming Interface (API) for working with all of the message definitions contained within an XML schema specification.

XBinder supports all types included within XML schema including complex and simple content and substitution groups. Also supported is include and import to allow schemas to be modularized. Some large schemas that have been compiled cleanly include UBL, FIXML, FpML, and CSTA.

Further details including a free evaluation download can be found at http://www.obj-sys.com/products_xbinder.shtml

Announcement for the release of XBuilder Shagun Grover 2002-02-05

The much awaited product XBuilder 1.1 - the schema builder has been released. The Schema Builder is so designed that all the base information regarding the Schema entities is displayed in a hierarchical format. In addition, the corresponding XML code for the individual entity gets automatically generated without user intervention. The 30 use trial version of XBuilder [has disappeared as of 2007-01 -- any info to [email protected], please].

xchecker - XPath 2.0 embedded in XML Schema Andrew Welch 2007-06-03

xchecker is a little utility I've written that (amongst other things) allows you to embed XPath 2.0 in XML Schema: http://xchecker.sf.net/

The xchecker processor implements the JAXP schema interfaces, using the underlying JAXP schema processor to do the validation. You can check anything you can you can write an XPath for.

Xerces-C(++)

Xerces-C++ 2.8.0 released Boris Kolpackov 2007-09-03

I am pleased to announce the availability of Apache Xerces-C++ 2.8.0. Xerces-C++ is an open-source validating XML parser written in a portable subset of C++. It provides DOM (level 1, 2, and certain parts of level 3), SAX, and SAX2 APIs and supports validation of XML documents against DTD and XML Schema.

This release is primarily focused on bug fixes, optimizations and build system improvements. For the complete list of changes in this version see the release information page: http://xerces.apache.org/xerces-c/releases.html

The source code archives and precompiled libraries are available from the download page: http://xerces.apache.org/xerces-c/download.cgi

Xerces 2 Java Parser released [email protected] 2001-12-20

This release now contains, among other features, full XML Schema support (with complete constraint checking). XML Schema support was redesigned and reimplemented in Xerces 2.

For more information, pls see the Apache web site: http://xerces.apache.org/xerces2-j/index.html

There is also an online Schema valdation service using Xerces-J run by Mukul Gandhi at https://xmlvalidation-mukulga.rhcloud.com/ [as of April 2016]

XML Architect

Sysonyx's xmlArchitect , Bryce Nielsen, 2002-04-26

xmlArchitect is an intuitive XML Schema editor, displaying a realtime treeview mockup of what the Instance XML Document should look like while editing the XML Schema. Also, direct edits can happen inside this XML Tree and the XML Schema will update itself to reflect the new XML structure.

Product Information is at [ http://www.sysonyx.com/Products/xmlDraft/index.asp ]; Downloadable at [ http://www.sysonyx.com/Products/xmlDraft/downloads.asp ]

Apache XMLBeans v2.1.0 available Radu Preotiuc-Pietro 2005-12-09

The Apache XMLBeans team is pleased to announce the availability of Apache XMLBeans v2.1.0. XMLBeans is a complete XML processing solution for Java, including XML Schema support, XML Schema to Java binding, lightweight fast Infoset access, XML Schema information access, DOM, SAX and StAX implementations, XPath/XQuery integration. Everything is available in a package that is easy to use and fully integrated, allowing the user to seamlessly switch between all APIs.

Binary downloads for Windows and Unix are available from http://xmlbeans.apache.org/sourceAndBinaries/

[For those familiar with XMLBeans V1, see http://xmlbeans.apache.org/news for a list of changes and additions in XMLBeans V2]

XML Datatypes Library

Sun's XML Datatypes Library Kohsuke KAWAGUCHI May 04 2001

XML Datatypes Library is a Java implementation of W3C XML Schema Part 2. It can be used from any Java code to

  • validate strings with datatypes
  • convert strings into Java objects

XMLEspresso

XMLEspresso 4.0 Announcement Ajay Votra 2003-07-08

XMLEspresso 4.0 is a full featured, J2SE 1.4.x based XML Editor available for evaluation (unlimited period) and purchase at: http://www.nubean.com/ .

XMLEspresso 4.0 supports creation of W3C XML Schemas and XML documents based on W3C XML Schemas.

XMLFox Advanced XML/XSD editor Russ Sabitov 2005-03-14

XMLFox Advance is an intuitive xml and xml schema (XSD) editor, allows the xml developer to create schemas and show a visual representation of what the xml document will look like for that schema. XMLFox Advance supports Validation an XML against an XSD schema.

You can find more info about the tool at the following website: http://www.XMLFox.com/

XML Infoset Browser

XML Infoset Browser for Java , Ed Merks, 2002-09-18

We are very pleased to announce the availability of org.eclipse.xsd, the XML Schema Infoset Model for Java, at Eclipse: http://www.eclipse.org/xsd/ .

org.eclipse.xsd is a Java reference library that implements the XML Schema Infoset Model as described in the W3C XML Schema specifications. We believe that it will be useful for any code that examines, creates, or modifies XML Schemas (standalone or as part of other artifacts, such as XForms or WSDL documents). The library provides an API for manipulating the components of an XML Schema, as well as an API for manipulating the DOM-accessible representation of XML Schema as a series of XML documents, and for keeping these representations in agreement as schemas are modified.

XML Nanny , Todd Ditchendorf, 2005-12-16

I've developed a free (as in beer) Cocoa XML Schema-related developer tool for Mac OS X 10.4 Tiger called XML Nanny: http://xmlnanny.com .

XML Nanny is a graphical tool for checking XML documents for well- formedness or validity against a DTD or W3C XML Schema. XML Nanny can validate documents either locally or over the network.

XMLObjective

new XMLSchema editor and binding tool Aidan Russell 2005-07-21

The tool provides a powerful XMLSchema editor, with binding classes generation in C++, Java and RDBs. Editing og XML and XSLT is also supported.

The product URL is www.xmlobjective.com A free version is also provided supporting basic XMLSchema editing and validation.

WmHelp XmlPad 3 Semyon A. Chertkov 2006-09-22

I'm glad to announce availability a new freeware version of WmHelp XMLPad. It's now based on the Expat parsing engine and has full support for XML Schemas.

XML Schema editor with color syntax highlighting, line numbers, element range navigation, and context-dependent source assistant wizard. Available absolutely free (freeware) without any limitations. It does not contain any AdWare or SpyWare. http://www.wmhelp.com/download.htm

XML Schema Object Model

Xml Schema Object Model (in the System.Xml.Schema namespace) , Microsoft 2002-06-03

System.Xml.Schema namespace contains the XML classes that provide standards-based support for XML Schemas definition language (XSD) schemas. This namespace is part of the .Net Framework SDK http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true and implements the XML Schema Part 1: Structures <http://www.w3.org/TR/xmlschema-1/> and the XML Schema Part 2: Datatypes <http://www.w3.org/TR/xmlschema-2/> specifications.

XML Schema Validator

Online W3C XML Schema Validator , Microsoft, 2002-10-11

An online HTML form-based interface for validating schemas (XSD & XDR) and instance documents using the System.Xml.XmlValidatingReader in the .NET framework [appears to have been withdrawn as of 2006-12]

XML ValidatorBuddy

XML ValidatorBuddy is commercial software for the Microsoft Windows platform for editing and validating large XML and JSON documents.

XML::Validator::Schema

This Perl module allows you to validate XML documents against a W3C XML Schema. This module does not implement the full W3C XML Schema recommendation, but a useful subset. See the SCHEMA SUPPORT section in the module documention.

You can install XML::Validator::Schema from CPAN, or download it from SourceForge: http://sourceforge.net/project/showfiles.php?group_id=89764

xnsdoc 1.2 - XML Schema documentation generator buldocs 2006-09-19

xnsdoc 1.2 is now available, a professional tool to generate documentation of W3C XML-Schema in a JavaDoc-like visualization.

xnsdoc supports all common schema design practices like chameleon, russian doll, salami slice, venetian blind schemas or circular schema references.

xnsdoc can be used from the command line, as an Apache Ant Task, as an Apache Maven Plugin, as an eclipse plugin or integrated as a custom tool in many XML development tools.

Release 1.2 fixes all known bugs and comes with improved integration into eclipse, Apache Maven and Apache Ant.

You can download a free trial version at http://www.buldocs.com/xnsdoc/download/

XS3p is a schema documentation generator developed by Zar Zar Tun at DSTC. Basically, it is an XSLT stylesheet that will generate an XHTML document from an XSD schema. Some of its cool features are:

  • It provides links that allow the user to jump to the documentation of schema components that are referenced.
  • It provides a view of schema components' constraints as a sample XML instance.
  • For global type definitions, it shows the super- and sub- types of the type definition.
  • For global element declarations, it shows the substitution groups that the element declaration heads or belongs to.
  • It can sort schema components by type and name.
  • It has a glossary section which explains some XML Schema terminology.

DSTC no longer exists, and the original homepage for this tool is gone. Both oXygen and Stylus Studio appear to use it, and search engines can locate copies of the stylesheet and, in some cases, the license without which it cannot legally be used.

XmlPlus xsd2cpp is an open-source tool which provides XML data binding for C++ through XML Schema. The xsd2cpp tool is a C++ code generator. The xsd2cpp tool when invoked on an input XML Schema, generates C++ classes(headers) mapped to the input XML Schema components. Alongside, wherever needed, it generates implementation files(.cpp) for the generated C++ classes. Also, a sample application(main.cpp) is generated to demonstrate how an application could consume the generated C++ source files.

XSDBench XML Schema Benchmark

XSDBench XML Schema Benchmark 1.0.0 released Boris Kolpackov 2006-10-18

XSDBench is an open-source W3C XML Schema benchmark that compares the performance of validating XML parsers. It measures validation throughput, statically-linked test executable size, and, where possible, peak heap and stack memory usage during parsing. The following parsers are supported in the latest release:

  • Apache Xerces-C++
  • CodeSynthesis XSD
  • Gnome Libxml2
  • Microsoft XML Core Services (MSXML)

More information on the benchmark architecture, results, as well as the benchmark source code are available from http://www.codesynthesis.com/projects/xsdbench

XSD Inference Tool

XSD from examples , Microsoft, 2002-12-14

We would like to announce the availabitlity of Microsoft XSD Inference Beta 1 tool. The Microsoft XSD Inference utility is used to create an XML Schema definition language (XSD) schema from an XML instance document. When provided with wellformed XML file, the utility generates an XSD that can be used to validate that XML file. You can also refine the XSD generated by providing the tool more well-formed XML files. You can get the binaries and documentation from http://www.gotdotnet.com/team/xmltools/

XSD/e 1.1.0 - validating XML parser generator for embedded systems Boris Kolpackov 2007-09-20

CodeSynthesis XSD/e is an open-source XML parser generator for mobile and embedded systems. It provides event-driven, stream-oriented XML parsing, XML Schema validation, and C++ data binding while maintaining small footprint and portability.

Compared to general-purpose validating XML parsers, the XSD/e-generated parsers are 2-10 times faster while maintaining the lowest static and dynamic memory footprints. For example, a validating parser executable can be as small as 120KB in size. XSD/e is also highly-portable and can be used without STL, RTTI, iostream, C++ exceptions, and C++ templates.

xframe - xsddoc 0.8-beta released , Kurt Riede, 2005-05-22.

xsddoc is an Open Source documentation tool for W3C XML Schema based on XSLT. With xsddoc you can generate documentation of your XML Schema in a JavaDoc like visualisation. xsddoc can be used from the command line, as an Apache Ant Task or as an Apache Maven Plugin or integrated as a custom tool in StylusStudio or XMLWriter\ .

You can download xsddoc http://xframe.sourceforge.net/xsddoc/index.html

XML Schema Documentation software , Thomas Chen, 2003-10-15

XSDdoc is an XML Schema documentation software that transforms plain XML files into cross-referenced, hyperlinked HTML documents and provides a detailed functional report for each schema component. XSDdoc makes it effortless to navigate through a large collection of XML vocabulary.

For a detailed product guide of XSDdoc 2.0, please visit our web site at http://www.bluetetra.com/ .

XSD regex-> Java 1.4 regex , James Clark 2002-04-30

I've written some Java code that translates from the syntax of XSD regexes to the syntax of JDK 1.4 java.util.regex regexes. The source, binaries and documentation can be downloaded from: [ http://www.thaiopensource.com/download/xsdregex-20020430.zip ]

I am releasing it under a very liberal license (the BSD license), which makes it free even for commercial use.

xsd - a W3C XML Schema to C++ translator Boris Kolpackov 2005-10-08

xsd is a cross-platform, open source W3C XML Schema to C++ translator. It supports two C++ mappings: in-memory C++/Tree and event-driven C++/Parser.

The C++/Tree mapping consists of data types that represent the given vocabulary, a set of parsing functions that convert XML instance documents to a tree-like in-memory data structure, and a set of serialization functions that convert the in-memory representation back to XML.

The C++/Parser mapping provides parser templates for data types defined in XML Schema. Using these parser templates you can build your own in-memory representations or perform immediate processing of XML instance documents.

Details and download from http://codesynthesis.com/products/xsd/

The xsdvalid distribution contains the XML Schema validation engine that will be integrated into the future XMLmind XML Editor product ( http://www.xmlmind.com/xmleditor/ ).

This engine has been made available to schema and DTD authors in the form of 3 command-line tools:

  • xsdvalid: Checks an XML schema for validity. Checks an XML document for validity against an XML schema.
  • dtdvalid: Checks a DTD for validity. Checks an XML document for validity against a DTD.
  • dtdtoxsd: Converts a DTD to an XML schema.

The xsdvalid distribution can be downloaded from [ http://www.xmlmind.com/xvalid.html ] .

XSU, an Open Source upgrade transform from the 20001024 to the 20010330 version; free web-form access , from University of Edinburgh/W3C (beta);

XSV, an Open Source XML Schema Validator, with web-form access from University of Edinburgh/W3C (beta) ( Status page )

  • Free download of self-installing version of XSV for WIN32.

Tools below here are for the previous, 20001024, version of XML Schema

  • Evaluation version (30 day free use) of commercial XML Schema (and others) aware editor/validator from XML Spy
  • Free Web-form access to XSV, an XML Schema Validator from University of Edinburgh/W3C (beta);
  • Free, downloadable XML Schema validator from Oracle, C, C++ and Java versions.

Tools below here are for the previous, 20000407, version of XML Schema

  • Free Web-form access to previous (2000407 version of XML Schema) XSV, an XML Schema Validator from University of Edinburgh/W3C (alpha);
  • A Conversion tool from DTD to XML Schema in perl; open source.
  • Free, downloadable XML Schema validator from the Apache project;
  • Online validation/conversion , requires registration, from TIBCO Extensibility;
  • LOGML (Log Markup Language) Draft Specification and Schema John Punin Jun 29 2001
  • feature.xsd defines an XML encoding for the OGC/ISO TC211 "Feature" model for geospatial data,
  • geometry.xsd defines geometry elements <include>d into feature.xsd
  • xlinks.xsd is a schema for XLinks (actually a placeholder until a definitive version is provided by W3C) and is also used by feature.xsd
  • XGMML (eXtensible Graph Markup and Modeling Language) 15 Mar 2000 John Punin, Mukkai Krishnamoorthy, Dept of Computer Science RPI ( update 25 Jun 2001 )
  • Experimental schema for XSLT 1.0 , by Asir Vedamuthu of webMethods, Inc. "This schema is subject to change and will contain the schema using the current syntax, Proposed Recommendation (PR) or Recommendation XML Schema Definition Language (XSDL). We plan to update this schema using PR XSDL ASAP."
  • An XML Schema for the XML Specification doctype by Norm Walsh, 12 October 2000.
  • Several dozen examples in Roger L. Costello's XML Schema Tutorial
  • XML Digital Signatures : schema in the 10 May 2000 draft
  • AbiWord : schema update Oct 27 2000
  • ... some XML Schema hacking March 2000 by Dan Connolly

( revision by Connolly)

  • ... If you have a schema you would like to see listed here, or if you have a set of test cases for use in software development, please send an announcement to xmlschema-dev . (If you are impatient, you may also wish to send mail to Michael Sperberg-McQueen calling his attention to your email on xmlschema-dev and suggesting your materials be added to this list.)

Presentations, guides, and tutorial materials

In addition XML Schema Part 0: Primer , you may be interested in:

  • A Guide to Versioning XML Languages using XML Schema 1.1 , ed. David Orchard.
  • XML Schema Tutorial , by Roger L. Costello, September 2001
  • The XML Schema Specification in Context by Rick Jelliffe, Academia Sinica Computing Centre 2001-01-10 compares XML Schema with XML DTDs, SGML DTDs, HyTime, and perl regular expressions
  • *--> The Current State of the Art of Schema Languages for XML , Rick Jelliffe, paper, XML Asia Pacific 2001, Sydney, Australia. A characterization and comments on schema languages for XML at the end of 2001
  • Course "Programming XML in Java" Web site by John Punin, Autumn, 2001
  • XML Schema, a brief introduction , by Ian Stuart, October 26, 2001
  • XML Schema tutorials materials: slides , additional materials by Henry Thompson at XML 99 in Philadelphia (a GCA Conference )
  • Using W3C XML Schema by Eric van der Vlist, October 17, 2001
  • Schemas for XML by Norman Walsh, July 1, 1999
  • Kal Ahmed has created topic maps from the XML Schema family of specifications. The HTML-ized result is now up at http://www.techquila.com/topicmaps/xmlschema/
  • Danny Vint has created quick reference cards, available at http://www.xml.dvint.com/ .

Schema for schemas

If you're looking for the schema and/or DTD for schema documents, they are here:

  • Schema document for schema documents
  • DTD for schema documents (driver file; includes also datatypes.dtd )
  • RDDL document for the namespace http://www.w3.org/2001/XMLSchema

Test collection

The W3C XML Schema test collection can be downloaded from https://github.com/w3c/xsdtests

Note that there is no longer an XML Schema Working Group to monitor issues or pull requests.

  • Test suite overview page
  • Test suite FAQ
  • Test suite framework
  • Test suite maintenance process
  • Download revised original test collection (6.73 MB)
  • Download 2nd edition test collection (2.76 MB)

As part of the process of getting XML Schema to Recommendation, a draft Type Library is available, with definitions of complex types attempting to cover many common needs, including general text content, arrays, complex numbers and dimensioned quantities.

Serialization of the PSVI

Richard Tobin and Henry S. Thompson have posted a first cut at an XML serialisation of the (PSV) Infoset .

The W3C has launched a Test Collection Initiative to help XML Schema processor implementors.

Specifications and Development

XML Schema Part 0: Primer

XML Schema Part 0: Primer is a non-normative document intended to provide an easily readable description of the XML Schema facilities, and is oriented towards quickly understanding how to create schemas using the XML Schema language. XML Schema Part 1: Structures and XML Schema Part 2: Datatypes provide the complete normative description of the XML Schema language. This primer describes the language features through numerous examples which are complemented by extensive references to the normative texts.

XML Schema Part 1: Structures

XML Schema Part 2: Datatypes

XML Schema: Component Designators

Proposed mechanisms for referring to individual components from an XML Schema.

Guide to Versioning XML Languages using XML Schema 1.1

Discusses issues in defining languages so as to be robust in the face of changes, and gives examples of useful constructs in XML Schema 1.1.

Processing XML 1.1 documents with XML Schema 1.0 processors

May 2005: Working Group Note

Feb 1999: W3C Note:

XML Schema Requirements

List of versioning-related resources

working group: XML Schema

feedback: www-xml-schema-comments

discussion: [email protected] , [email protected] , comp.text.xml

Last Call comments and their disposition: HTML version ; XML version (with stylesheet for IE5)

Developments in the community

The W3C workshop on XML Schema user experiences gathered concrete reports of user experience with XML Schema 1.0, and examined the full range of usability, implementation, and interoperability problems around the specification and its test suite.

The Call for Participation and program have many of the details.

Minutes and a chairs' report are expected to be made public real soon now.

Submissions

Input into the development of XML Schema:

  • Jan 2000: Datatypes for DTDs (DT4DTD) 1.0
  • Sep '98 : Schema for Object-oriented XML submitted to W3C
  • Jan '99: Document Definition Markup Language (DDML) Specification, Version 1.0 submitted to W3C
  • Jan 1998 : XML Data submitted to W3C

Copyright © 2000-2007 W3C ® ( MIT , ERCIM , Keio ), All Rights Reserved. W3C liability , trademark , document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.

IntelliJ IDEA 2024.1 Help

Referencing xml schemas and dtds.

Your XML file may reference an external XML schema (XSD) or DTD file, for example:

If the referenced URL or the namespace URI is not recognized, it's marked as an error. To solve the problem:

Place the caret at the referenced URL and press Alt+Enter .

Referencing an unfamiliar URL

From the list of suggested options, select one of the following:

Fetch external resource . IntelliJ IDEA downloads the referenced file and associates it with the URL (or the namespace URI). The error highlighting disappears. The XML file is validated according to the downloaded schema or DTD. (The associations of the URLs and the namespace URIs with the schema and DTD files are shown on the Schemas and DTDs page in the Settings dialog.)

Manually set up external resource . Use this option when you already have an appropriate schema or DTD file available locally. The Map External Resource dialog will open, and you'll be able to select the file for the specified URL or namespace URI (for example, http://www.example.org/xsds/example.xsd or http://www.example.org ). The result of the operation is the same as in the case of fetching the resource.

Ignore external resource . The URL or the namespace URI is added to the list of Ignored Schemas and DTDs. (This list is shown on the Schemas and DTDs page in the Settings dialog.) The error highlighting disappears. IntelliJ IDEA won't validate the XML file, however, it will check if the XML file is well-formed.

Add Xsi Schema Location for External Resource . This intention action lets you complete your root XML elements. If the namespace is already specified, IntelliJ IDEA can add a couple of missing attributes.

For example, if you have a fragment like this:

and you invoke the Add Xsi Schema Location for External Resource intention action on the value of the xmlns attribute, the result will be:

At this step, you can add the schema URL, and then map the URL (or the namespace URI) onto an appropriate schema file, or add the URL (or the URI) to the list of Ignored Schemas and DTDs.

how to reference xml schema in xml file

Import XML data

If you previously created an XML Map , you can use it to import XML data into cells that are mapped, but there also are several methods and commands for importing XML data without an XML Map.

If you have an XML Map, do this to import XML data into mapped cells:

In the XML Map, select one of the mapped cells.

Click Developer > Import .

If you don't see the Developer tab, see Show the Developer tab .

In the Import XML dialog box, locate and select the XML data file (.xml) you want to import, and click Import .

Other ways to import XML data

Import an xml data file as an xml table, import multiple xml data files, import multiple xml data files as external data, open an xml data file to import its data.

For more information about issues, see Common issues with importing XML data at the end of this article.

If the XML data file doesn't refer to a schema, Excel infers the schema from the XML data file.

In the Import Data dialog box, do one of the following:

Select XML table in existing worksheet to import the contents of the XML data file into an XML table in your worksheet at the specified cell location.

Select XML table in new worksheet to import the contents of the file into an XML table in a new worksheet starting at cell A1. The schema of the XML data file is displayed in the XML Source task pane.

If the XML data file doesn't refer to a schema, then Excel infers the schema from the XML data file.

To control the behavior of XML data (such as data binding, format, and layout), click Properties , which displays the XML Map properties dialog box. For example, existing data in a mapped range will be overwritten when you import data by default, but you can change this.

Select a mapped cell to import multiple XML files into a single set of mapped cells.

If you want to import multiple XML files into multiple sets of mapped cells, click a cell anywhere on the worksheet that isn't mapped.

In the Import XML dialog box, locate and select the XML data file (.xml) you want to import.

If the files are contiguous, press Shift, and click the first and the last file in the list. All of the data from the XML files will be imported and appended to the mapped cells.

If the files aren't contiguous, press and hold Ctrl, and click each file you want to import in the list.

Click Import .

If you selected files that aren't contiguous, the Importing <filename>.xml dialog box appears. Select the XML Map that corresponds to the XML data file you're importing for each file.

To use a single map for all of the selected files that aren't yet imported, select Use this XML Map for all selected files of this schema .

To import multiple XML files that use the same namespace but different XML schemas, you can use the From XML Data Import command. Excel creates a unique XML Map for each XML data file you import.

Note:  If you're importing multiple XML files that don't define a namespace, these XML files are treated as if they use the same namespace.

If you're using Excel with a Microsoft 365 subscription, click Data > Get Data > From File > From XML .

If you're using Excel 2016 or earlier, click Data > From Other Sources > From XML Data Import .

Go to the drive, folder, or Internet location that has the XML data file (.xml) you want to import.

Select the file and click Open .

XML table in existing worksheet     The contents of the file are imported into a new XML table in a new worksheet. If the XML data file doesn't refer to a schema, Excel infers the schema from the XML data file.

Existing worksheet     The XML data is imported in a two-dimensional table with rows and columns that shows XML tags as column headings, and data in rows below the column headings. The first element (the root node) is used like a title and is displayed in the specified cell location. The rest of the tags are sorted alphabetically across the second row. In this case, Excel doesn't infer a schema, and you can't use an XML Map.

New worksheet     Excel adds a new worksheet to your workbook and automatically puts the XML data in the upper-left corner of the new worksheet. If the XML data file doesn't refer to a schema, Excel infers the schema from the XML data file.

To control the behavior of XML data, such as data binding, format, and layout, click Properties , which displays the XML Map properties dialog box. For example, existing data in a mapped range is overwritten when you import data by default, but you can change this.

Click File > Open .

In the Open dialog box, click the drive, folder, or Internet location that has the file that you want to open.  

If the Import XML dialog box appears, the file you opened refers to one or more Extensible Stylesheet Language Transformation (XSLT) style sheets, so you can click one of the following options:

Open the file without applying a style sheet     The XML data is imported in a two-dimensional table with rows and columns that shows XML tags as column headings, and data in rows below the column headings. The first element (the root node) is used like a title and is displayed in the specified cell location. The rest of the tags are sorted alphabetically across the second row. In this case, Excel doesn't infer a schema, and you can't use an XML Map.

Open the file with the following style sheet applied (select one)     Select the style sheet that you want to apply, and then click OK . The XML data is formatted according to the style sheet that you selected.

Note:  The XML data is opened as read-only in Excel so that you don't accidentally save your original source file in the Excel Macro-Enabled Workbook file format (.xlsm). In this case, Excel doesn't infer a schema, and you can't use an XML Map.

If the Open XML dialog box appears, the XML file doesn't have any XSLT style sheet references. To open the file, click one of the following options:

Click As an XML table to create an XML table in a new workbook.

The contents of the file are imported into the XML table. If the XML data file doesn't refer to a schema, Excel infers the schema from the XML data file.

Click As a read-only workbook .

The XML data is imported in a two-dimensional table with rows and columns that shows XML tags as column headings, and data in rows below the column headings. The first element (the root node) is used like a title and is displayed in the specified cell location. The rest of the tags are sorted alphabetically across the second row. In this case, Excel doesn't infer a schema, and you can't use an XML Map.

The XML data is opened as read-only in Excel so that you don't accidentally save your original source file in the Excel Macro-Enabled Workbook file format (.xlsm). In this case, Excel doesn't infer a schema, and you can't use an XML Map.

Click Use the XML Source task pane .

The schema of the XML data file is displayed in the XML Source task pane. You can then drag elements of the schema to the worksheet to map those elements to the worksheet.

Common issues with importing XML data

Excel displays the XML Import Error dialog box when it can't validate data according to the XML Map. In this dialog box, click Details for additional information about each error. The following table lists some common import errors:

The specified XML file doesn't refer to a schema

The XML file you're trying to open doesn't refer to an XML schema. To work with the XML data that's in the file, Excel needs a schema based on the contents of the XML file. If that schema is incorrect or insufficient, remove it from your workbook. Then create an XML schema file and edit the XML data file so that the XML data file refers to the schema. For more information, see Map XML elements to cells in an XML Map .

Note:  You can't export the Excel inferred schema as a separate XML schema data file (.xsd). Although there are XML schema editors and other methods for creating an XML schema file, you may not have convenient access to them or know how to use them.

Follow these steps to remove the schema that Excel created from your workbook:

Click Developer > Source .

XML commands on the Developer tab

In the XML Source task pane, click XML Maps .

In the XML Maps dialog box, click the XML Map Excel created, and click Delete .

Importing multiple XML files that use the same namespace but different schemas doesn't work as expected

When you work with multiple XML data files and XML schemas, you typically create an XML Map for each schema, map the elements you want, and then import each XML data file to the appropriate XML Map. Using the Import command to open multiple XML files with the same namespace, you can only use one XML schema. When you use this command to open multiple XML files that use the same namespace but different schemas, you can get unexpected results. For example, data may get overwritten, or the files won't open.

To import multiple XML files that use the same namespace but different XML schemas, try use the From XML Data Import command (click Data > From Other Sources ). This command allows multiple XML files with the same namespace to use multiple XML schemas. Excel creates a unique XML Map for each XML data file you want to import.

Show the Developer tab

If you don't see the Developer tab, do the following to display it:

In Excel 2013 and Excel 2010:

Click File > Options .

Click the Customize Ribbon category.

Under Main Tabs , check the Developer box, and click OK .

In Excel 2007:

Click the Popular category.

Under Top options for working with Excel , check the Show Developer tab in the Ribbon box, and click OK .

Over view of XML in Excel

Map XML elements to cells in an XML Map

Export XML data

Facebook

Need more help?

Want more options.

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

how to reference xml schema in xml file

Microsoft 365 subscription benefits

how to reference xml schema in xml file

Microsoft 365 training

how to reference xml schema in xml file

Microsoft security

how to reference xml schema in xml file

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

how to reference xml schema in xml file

Ask the Microsoft Community

how to reference xml schema in xml file

Microsoft Tech Community

how to reference xml schema in xml file

Windows Insiders

Microsoft 365 Insiders

Was this information helpful?

Thank you for your feedback.

XML Tutorial

Xpath tutorial, xslt tutorial, xquery tutorial, xsd data types, web services.

XML stands for eXtensible Markup Language.

XML was designed to store and transport data.

XML was designed to be both human- and machine-readable.

XML Example 1

Display the XML File » Display the XML File as a Note »

XML Example 2

Display the XML File » Display with XSLT »

Advertisement

Why Study XML?

XML plays an important role in many different IT systems.

XML is often used for distributing data over the Internet.

It is important (for all types of software developers!) to have a good understanding of XML.

What You Will Learn

This tutorial will give you a solid understanding of:

  • What is XML?
  • How does XML work?
  • How can I use XML?
  • What can I use XML for?

Important XML Standards

This tutorial will also dig deep into the following important XML standards:

  • XML Services

We recommend reading this tutorial, in the sequence listed in the left menu.

Learn by Examples

Examples are better than 1000 words. Examples are often easier to understand than text explanations.

This tutorial supplements all explanations with clarifying "Try it Yourself" examples.

  • XML Examples
  • AJAX Examples
  • DOM Examples
  • XPath Examples
  • XSLT Examples

XML Quiz Test

Test your XML skills at W3Schools!

My Learning

Track your progress with the free "My Learning" program here at W3Schools.

Log in to your account, and start earning points!

This is an optional feature. You can study at W3Schools without using My Learning.

how to reference xml schema in xml file

Kickstart your career

Get certified by completing the course

Get Certified

COLOR PICKER

colorpicker

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]

Top Tutorials

Top references, top examples, get certified.

  • XML Interface Changes Guide

Release 22B Schema Change History

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Create an XML schema from an XML document

  • 11 contributors

The XML editor lets you create an XML Schema definition language (XSD) schema from an XML document. The XML file determines how the schema is generated in the following manner:

If the XML document has no schema or Document Type Definition (DTD) associated with it, the data in the XML document is used to infer a new XML Schema.

If the XML document contains an associated DTD, the external DTD and internal subset are converted to a corresponding XML Schema.

If the XML document contains an inline XML-Data Reduced (XDR) schema, the XDR schema is converted to a corresponding XML Schema.

The schemas that are created are then used to provide IntelliSense for the XML file.

For more information about the schema inference engine, see Infer an XML schema .

To create an XML schema

Open an XML file in Visual Studio.

On the menu bar, choose XML > Create Schema .

An XML Schema document is created and opened for each namespace found in the XML file. Each schema is opened as a temporary miscellaneous file. The schemas can be saved to disk, added to your project, or discarded.

Related content

Was this page helpful?

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

IMAGES

  1. how to reference xml schema

    how to reference xml schema in xml file

  2. how to reference xml schema

    how to reference xml schema in xml file

  3. XML Schema Files

    how to reference xml schema in xml file

  4. XML Schema tutorial

    how to reference xml schema in xml file

  5. XML Schema Tutorial

    how to reference xml schema in xml file

  6. XML Schema Validation Example

    how to reference xml schema in xml file

VIDEO

  1. Group Reference

  2. Что такое XML? Для чего используют DTD и Schema?

  3. 6- XML Schema

  4. XML CONVERSION

  5. XML CONVERSION

  6. XML Schema Part 1

COMMENTS

  1. xml : how to reference a .xsd file at .xml file?

    @DavidDoria: By specifying of the XML Schema of <employee> we set schema for all it's children (for example <firstname> or <lastname>).Typically one set xmlns and schemaLocation for the root element of the XML file only. The example in my answer is very short. Typically one would have <employees> for example as root element with many <employee> children. In the way one would define one schema ...

  2. How to reference a local XML Schema file correctly?

    Add one more slash after file:// in the value of xsi:schemaLocation. (You have two; you need three. Think protocol://host/path where protocol is 'file' and host is empty here, yielding three slashes in a row.) You can also eliminate the double slashes along the path.

  3. XML Schema Tutorial

    You can manipulate your Schema with the XML DOM. You can transform your Schema with XSLT. XML Schemas are extensible, because they are written in XML. With an extensible Schema definition you can: Reuse your Schema in other Schemas. Create your own data types derived from the standard types. Reference multiple schemas in the same document.

  4. XML Grammars

    Referencing an XML Schema. A XML Schema can be referenced from an XML document by defining the schemaLocation and noNamespaceSchemaLocation attributes. The 'schemaLocation' attribute is used to reference XML Schema(s) that are defined in a target-namespace.

  5. XML Schema Tutorial

    An XML schema, commonly known as an XML Schema Definition (XSD), formally describes what a given XML document can contain, in the same way that a database schema describes the data that can be contained in a database (i.e. table structure, data types, constraints etc.). The XML schema defines the shape, or structure, of an XML document, along ...

  6. The XML Files: A Quick Guide to XML Schema

    The XML Schema model is more like a programming language where you bind variables to formal type definitions. The xsd:complexType allows you to define the type of an element, which conveys its structure. Nesting xsd:complexType within the element declaration effectively binds it to that element (like a variable).

  7. Referencing XSD Schemas in Documents

    Reference the XSD schema in the XML document using XML schema instance attributes such as either xsi:schemaLocation or xsi:noNamespaceSchemaLocation. Add the XSD schema file to a schema cache and then connect that cache to the DOM document or SAX reader, prior to loading or parsing the XML document. The following sections demonstrate each of ...

  8. W3C XML Schema

    XML Schema 1.1Status. XML Schema 1.1 (in two parts) is a W3C Recommendation. It is intended to be mostly compatible with XML Schema 1.0 and to have approximately the same scope, but also to fix bugs and make whatever improvements we can, consistent with the constraints on scope and compatibility.

  9. XML Schema How To

    The following example is a DTD file called "note.dtd" that defines the elements of the XML document above ("note.xml"): The first line defines the note element to have four child elements: "to, from, heading, body". Line 2-5 defines the to, from, heading, body elements to be of type "#PCDATA".

  10. Working with XML Schemas

    In This Section. Discusses the Schema Object Model (SOM) in the System.Xml.Schema namespace that provides a set of classes that allows you to read a Schema definition language (XSD) schema from a file or programmatically create a schema in-memory. Discusses the XmlSchemaSet class that is a cache where XSD schemas can be stored and validated.

  11. XML Schema Example

    Now we want to create a schema for the XML document above. We start by opening a new file that we will call "shiporder.xsd". To create the schema we could simply follow the structure in the XML document and define each element as we find it. We will start with the standard XML declaration followed by the xs:schema element that defines a schema:

  12. 40. XML Schema-based configuration

    The central motivation for moving to XML Schema based configuration files was to make Spring XML configuration easier. The 'classic' <bean/>-based approach is good, but its generic-nature comes with a price in terms of configuration overhead.. From the Spring IoC containers point-of-view, everything is a bean. That's great news for the Spring IoC container, because if everything is a bean ...

  13. Referencing XML schemas and DTDs

    The XML file is validated according to the downloaded schema or DTD. (The associations of the URLs and the namespace URIs with the schema and DTD files are shown on the Schemas and DTDs page in the Settings dialog.) Manually set up external resource. Use this option when you already have an appropriate schema or DTD file available locally.

  14. XML schema Element

    Learn how to use the <schema> element in XML Schema Definition (XSD) to define the structure and constraints of an XML document. The <schema> element is the root element of every XSD file and contains other elements and attributes. W3Schools provides examples and tutorials on XML Schema and other XML topics.

  15. Import XML data

    If you have an XML Map, do this to import XML data into mapped cells: In the XML Map, select one of the mapped cells. Click Developer > Import. If you don't see the Developer tab, see Show the Developer tab. In the Import XML dialog box, locate and select the XML data file (.xml) you want to import, and click Import.

  16. XML Tutorial

    References. Explore our selection of references covering all popular coding languages. ... XML Namespaces XML Display XML HttpRequest XML Parser XML DOM XML XPath XML XSLT XML XQuery XML XLink XML Validator XML DTD XML Schema XML Server XML Examples XML Quiz XML Certificate ... Display the XML File ...

  17. How to use Schema that is on local machine in XML document

    I have limited knowledge of XML/Schema files. So this should be a fairly simple question. How do you specify a local file for the schemaLocation? ... How to reference local XSD from XML file? 2. XML validation failing in java with schemaLocation a local file. 0. XML Schema is not validating. 1.

  18. Reading and Writing XML Schemas

    The XmlSchema class provides the Read and Write methods to read and write XML schemas. The Read method returns an XmlSchema object representing the XML schema and takes an optional ValidationEventHandler as a parameter to handle schema validation warnings and errors encountered while reading an XML schema. The Write method writes XML schemas to ...

  19. Understanding XML, Its Elements, and Benefits

    Data embedded within XML files are referred to as XML content. For example, <brother> <name>Donald</name> <name>Brenden</name> </brother> Here, the values Donald and Brendon are described as XML content. 6. XML schema. XML schema sets boundaries to the XML file structure. It expresses rules and constraints that need to be obeyed by the XML ...

  20. How to control references between elements in XML

    Apr 20, 2015 at 7:25. 1. With one key you would go back to the limitations of ID/IDREF; you've asked for "an element "Truck" should not refer to a trailer!! Should be able to refer only to truck1 ", etc.; therefore, you need to distinguish the IDs and their references, hence the pairs of PK/FK.

  21. Release 22B Schema Change History

    XML Interface Changes Guide; Release 22B Schema Change History; Release 22B Schema Change History. Changes to GTM.xsd. Reference Description; 33722728: Add AlternateDesignator for GtmStructure ...

  22. Create an XML Schema with the XML editor

    To create an XML schema. Open an XML file in Visual Studio. On the menu bar, choose XML > Create Schema. An XML Schema document is created and opened for each namespace found in the XML file. Each schema is opened as a temporary miscellaneous file. The schemas can be saved to disk, added to your project, or discarded.

  23. How to refer to two schemas from a single XML file

    In an XML document, you cannot hint that a single XML document instance must simultaneously adhere to multiple XSDs (other than for separate namespaces). You could, however, validate sequentially once per XSD you wish to apply to the XML.