This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Xml Basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Xml Basics" Watch "Xml Basics" New topic
Author

Xml Basics

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 215

Hi all,
When I create a XML document,I say that I create an XML instance from a XML markup language.But a markup language is defined by a set of rules which should be followed by the XML documents created correspondingly.And XML markup languages are defined by the schema.So,what about the XML documents created without a schema?What can we say about the markup language of those XML documents who do not have an associated markup language?

Thanks....
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
There wouldnt be such a thing.

It may not be specified sometimes, but 'there is' a defined language at the back of each xml data.

That is, is you want the xml to mean anything at all.

If you will use it with a computer program, the program needs to know what the xml means.
Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 215

Hi Jesus Angeles,
Thanks for the reply.But could you please elaborate .I want to know that is it not possible to create a XML document without a xml markup language?
Thanks......
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
You can create such document, but they would be meaningless and useless.

Why would anyone need an xml document?

Most will have the reason - for 'communication'. If there is no language, the two parties wouldnt understand each other.

They can throw xml documents between each other, but without a language, one will not know what the other guy wants to say.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
There are XML-based documents that conform to an explicit language (aka vocabulary) which is specified in an XML Document Type Definition (DTD) or an XML Schema. Here the instance document must conform to the rules specified in the custom language AND the rules specified in the XML specification for well-formedness.

There are also XML-based documents that conform to the rules specified in the XML specification for well-formedness only. In this case, there isn't an "explicit" definition of a custom language, but one still exists. In this case there is more flexibility in regards to how the elements and attributes are organized as there is no "defined" structure besides the rules of well-formedness which are specified in the XML specification.

Keep in mind that every XML-based language does not have a name. Some examples of XML-based languages with names are: Business Process Modeling Language (BPML), Financial products Markup Language (FpML), Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL).

Examples of XML-based languages without a name are the Java Servlet configuration data which goes in a web.xml, or Struts configuration data which goes in struts-config.xml.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I think you (Sudhanshu) have it all backwards. The vast majority of XML documents aren't described by a schema. It's perfectly normal for people to agree on the meaning of a document without writing a schema. And really a schema doesn't describe the meaning of a document either, it just specifies the names of elements and attributes and where they can appear. It describes the format but not the content.

So in the end, the meaning of each XML document is specified by an agreement among the people who use it. Schemas are far from being a complete implementation of that process.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Xml Basics
 
Similar Threads
Newbie question : What is xml schema ?
new markup language
How to validate an XML schema i.e. Validate an XSD file
Convert Data to XML File
two XSDs and namespace problem.