Le programmeur XML (pp. 78,79):
couple XML et Java idéal car pensée multiplateforme
parseur pour vérification bien formé et validé
PB: pas de doc papier sur XML Schema, trop récent!
Impression de la recommandation proposée:
http://www.w3.org/TR/xmlschema-0/
http://www.ucc.ie/xml/#SCHEMATA
C.13 I keep hearing about alternatives to DTDs. What's
a schema?
¶ A DTD is for specifying the structure of an XML file: it gives
the names of the elements, attributes, and entities that can be used, and
how they fit
together. Because DTDs are designed for use with text, they have no
mechanism for defining the content of elements in terms of data types,
because
XML has no data types: text is just text. A DTD therefore cannot be
used to specify numeric ranges or to define limitations or checks on the
text
content, only on the markup.
¶ The XML Schema proposal provides a means of specifying element
content in terms of data types, so that document type designers can provide
criteria for validating the content of elements as well as the markup
itself. Schemas are written as XML files, thus avoiding the need for processing
software to be able to read XML Declaration Syntax, which is different
from XML Instance Syntax.
¶ Although Schemas are not yet a formal Recommendation, a number
of sites are starting to serve useful applications as both DTDs and Schemas,
eg
http://www.schema.net and http://www.dtd.com. The term `vocabulary'
is sometimes used to refer to `DTDs and Schemas' together: the use of the
Greek plural schemata is unnecessary didacticism.
Bob DuCharme adds: `Many XML developers are dissatisfied with the syntax
of the markup declarations described in the XML spec for two reasons.
First, they feel that if XML documents are so good at describing structured
information, then the description of a document type's structure (its
`schema') should be in an XML document instead of written with its
own special syntax. In addition to being more consistent, this would make
it
easier to edit and manipulate the schema with regular document manipulation
tools. Secondly, they feel that traditional DTD notation doesn't allow
schema designers the power to impose enough constraints on the data
-- for example, the ability to say that a certain element type must always
have
a positive integer value, that it may not be empty, or that it must
be one of a list of possible choices. This would ease the development of
software
using that data because the developer would have less error-checking
code to write.'
http://site.voila.fr/xmlschema/xschema.htm
Résumé :
XML fût pressenti dès son arrivée comme une technologie
qui allait révolutionner l'échange de données. Cependant,
les DTD, le langage de schéma
actuel pour spécifier le contenu et la structure de documents
XML, souffrent de quelques déficiences.
Tout d'abord, les DTD ne sont pas écrites en XML, ce qui signifie
que les technologies existantes pour manipuler des documents XML telles
que DOM ou SAX ne
peuvent être utilisées pour « parser » des
schémas de documents. Ensuite, les DTD ne supportent pas les espaces
de nom ce qui rend impossible l'import de
schémas externes afin de réutiliser du code existant.
Enfin, et surtout, les DTD n'offrent qu'un typage très limité
des données.
Conscient de ces fâcheuses limitations, le W3C a récemment
proposé un nouveau langage de définition de schéma,
XML Schema.
Conçu pour palier aux déficiences pré-citées
des DTD, XML Schema propose, en plus des fonctionnalités fournies
par les DTD, des nouveautés :
Oracle XML parser with XMLSchema processor :
[barkati@ceres sample]$ java XSDSample report.xml
Parsing report.xml
The input file <report.xml> parsed without errors
[barkati@ceres sample]$ java XSDSample report_e.xml
Parsing report_e.xml
<Line 29, Column 1>: XSD-2105: (Error) Identity constraint validation
error: 'duplicate keys'.
Parser Exception: Identity constraint validation error: 'duplicate
keys'.
xerces : parser C++
A Conversion Tool from DTD to XML Schema:
http://www.w3.org/2000/04/schema_hack/
[barkati@ceres XML]$ perl dtd2xsd.pl MusiXML.DTD > MusiXML.xsd
open MusiXML.DTD successful
open ISOlat1.pen failed!!
open ISOlat2.pen failed!!
Truncating 0 3 localtext localText ? 20 20
[barkati@ceres sample]$ java XSDSample MusiXML.xsd
Parsing MusiXML.xsd
The input file <MusiXML.xsd> parsed without errors
XSL Style Sheet for XML Schemas:
http://msdn.microsoft.com/downloads/toc.asp?PaneName=Contents&tocPath=CC-11-4&ShowPane=true#sel
The xdr-schema style sheet generates documentation
for Microsoft® Internet Explorer 5 compatible XML
schemas.
Impression des fichiers de MusicXML.
http://xml.coverpages.org/
http://xml.coverpages.org/search
http://xml.coverpages.org/xmlMusic.html
http://xml.coverpages.org/musicML-DTD.txt
Objet: [xsl] xsl] XSL and XMLSchema
Date: Fri, 27 Apr 2001 04:21:37
-0700 (PDT)
De: Dan Diebolt
<dandiebolt@yahoo.com>
Répondre-A: xsl-list@lists.mulberrytech.com
A: xsl-list@lists.mulberrytech.com
It has been done. Search for music at
http://xml.coverpages.org/search
and follow the links.
Regards,
Dan
Objet:
Re: [xsl] XSL and XMLSchema
Date:
Fri, 27 Apr 2001 13:51:38 +0100
De:
Francis Norton <francis@redrice.com>
Répondre-A:
xsl-list@lists.mulberrytech.com
A:
xsl-list@lists.mulberrytech.com
Références:
1
Karim Barkati wrote:
>
> I am new to these things, but I'm involved in a project of musical
> representation for the web. I'd like to describe datas with an xmlschema
> and their representation with a style sheet, but I don't know whether
it
> is possible. I know I could use a dtd and a xsl, but xmlschema seems
to
> be more powerful, so here is my question:
> is it possible to apply an xsl to an xmlschema?
Karim,
You can use either an XML Schema or a DTD to specify vality and default
rules for a type of XML document. Since XML Schema is basically a
superset of DTD, you can (if you're careful) write XML Schemas and
DTDs
that define exactly the same type of document. In fact tools like XML
Spy can convert a DTD into the equivalent schema.
Once you've defined your document type you can then write an XSLT
transform to process documents of that type. In other words if
myMusix.xsd is your schema, and defines XML docs with elements like
<music/>, <bar/> and <note/>, then your XSLT can assume that
those
elements will be in its input.
So the design of the stylesheet depends on the document type, but not
on
the choice of DTD or XML Schema for defining that type.
I hope this helps!
Francis.
Objet:
Re: [xsl] xsl] XSL and XMLSchema
Date:
Fri, 27 Apr 2001 06:02:26 -0700 (PDT)
De:
Dan Diebolt <dandiebolt@yahoo.com>
Répondre-A:
xsl-list@lists.mulberrytech.com
A:
xsl-list@lists.mulberrytech.com
Support for XML Schema data types is a goal of
version 2.0 of XPath:
http://www.w3.org/TR/xpath20req
XPath 2.0 has the following specific goals:
Simplify manipulation of XML Schema-typed content
Simplify manipulation of string content
Support related XML standards
Improve ease of use
Improve interoperability
Improve i18n support
Maintain backward compatibility
Enable improved processor efficiency
I would guess this would have to happen before XLST
supported schemas, but I don't know what would stop
you from working with a music XML documents even
if they conformed to XML Schema. XSLT works perfectly
well irrespective of whether or not there is an
underlying DTD or schema for the XML document.
Regards,
Dan
Objet:
Re: [xsl] xsl] XSL and XMLSchema
Date:
Fri, 27 Apr 2001 06:08:07 -0700 (PDT)
De:
Dan Diebolt <dandiebolt@yahoo.com>
Répondre-A:
xsl-list@lists.mulberrytech.com
A:
xsl-list@lists.mulberrytech.com
What do you want to come out of your stylesheet? It dawns on
me that if you want sheetmusic, this might be a real trick.
How would you synthesize all of the graphic elements; SVG?
Are you just looking for an interchange format to exchange
music between people or applications?
Regards,
Dan
Objet:
RE: [xsl] XSL and XMLSchema
Date:
Fri, 27 Apr 2001 11:02:42 +0100
De:
"Michael Kay" <mhkay@iclway.co.uk>
Répondre-A:
xsl-list@lists.mulberrytech.com
A:
<xsl-list@lists.mulberrytech.com>
> is it possible to apply an xsl to an xmlschema?
Yes. An XML Schema is an XML document, so you can use it as input to
an XSLT
transformation.
Mind you, it's not necessarily going to be easy: an XML Schema can be
a
complicated animal. It depends exactly what information from the schema
you
want to extract.
Mike Kay
Software AG