Slashdot Mirror


XML Schema a W3C Recommendation

J1 writes: "The World Wide Web Consortium has officially given its Stamp of Approval to the XML Schema specification. This makes it an official W3C Recommendation. The press release has the details."

31 of 76 comments (clear)

  1. The beauty of XML by doom · · Score: 2

    XML: a standardized framework for creating
    incompatible data formats.

  2. Re:Difference between DTDs and XML schemas? by ghoti · · Score: 2

    Schemas are much more powerful than DTDs. They do not only allow you to specify the structure of the tags in a very flexible way, they also make it possible to do type checking on attributes, make the substructure of a tag dependant on an attribute value, etc.
    So schemas are what DTDs never were: A really useful tool to check your XML, not just some simple sanity checks on the coarse structure ...
    But you really need to read at least the primer (part 3) to appreciate what you can do with Schemas. They are *very* complex.

    --
    EagerEyes.org: Visualization and Visual Communication
  3. bloated arena? by joq · · Score: 2

    <!ATTLIST languages
    another CDATA #IMPLIED
    2learn CDATA #IMPLIED
    e-dtype CDATA #FIXED
    "enough-is-eno ugh"
    a-dtype CDATA #FIXED
    "pubdate date
    binding length">

    After following Schema from its introduction a while back I just briefly looked at it and said "Another HTML Markup Language" and tossed it to the back of my mind. I had worked at a company who built a product exclusively using XML which had been hacked up to make it useful enough for the company, and found most of it lacking for the Unix side of things where programming was concerned, not interactive webpages, strictly lacking as complete portable solution.

    Often I wonder when I hear these news stories about new protocols appearing, just how long will they last, and how much of an impact would they have in reality, ePerl, PHP, etc., and often I hear of one "standard" coming out only to be overshadowed by another one in the making. So not to troll but how many people are actually looking forward to this becoming a standard? Aren't the current available languages enough?

    I guess it depends on what someone wants to do, but in all honesty I feel the market for things are becoming so saturated with so many different variations claiming to be the best thing, yet from what I see many people often use the standard norms available just fine.

    So how exactly is this beneficial to achieve what you already can using the standards? Sometimes the language can be so confusing when your in the midst of nailing "the next best protocol" which was overshadowed just a second ago, and now you have to tweak what you already know to jump on this latest 'technology` all because its been endorsed, or recommended. Maybe its me not being innovative enough to really look at Schema for its face value, but all I see is another language. Not a big deal.

    Please don't flame this, don't think I'm being arrogant, or trollish, just posting an honest thought to see some insightgul replies. Sure I joke here and there, but I would like some enlightenment.


    1. Re:bloated arena? by janpod66 · · Score: 2
      First, for XML itself. What is XML? A standard way to store and describe data in a manner that is readily addressable by virtually any computing platform. [...] What else offers that?

      There are many existing textual representations that are equivalent in power to XML but a lot simpler. The simplest example would be Lisp's textual representation. Lisp's textual representation is a lot easier to define and parse than XML. In fact, any collection of functions and type constructors in a programming language, together with the syntax of that programming language, define such a representation. A Schema corresponds to a type system in such a representation.

      I don't think XML has been very well thought out. It's a standard for data representation, but it's based, through historical accident, on a standard for text markup, and that causes all sorts of problems. Still, despite its failings and shortcomings, at least XML gets the industry away from junk like OLE structured storage, Bento, or ad-hoc binary formats. For that, I'm willing to live with XML's messy syntax and semantics.

    2. Re:bloated arena? by SnakeStu · · Score: 5
      I can answer that from the perspective of someone who is looking forward to XML Schema acceptance on a large scale. But first I'm wondering if you're addressing XML in general, or just the Schema specification, because my answer depends on what you're not seeing the sense of. Thus, I'll answer both, as briefly as I can.

      First, for XML itself. What is XML? A standard way to store and describe data in a manner that is readily addressable by virtually any computing platform. I could write Vic20 programs that handle XML (to a limited degree, 4K ain't much to work with). What else offers that? Let's examine a couple alternative data formats that, while not a comprehensive sample, illustrate the problem with non-XML formats. First, a comma-delimited format is pretty well standardized and can be addressed on virtually any computing platform -- but the data is not described. A database in Visual FoxPro provides column names that describe the data -- but it's not readily addressable on a wide variety of platforms (at least not directly). Thus, XML provides the data and the description, even including the relationship among data (i.e., the 'name' is a component of the 'customer').

      So what's the Schema big deal? Well, with XML alone, you can't give someone a data format to follow which provides type checking, length restrictions, etc. If you're trading data with someone, you not only want to know the names and relationships of the data fields, and the data itself, you also want to know how the data will be formed. Is it an integer? Is it a 20 character field? You could presumably build a proprietary extension to XML that would allow you to describe those constraints, but why go through that trouble to get an end result that works only for you, when you can take a pre-built language for describing those constraints which works for everyone?

      If you want to just store your own data, and you're certain that you'll never change your software, then XML doesn't offer much. It's not the most compact format. But if you exchange data with others, and/or if you are likely to change your data management software, XML becomes a valuable tool, and the Schema spec strengthens it considerably.

      (Caveat: I'm relatively new to XML and am definitely in learning mode. The above describes the benefits I see from the viewpoint of someone who has several very messy data exchanges to clean up.)

  4. Re:Difference between DTDs and XML schemas? by Y-Leen · · Score: 2
    I could be wrong this declares DTD's to be part of XML now.

    A DTD defines what is allowable in an XML document. XML schema is just a different way to do this. DTD's have always been available to describe XML documents.

    An XML document is well-formed if it adheres to the XML syntax specification; it is valid if it adheres to a DTD. XML documents do not have to be valid - i.e. do not required to have a DTD.

  5. Not suprising by Y-Leen · · Score: 2

    This doesn't come as a great suprise. In the release, Tim Berners Lee is the W3C director that gets quoted saying how great XML schema is. Since his new fangled Semantic Web relies on the mainstream acceptance of XML schema what else is he going to say?

  6. Re:Difference between DTDs and XML schemas? by Y-Leen · · Score: 2

    I think he meant that XML, XMLSchema and XSL are all XML format so you can use a single XML parser with them. DTD and CSS files are not XML.

  7. Re:So now... by frankie · · Score: 2
    Microsoft will create a proprietary version

    All M$ has to do is add a few characters to the start and end of every file format they currently use. For example, something like this:

    <xml //ms//dtd windowsmedia 9.0> <asf> FVRT&*&@#$ERDFHh678$#D%TGW3 [big stream of binary deleted] VFBTY*&^%$$#@WEDFGHGG&^43F#%@w </asf> </xml>

    Then they can hold a press conference to proudly announce: "Microsoft Office is the only suite that is 100% XML compliant!" The word XML is like the word consultant -- it can hold so many meanings that it's pretty much meaningless.

  8. Difference between DTDs and XML schemas? by khym · · Score: 2

    I'm rather clueless when it comes to XML, but I thought that a DTD did what the schemas seem to do. What exactly is the difference between them?


    Suppose you were an idiot. And suppose that you were a member of Congress. But I repeat myself.
    --
    Give a man a fire, and he'll be warm for a day, but set him on fire, and he'll be warm for the rest of his life.
    1. Re:Difference between DTDs and XML schemas? by ConsumedByTV · · Score: 2

      I could be wrong this declares DTD's to be part of XML now.


      Are you on the Sfglj (SF-Goth EMail Junkies List) ?

      --


      "Not my manner of thinking but the manner of thinking of others has been the source of my unhappiness." - M
    2. Re:Difference between DTDs and XML schemas? by vidarh · · Score: 2
      Eh.. No. You need a parser to handle Schemas just as much as you need it for DTDs, and just as DTD parsers to a large extent is built into many modern XML parsers, expect schema parsing to be too. Also, XSL still adds tons of code.

      The advantage doesn't come in the need for or reduced need for parsers, but in that schemas can specify the structure of an XML document with much more detail than a DTD can. As for XSL, I don't like it at all - it's a lot more complex that needed.

    3. Re:Difference between DTDs and XML schemas? by vidarh · · Score: 2
      A nice troll... But the equivalent of SGML and DTDs would be XML and DTDs or XML and schemas.

      All the other stuff you mention provides extra functionality that you don't need to do the same stuff you can do with SGML and DTDs. In fact XML + schemas already provides lots of useful validation of the structure that you won't get with SGML + DTDs.

      Thanks to the simplicity of XML it got the widespread usage that SGML never managed, which is what have resulted in all the other stuff you mention: Standards that, if it weren't for the popularity of XML most likely would have been represented in tons of disparate representations, instead of using XML as the common representation.

      With XML schemas too, now you'll be able to properly validate documents for a lot of the standards you mention without writing a separate validator - just specify the types with a schema.

    4. Re:Difference between DTDs and XML schemas? by janpod66 · · Score: 2
      Thanks to the simplicity of XML it got the widespread usage that SGML never managed,

      XML's popularity probably has little to do with its design. SGML was marketed as a text markup language. XML is being marketed as a universal data representation. The market for the latter is several orders of magnitude larger than for the former, and that accounts for XML's popularity. In terms of its design, XML is neither particularly simple (compared to alternatives), nor particularly clean.

    5. Re:Difference between DTDs and XML schemas? by Anonymous Coward · · Score: 5
      Well, you see, in the beginning oh, about 15 years ago, there was SGML and DTDs. But the powers that be decided that this was far too complicated. So they decided that they would replace it with a much simpler framework. This new system currently consists of XML, DTDs, XML Schema, CSS, DOM, SAX, SOAP, UDDI, WDDS, WSDL, RDF, RSS, URIs, URLs, URNs, XForms, XHTML, XLink, XML Signature, XPath, XPointer, XSL, XSLT, JAXP, JAXM, TrAX and a few hundred other acronyms and abbreviations which I shall omit for brevity.

      As you can clearly see, the old system was just far too unwieldy and complex. I am glad that they have made things so much simpler.

    6. Re:Difference between DTDs and XML schemas? by divec · · Score: 5

      Not to detract from the humour value of your post, let me give a simple example of everyday XML usage where schemas are essential for XML.

      You've got a database, with a 2 column table. Say "Company name"(char[40]) and "Net profit this year"(int). Ywanna get data to go in this table, in XML format, from another company. That XML's gonna look something like this:

      <data>
      <Company>
      <Name>Lastminute.com</Name&gt ;
      <Profit>-12345678</Profit>
      </Company>
      <Company>
      <Name>Apple</Name>
      <Profit>31337</Prof it>
      </Company>
      [...]
      </data>

      Ok. Now how do you specify that the Company name should be <= 40 characters and the profit should be an integer? A DTD gives no way of doing this, it just says what order the tags can come in. Without XML schema, you're reduced to sending emails saying "Please make the Company name at most 40 chars and please make Profit a signed integer". Which is evil, cos you might have to do that for a 200 table database, and also there's no way of using that email to automatically check that XML file.

      OTOH a schema lets you specify exactly what you want in a precise, even fairly simple, machine-readable format.

      Now do you believe me that schemas are really important? :-)

      --

      perl -e 'fork||print for split//,"hahahaha"'

    7. Re:Difference between DTDs and XML schemas? by dgrage · · Score: 5

      DTDs are rules on how the document is to be "formatted". In other words, where certain elements and tags are to be placed within a document. This refers to the document's structure. Liken it to HTML .. most HTML files have <html><body> then </body></html> tags (in that order). So long as those are in the correct order (as specified by the DTD), the document is "verified" correct by a validating parser. Yet, this has nothing to do with the data between those tags.

      This is where schemas come in. They represent a validation against not only the document's structure, but also the data it contains (i.e., the data between the tags). You could liken it to the constraint on a database table's field. I.e., CustomerType = V or I (Valid, or Invalid). To continue the example from above, you could specify a schema the restricts the content of the data between the html and body tags.

      Hope this helps.

  9. If people use bad browsers, that's their problem by yerricde · · Score: 2

    have W3C standards ever meant that I can get solid cross-platform, cross-browser compatibility on my (correctly coded) web pages, six months, a year, two years down the line?

    The major fifth-generation web browsers (Mozilla, IE 5.x, Konqueror, Opera, etc.) support most of CSS1 and CSS2. If a page crashes 4.x browsers, that's the fault of the 4.x browser user for not installing a 5.x browser. 5.x browsers don't use that much more resources than 4.x browsers; see also Galeon and K-Meleon.

    If people use shitty browsers, that's their problem.

    --
    Will I retire or break 10K?
  10. Re:Bad news for XML by Phronesis · · Score: 2

    So you dont think M$ can find a way to make 'just their product' compatible with XML?

    They won't E&E XML too soon. They're still working on embracing and extending TCP/IP and ZIP codes.

    After all, XML, including Schema, is just a way to format your data to make it easy for other machines to parse. It doesn't help you understand what the data means.

    What MS is likely to do is to send data while not documenting the meaning of the data, and then claim that they're "Standards Compliant." I can just see the schema, defining fields such as

    <xsd:element name="reserved" type=ObfuscatedType>

    <xsd:complexType name="ObfuscatedType">

    <xsd:sequence>

    <xsd:element name="undoc1" type="xsd:integer"%gt;

    <xsd:element name="undoc2" type="xsd:boolean>

    </xsd:sequence>

    <xsd:attribute name="BillsSecretCode" type="xsd:string"/>

    </xsd:complexType>

    It may be standards compliant, but without Microsoft Secret Decoder Ring 2001, it won't do you much good.

  11. Re:XML by boaworm · · Score: 2
    >>Is this what you're waiting for?

    Well, not exactly. Kweelt is a development from Quilt, and so is XQuery. That means they probably have a lot in common. But i still wait for a "standard" to evolve, thats what W3C is for :)

    Even if it supports all requirements, as long as it's not a standard.. its not really useful in the long run.

    --
    Probable impossibilities are to be preferred to improbable possibilities.
    Aristotele
  12. Re:XML by boaworm · · Score: 2
    >>I Dont see any downsides to XML, does anyone?

    Well there's always one thing... there is no way to make good use of it yet ;)
    XML (at current) doesnt have a query language, which means you dont have that much to use XML for. Sure you can repressent documents, and with stylesheets rewrap them into a design of your choise, but large-scale use are yet to come.

    What we are waiting for is XQuery, that will hopefully make a big difference :-)

    --
    Probable impossibilities are to be preferred to improbable possibilities.
    Aristotele
  13. Castor, by Exolab by ybmug · · Score: 2
    I ran across this company awhile back and have found their tools extremely useful. Primarily they provide a tool that will compile a Schema into a Java object model. It provides built in functions for marshalling/unmarshalling/validate. I have used it in one project so far and it made dealing with XML data very easy.

    http://castor.exolab.org

  14. It's all about (meta)data... by Anonymous Coward · · Score: 3
    I have been doing XML for the last two years (XML Schema, Namespaces, XSL Transforms, plus some other misc stuff) and while I think this stuff is way cool, it is a bitch to explain to folks. The best analogy I have found is libraries. I choose libraries because a card catalogue is a great example of "meta data" in use and most folks know about card catalogues and why they are useful (OK, necessary).

    So what is the big deal with XML Schema? XML Schema is important because it provides the widgets to define a "card catalogue" for your library of data, be it air plane parts, phone bill, hotel reservations, or porn.

    Now metadata has been with us since the mud table libraries of Mesopotamia (they had indexes of stuff so they could find how many cows were traded in the Xth year of SomeRulerDude), however the printing press is what made all the difference. You see, before the printing press books were so expensive and time consuming to write, there were not that many of them. The general strategy to manage a library was an index of all the books. As long as the book population was not too big, then this works. For example, when you search on google for "McCain", you get congressman, porn sites, and damn near everything in between. Search engines today are just really, really big indexes of stuff. Still in the stone ages, aye?

    The printing press changed that and forced libraries to find an EXTENSIBLE way to keep up with books. The Dewey Decimal System is a great example. So I pose to you the following question, "When was the last time the DDS was updated?" Well, how long have they been publishing books on computer science, biogenetics, or nanotechnology. The DDS is an extensible system to classify knowledge. So I leave you with the following statement...

    HTML was the functional equivalent of the printing press, which is just an electronic version of fast, cheap publication. HTML forced us to follow down the path of XML, just like the printing press forced Mister Dewey to put on his thinking cap. The only difference is that the printing press took a few hundred years to do its thing where HTML only took a few years to do its thing.

    Now for all the other XML specs out there (SAX & DOM, RDF, XSLT, XHTML, XPointer, etc) are just tools to work with your (library of) data. Better to have many specialized tools that can evolve independently than one big honking tool, aye? Use only the tools you need.

    So does TBL's dream of a semantic web make more sense now...?

    If you want some links, try...

    Danny Hillis - The big picture

    Roger Costello's XML Schema Tutorials

    "You can drive a car by looking in the rear view mirror as long as nothing is ahead of you. Not enough software professionals are engaged in forward thinking." - Bill Joy

  15. Validation & Binary by csbruce · · Score: 3

    While somewhat important, I think that people give data validation far too high of a priority. People seem to think that "self-describing data" is going to save the world in the same way that XML was supposed to eliminate the need for parsing and interpretation of information by a computer program. I've been involved in using XML to exchange information and make remote invocations of services in a Web environment, and you still have to write programs to interpret the contents of the XML information in pretty much the same way as with data exchanged in any format.

    So you can automatically validate it. So frikking what! The rabid theoriticians in the consortium of people that I work with get all hung up on this without realizing that most functioning protocols out there are able to exchange information without the need for a formal validation model. Not that you would really want to use one on either the generation or consumption side of a real system, since it just slows things down. All you need is a clear spec for the protocol.

    Another thing that bugs me is the fiercely defended text-only approach used in XML. For some reason, XML fans seem to think that computers cannot exchange and understand binary data, or that editing tools would be unable to allow people to see it.

    The text-only approach has two major limitations. First, there's no way to directly include binary data. There's lots of binary-encoded objects out there, like image or sound file formats, but you have to encode it in BASE64 or something. This is pretty strangely limited given that XML data is generally exchanged over an 8-bit clean pipe (i.e., the Web). Something like:

    <xml:binary size=10>kjiu õéçäá</xml:binary>

    would be quite reasonable, with "size" octets placed directly between the closing '>' of the opening tag and the opening '' of the close tag. They should have included a mechanism in XML Schema to declare this.

    The second problem with text is the high cost of parsing it. Probably the majority of time spent in a system that processes a large bulk of XML data is spent in the lexical analysis stage of consuming the XML stream. They had their big chance with binary-WAP-XML, or whatever they called it, but that seems to be kind of screwed up and includes patented technology. What is needed is a simple, widely acceptable binary encoding of exactly the information included in XML text, which uses lookup tables to optimize handling tag names.

    The third problem with exchanging raw text XML encoded data is that it explodes the information you want to ship over the Web by a factor of about 20 times. It needs to become commonly accepted practice to, at least, exchange this information in a compressed format, such as GZIP. The MIME tags really need to be updated too, to allow a nesting of formats, to say "this is a gzip-compressed stream of Bob's fabulous graphics markup format encoded in XML".

  16. Re:XML by j-w · · Score: 3

    What we are waiting for is XQuery, that will hopefully make a big difference :-)

    You might want to have a look at Kweelt which claim to (and I quote) "implements a query language for XML that satisfies all the requirements from the W3C query-language-requirements"

    Is this what you're waiting for?

    --
    jw
  17. Re:XML by Y-Leen · · Score: 3
    doesnt have a query language, which means you dont have that much to use XML fo

    There's a host of languages you can use to pull subsets of XML data out. Everything from XPath expressions with XSLT to building DOM trees or SAX parsers to manipulate the data with your favorite programming language. That's as powerful as you can get.

    large-scale use are yet to come.

    Reuters produces all their news in XML format. There's a contant stream that comes in at a few MB an hour. That's a massice scale use if you ask me.

  18. Clarification: by PicassoJones · · Score: 3

    To all you stating that now this is a "standard" organizations will start "breaking" it:

    It is not a standard, it is an official W3C recommendation. And part of the process of making it a standard is for developers to experiment with it to see what works and what doesn't. So whereas some propietary extensions die out, some survive and become part of the standard.

  19. So now... by joenobody · · Score: 4

    So now that it's a standard:

    • Microsoft will create a proprietary version
    • XML will stop being the current "hot" buzzword
    • Browser companies will start getting more creative about why they don't support it
    • Every XML book out there ("XML in 21 Hours!" "XML for Joe Sixpack!") will have a second edition printed "packed" with "new information" - ie. a reprint of the spec in the appendices
    • Current web professionals will groan and start thinking seriously about getting around to learn it
    • Jakob Neilson will write a column about how it's the worst thing a designer could ever consider using
    • Ziff-Davis will write a glowing review (I mean, c'mon, they do it for everything)

    --

  20. Re:Bad news for XML by Ergo2000 · · Score: 4

    Microsoft already supposed XSD schemas in the MSXML 4 preview release. Microsoft has been more of a force in pushing the implementation of XML than any other company, so to fault them unjustly seems quite silly.

  21. And the W3C stamp means what? by The_Runcible · · Score: 4

    Just look at how unified html has become!

    --

    I am not a spork.
  22. Taking the good with the bad by jlowery · · Score: 5

    XML has needed a truly powerful schema language to enforce data constraints in data-heavy documents. This is very much akin to having database schema for databases. With a declarative language and a common processor enforcing primary constraints on data, you free each application from having to do their own consistency checks.

    XML Schema has a lot of powerful features, including the separation of types from structure, two kinds of type inheritance, modularization, default values for attributes and simple elements, and the flexibility to be as strict or as lax as the situation dictates for validation.

    Having said that, the big battle brewing is whether XML Schema is going to be shoehorned into all the other XML protocals that need a data model description before there's been a wide base of practical experience developed. There's already a divide between data modelers and application developers because of the specialized knowledge that SQL and relational database design imposes; I think XML Schema does nothing to narrow that gap, which is unfortunate since class hierarchies and the hierarchical data model of XML seem a natural fit.

    --
    If you post it, they will read.