Slashdot Mirror


Authoring Schemas With XSD

Dare Obasanjo points to his own "article on O'Reilly's XML.com that specifies a set of guidlelines for authoring schemas using the W3C XML Schema Definition language commonly abbreviated as XSD. The primary theme is embracing simplicity by showing how to avoid the more complex and esoteric features of the language."

20 of 111 comments (clear)

  1. but where is it used ? by jacquesm · · Score: 3, Interesting

    I am impressed with the amount of press coverage and hype that has been surrounding XML and related technologies for the longest time now, but where is this stuff REALLY used ?

    Does anybody have an example of high volume (so mainstream) websites using XML ? whereever I look all I see is good old HTML, a div or two (mostly tables still though) and Javascript stuff.

    1. Re:but where is it used ? by Anonymous Coward · · Score: 3, Informative

      I've found XML to be useful for data transfer and syndication. I haven't looked into building sites with it, but it's handy to have Company A export their data so Company B and Company C can use it. I work on a site that displays pricing and availability of houses using XML data exported from a third party in XML. It's also widely used in weblogs (save the flames) and news sites so people can syndicate the content.

    2. Re:but where is it used ? by Kragg · · Score: 5, Informative

      XML is good for industry standards bodies. It's open, there are open implementations, and you can irrefutably lay down the syntactic and semantic law in a schema without any ambiguity.

      FpML, ArApXML, MDML are good examples of industry-specific XML standards. Going into the wider space, you get ebXML, SOAP and more.

      XML is the new-world replacement for EDI (Electronic Data Interchange) and it's biggest uses are B2B and company-internal, with a small B2C following starting up for things like weather data, news feeds etc. It's not surprising you've not come across it... and until you go and work for a megalithic corporation on the IT side, you probably won't.

      --
      If you can't see this, click here to enable sigs.
    3. Re:but where is it used ? by SwissCheese · · Score: 3, Informative

      Dark Age of Camelot uses XML to display the character stats.
      Here is the display page and here is the XML source.
      This page explains how they do it. Very nifty for making guild web pages using their data.

    4. Re:but where is it used ? by syd02 · · Score: 5, Informative

      Take a look at www.gentoo.org The whole site uses XML.

      Also check out Daniel's articles for IBM developerWorks describing the site... Part 1 Part 2 Part 3 Part 4
  2. Article Motivation by Carnage4Life · · Score: 5, Informative

    When the W3C XML Schema recommendation was first released, there were certain parties whom overwhelmed by its newness, complexity and buggy implementations began to advocate using as few features as possible which culminated in the article W3C XML Schema Made Simple by Kohsuke Kawaguchi. However, a year later with parser implementations getting up to speed and more people using the technology it is clear that a number of the earlier misgivings about using some parts of the technology were misguided.

    This is very similar to the situation with Mozilla and C++. In 1998, a few months after the ISO standard was ratified a set of guidelines for using C++ were specified by the Mozilla team which included rules like don't use templates, don't use exceptions, and don't use namespaces. Since then the Mozilla team has looked back at their decision and realized that some of the decisions they made were unwise specifically listed as mistakes were avoiding exceptions and templates. I truly commend the Mozilla team for making their post mortem available online for other [C++ or otherwise based] software development projects to learn from.

    This article aims to do the same thing for the XML community and the W3C XML Schema recommendation.

    1. Re:Article Motivation by Ed+Avis · · Score: 3, Interesting

      I haven't yet seen convincing explanations of why the new schema languages like XML Schema are needed at all. Or at least, I can't see that 'nice to have' features like specifying restrictions on textual element content outweigh the huge extra complexity compared to its predecessor.

      There is already an XML schema description language, called DTD. It is less powerful than XML Schema or Relax NG or DSD or a dozen other edifices of overengineering, but by the 80/20 rule it's likely to do what you need. The tools to validate against a DTD (nsgmls) are already included with most Linux systems. And you can learn all you need to know in about one page.

      XML Schema might be useful for some applications, and being a W3C standard does give it some extra clout (DTD is a W3C standard too, part of the XML specification), but it looks like second-system syndrome to me.

      --
      -- Ed Avis ed@membled.com
  3. Darn DTD's by HillClimber · · Score: 5, Interesting

    As someone who's just downloading the XML Mind editor and about to write an .xsd for my data -- this is great timing! Thanks, Dare.

    I also want to gripe a bit about the complexity of XML Schema. DTD has all the restrictions I'd typically want to use (the main thing I want to do is just specify element names, contents, and attributes). The *only* problem with DTD's is that they are totally namespace-challenged!

    You can't use combine two DTD's for different namespaces into a combo document. You can't even allow arbitrary other elements in a DTD element declaration -- every element must be declared and local. Even worse, you have to pick and stick with a namespace prefix in your DTD -- defeating the whole point of globally unique namespaces.

    What I *really* want is just DTD with a smidge of namespace smarts and the ability to combine DTD's for one document. Anyone want to give it a shot?

    1. Re:Darn DTD's by bay43270 · · Score: 3, Interesting

      What I *really* want is just DTD with a smidge of namespace smarts and the ability to combine DTD's for one document. Anyone want to give it a shot?

      I think this is what everyone wants. The problem is, aside from Microsoft, no one can just make up a standard that contradicts the W3C and expect it to be accepted.
    2. Re:Darn DTD's by Theatetus · · Score: 3, Insightful

      I don't think people should be able to just make up their own standards.

      Isn't that the whole point of XML to begin with? That my company and the company we're partnering with can write a simple data-exchange standard without locking both development teams in a conference room for two weeks?

      So, in your case, you and whoever your dealing with could pretty easily nail down what kind of namespace smarts you want in your DTD validations and implement it without having to RFC the whole world.

      --
      All's true that is mistrusted
  4. Someone give a copy to Microsoft... by T-Kir · · Score: 3, Interesting

    ...no seriously, then they might actually follow the standards that are out there (i.e. their supposed use of 'proper' XML in Longhorn).

    Actually, maybe not. If they do have an O'Reilly Zoo, maybe the animals/books have been re-engineered into abominations... and then they follow what has been rewritten to produce anything.

    Well I suppose Long"Horn" could be an animal derivative; the bit that MS chops off and gives to the customers.

    --
    Are you local? There's nothing for you here!
    1. Re:Someone give a copy to Microsoft... by daeley · · Score: 4, Informative

      I think they already have a copy. The author, Dare Obasanjo, works for them.

      --
      I watched C-beams glitter in the dark near the Tannhauser gate.
  5. Re:Nitpick of the day... by Daniel+Dvorkin · · Score: 4, Interesting
    XSD is not a "language" any more than XML is. XSLT I suppose can be considered one.

    ...

    It's akin to those Costco salespeople who tell me that the "shweet" HP computer over there has 20GB of "RAM". It looks a bit dumb given the target audience.
    Um ... you do know what the "L" in "XML" stands for, right?

    XML is a language. So is HTML. So is SQL. Just because a language isn't Turing-complete doesn't make it not a language.

    Actually, I agree with you that XSD isn't a language -- it's a specific set of rules for using a language, XML; it would be better to call it a grammar. But saying "___ isn't a language" because ___ doesn't do everything C does is as silly as the "MySQL isn't a database (management system)" crap that floats around here every so often.

    I think the target audience is sophisticated to understand the difference between a language that's Turing-complete and one that isn't, and also to know that markup languages are still languages by any reasonable definition of the word.
    --
    The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
  6. Just Say NO! by gurnb · · Score: 5, Insightful

    James Clark fights with XSD, pushing his Relax NG. Relax NG is *not* W3C. Let me repeat a background.
    XML (markup language created by W3C) is a subset of SGML (markup language created by ISO).
    XML has been created by few smart marginals from SGML world plus some MS politicians
    Now those MS politicians (and alikes) rule the show in W3C and the smart marginals have left W3C and work for ISO ( OASIS ).
    XSD is XML Schema language by W3C. Relax NG is XML Schema language by ISO (OASIS). Sofar, Relax NG is the first visible XML applicatuon which belongs not to W3C
    Now when we have a big picture written down, I would recommend reading the letter from James Clark
    http://www.imc.org/ietf-xml-use/mail-archive/msg 00 217.html
    The RELAX NG formalism has a solid basis in tree automata theory. W3C XML Schema has no such basis.

    e t.c.
    BTW, even RELAX NG is definately better than XSD, Relax NG itself is also not that perfect. The 'perfect' solution could be based on regular expressions. Nevermind. In the next years, nothing interesting (except for political battles) would happen in the world of XML Schema.

    --
    "This must be a Thursday, I never could get the hang of Thursdays."
  7. Among other things, XML is used for APIs by Anonymous Coward · · Score: 5, Insightful
    The product I work on (billing software) uses XML to define the API we export for external systems. A client that wants functionality not provided by our stock system is free to develop its own programs (front end and back end) that uses our XML interface to get the data.

    A client will call an API such as getFOO which will have an input type of InputGetFoo and an output type of OutputGetFoo defined in an xsd file. Because both our system and the client use the same xsd files, there is very little problem with synchronization. Using xml allows our clients to have a heterogenuous environment; anything that can deliever xml over tcp/ip can use our interface.

  8. Example website using XML by kelzer · · Score: 4, Informative

    I'm not sure how much traffic they get these days, but the InfoWorld website is XML based. I believe it uses server-side XSLT transforms to turn XML into HTML.

    Also, don't assume that just because the URLs don't have ".xml" in them that the site isn't using XML - it's often transparent, such as when using Apache Cocoon

    --

    ---------------------------------------------
    SERENITY NOW!!!!!!!!!!!!!!!!
  9. Since I Don't Have You by ellem · · Score: 3, Funny

    I don't have hopes or dreams (yeah)
    I don't have plans or schema's
    I can't author anything
    Since I don't have XSD

    I looked on Google
    And I checked out ActiveState
    And I tried MacMall
    They don't carry XSD

    Microsoft says just use .Net
    Redhat says there's no RPMs for it yet
    And Ellen Feiss says hers disappeared
    I don't have XSD

    --
    This .sig is fake but accurate.
  10. Re:So the XML Definition language is itself XML? by J.+Random+Software · · Score: 3, Insightful

    They wrote a schema as well as a DTD (which has the usual namespace validity problems). XSD may be big and ugly, but the designers would have noticed if it couldn't even describe itself.

  11. If it actually takes months to understand by msobkow · · Score: 3, Insightful

    Then maybe you just shouldn't be doing such "complex" programming. XSD should not take more than a couple days to understand, another few days to iron out the details, and by the end of 30-40 hours you should have produced a good sample of whatever you're modelling with XSD.

    Too many "how to" documents and books are written for people who just don't "get it". While I sympathise that they need to learn, you have to grasp the concept of abstraction before some of these "languages" make sense. XSD, ERDs, SQL-DDL, etc. are just different ways of describing data structures and organization. Each is "complex" if you try to make it do more than it was intended for, but only takes a couple weeks to understand well enough to get by.

    --
    I do not fail; I succeed at finding out what does not work.
  12. Re:Patents by __past__ · · Score: 3, Interesting
    Nobody (in their right mind) bashes the W3C because they are a bunch of evil corporate drones. People bash it because the W3C has created too much overengineered, half-working, overly complex and generally crappy specs recently, without listening to valid complaints from their actual users.

    XSD is one example that is particularly nasty because the W3C seems to plan forcing it in every other spec they create (for example XSLT 2.0, XQuery, RDF/OWL), making them very hard to implement (how many conformant XSD implementations are there? For languages other than Java?)