File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Xml Basics" Watch "Xml Basics" New topic

Xml Basics

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 217

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?

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
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: 217

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?
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
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

Joined: Oct 14, 2005
Posts: 18655

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:
subject: Xml Basics