• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Newbie question : What is xml schema ?

 
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read that "An XML Schema describes the structure of an XML document".
What does this mean ?

"Basic XML: they identify the schema against which the XML will be validated"
Where is that "thing" against which xml is validated ? (This question came when i was making a jsp)



 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In simple terms, XML schema defines the structure of a XML document. Here's a bit more detailed version
 
Ranch Hand
Posts: 2187
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

.... "An XML Schema describes the structure of an XML document".



This is not a concise statement and is missing a critical concept. An instance of an XML Schema defines the structure (and other characteristics) of a XML markup language. And XML-based documents (instances) conform to the structure which is defined in the language.

There are hundreds, maybe thousands of XML-based languages. Each one has a unique structure and vocabulary. SOAP is a markup language. HTML is a markup language. WSDL is a markup language. FpML is a markup language. XML is NOT a markup language. XML is a language for "creating" XML-based markup languages. XML is a simplified form of SGML.

An XML-based document is "validated" against the markup language rules which are defined in either an XML Schema instance or a specific XML Document Type Definition (DTD).

 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jimmy Clark wrote:

.... "An XML Schema describes the structure of an XML document".


XML is NOT a markup language. XML is a language for "creating" XML-based markup languages.



Thanks ! that makes things easier. So which are the popular "versions" of xml language ?
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are only two versions of XML.


and


The name eXtensible Markup Language (XML) is a bit misleading. It inherited this from it's parent -Standard Generalized Markup Language (ISO 8879:1986 SGML). Neither SGML or XML are markup languages themselves. They are tools for "creating" markup languages.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rahul Sudip Bose wrote:I read that "An XML Schema describes the structure of an XML document".
What does this mean ?

"Basic XML: they identify the schema against which the XML will be validated"
Where is that "thing" against which xml is validated ? (This question came when i was making a jsp)





an xml schema will specify the structure and content of an xml file, you can find out more in the wiki here; http://en.wikipedia.org/wiki/XML_schema or here ; http://www.liquid-technologies.com/xml-schema-editor.aspx
 
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jimmy,

Jimmy Clark wrote:

.... "An XML Schema describes the structure of an XML document".


An instance of an XML Schema defines the structure (and other characteristics) of a XML markup language. And XML-based documents (instances) conform to the structure which is defined in the language.



It was a nice explaination.
But I want to ask that what about the XML Documents created directly by the text editor.What about their markup markup language given they do not have even a schema to define a markup language?
This question has been confusing me since quite a time,and I found this similar post of yours,so decided to ask you directly.

Any guidance would really help me.

Thanks....
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are two type of XML documents. Those defined by an "explicit" language which is specified in an XML Document Type Definition (DTD) or an XML Schema. These documents must also conform to the rules of an XML document which are specified in the XML specification. There are also documents that simply conform to the rules of an XML document which are specified in the XML specification.

If you create a valid XML document in a text editor there will still be a root element and other elements an attributes. The organization of these elements and attritubues and the names of the elements and attributes is what makes up the markup language, which conforms to the rules of an XML document which are specified in the XML specification.

You should study the XML specification to develop an understanding of these concepts. Below is an example of a TEST markup language for the purpose of describing test results.
 
Sheriff
Posts: 28395
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the other hand, you shouldn't get too tied up by high-level terminology.

For example, consider XSLT. Any programmer who looks at it will tell you that it's a language. But it isn't described by a DTD or a schema, so is it a "markup language"?

Or consider an XML document which contains one week's payroll transactions for a company. Any programmer who looks at that will tell you that it's data and not a program written in a language. But suppose it's described by a schema. Does that make it a "markup language"? A lot of people would hesitate to call a description of data a "language". However there are those who would accept the term "language" to include something which can describe a set of data as well as something which can describe executable code.

So if you were looking for a precise definition, there isn't one. And you don't need a precise definition to be able to work with XML. So my suggestion would be to leave this point alone for now and to move on.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Markup languages and programming languages are not the same. These are two different types of "languages" and have different definitions. Aside, XSL stands for eXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations and it does not stand for a markup language (there shouldn't be an XML DTD or XML Schema for XSLT).
 
reply
    Bookmark Topic Watch Topic
  • New Topic