aspose file tools
The moose likes XML and Related Technologies and the fly likes On portability of XML Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "On portability of XML" Watch "On portability of XML" New topic
Author

On portability of XML

Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
I am currently doing a tech review for one of numerous Web services book and this job put me in "pay unhealthy attention" mode. Turned out to be a traumatic experience, now I cannot read a sentence without trying to find potential (or just crying out loud) problems in it. Today I was reading Sun's technical white paper "Web Services Made Easier. The Java™ APIs for XML" (http://java.sun.com/xml/webservices.pdf) and either this job drove me crazy, or...
"What Makes XML Portable?
A DTD, such as the priceList DTD, is what gives XML data its portability. If an application is sent a priceList document in XML format and has the priceList DTD, it can process the document according to the rules specified in the DTD. For example, given the priceList DTD, a parser will know the structure and type of content for any XML document based on that DTD. If the parser is a validating parser, it will know that the document is not valid if it contains an element not included in the DTD, such as <tea>, or if the price element precedes the name element."

Does that mean that XML documents without DTD are not portable? Isn't it absurd? This statement utterly contradicts to "self-describing nature of XML" postulate. "... given the priceList DTD, a parser will know the structure and type of content..." - the structure is explicitly expressed by element enclosing and associated attributes, DTD doesn't change a lot here. Type of the content? You mean PCDATA vs. CDATA? Every IBM140/141 graduate knows that DTD is particularly weak on typing. XQuery specifications require the language to be able to perform queries on documents that arrived without any DTD/Schema attached, so what is the point?
"Other features also contribute to the popularity of XML as a method for data interchange. For one thing, it is written in a text format, which is readable by both human beings and text-editing software. Applications can parse and process XML documents, and human beings can also read them in case there is an error in processing. Another feature is that because an XML document does not include formatting instructions, it can be displayed in various ways. Keeping data separate from formatting instructions means that the same data can be published to different media."
If to follow this logic, databases are another example of portable data - they include schema and do not include formatting instructions. So why do we need XML if we can just send our databases to all our partners?
Am I insane, or "portable" here is used in some specific sense, or what?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi Mapraputa,
Believe me,I too read that paragraph and got confused,then i consoled myself that 'its was designed by experts,so lets better follow it',DTD is almost obsolete but JWSDK seems to give more importance for that than on w3c schema.
You said we can send database instead of XML,but how can i interpret it?how can i know in what structure it will come ?like comma delimited,tab etc.,in that case XML is good for structured data exchange.
Frequently u r bashing XML(of course u r telling the fact) and i'm getting confused whether i'm in the right tech path or not. ??
Well everyone is talking abt XML XML XML.... but when its comes to programming it,Oh i'm getting nuts with n numbers of languages(already u listed it) to use it.
The other question I have is (i already posted in webservices forum),ebXML.The objective says that ebXML was developed to enable e-business for SME's etc..and to avoid the complexity of EDIFACT/X12 etc.,
After reading the ebXML BPSS spec,Registry/Repository spec,business proess,core components,modelling.........I'm only getting good sleep rather than getting inspirated.I think i can understand the EDIFACT message structure than the ebXML message structure.I read in my course that implementing edifact/x12 etc needs BIG money and thats the reason we got XML now,but I think SME's can implement ebXML only if they could hire a group of ebXML developers,software engineers,consultants and ebXML experts.May be microsoft will comeup with wizard based toolkit in future but certainly not the java companies.
May be i'm novice here but this is what i feel.


Spritle Software Blogs
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
You said we can send database instead of XML,but how can i interpret it?
It was my attempt to be sarcastic I was kidding about sending databases.
how can i know in what structure it will come ?like comma delimited,tab etc.,in that case XML is good for structured data exchange.
Absolutely! Why XML is portable? Because it defines its structure down to the bit level, via markup specification, character set, and encoding. Now this stream of bytes can be send everywhere and compliant parsers should be able to restore information. Of course, Sun may use "portable" in some specific, proprietary Sun's sense™…
Frequently u r bashing XML(of course u r telling the fact) and i'm getting confused whether i'm in the right tech path or not.
I did not mean to bash I feel dissatisfaction not wih XML as such (this motif is Michael Ernest's prerogative ) but rather with how it is implemented. On slashdot somebody said that "XML is overcomplicated and underpowered" - good formula. As for the right tech part - XML has far richer data model than SQL and see how popular SQL is. XQuery people predict that XML will finally supersede SQL, so only few elite programmers (like Michael Ernest) can afford to ignore it XQuery language will support (besides relational queries, hierarchical and text-based queries and this is when programmers paradise will happen.
Well everyone is talking abt XML XML XML.... but when its comes to programming it,Oh i'm getting nuts with n numbers of languages(already u listed it) to use it.

That's true. Something insane is going on, new languages are created every day, and don't forget that each new member of our "skill set" increases the complexity at the order of magnitude. Not only are we required to learn UDDI, WSDL, WSIL but also how they interact! "WSDL is supported in WSIL through extensions, both UDDI and WSIL can refer to WSDL, UDDI documents are published via SOAP..." etc. etc. etc.
I'm only getting good sleep rather than getting inspirited
Gee, only today I was thinking that Web services books are so deadly boring that the only way to keep a reader awake is to use a whorehouse eager to advertise its services as a case study, instead of standard stock quote example Seriously, to enable computers talk to each other over the Internet is an exciting idea, how did it happen that related technologies are so dull and boring?
[ June 24, 2002: Message edited by: Mapraputa Is ]
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782


"What Makes XML Portable?
A DTD, such as the priceList DTD, is what gives XML data its portability. If an application is sent a priceList document in XML format and has the priceList DTD, it can process the document according to the rules specified in the DTD. For example, given the priceList DTD, a parser will know the structure and type of content for any XML document based on that DTD. If the parser is a validating parser, it will know that the document is not valid if it contains an element not included in the DTD, such as <tea>, or if the price element precedes the name element."


Duh!
Clearly the author is confused between portability and enforcing structural constraints. DTD has no relation to portability. XML documents are portable not because of the presence( or lack of, ) DTDs, but because they are based on simple text content.
"For example, given the priceList DTD, a parser will know the structure and type of content for any XML document based on that DTD"
Again, bad terminology.
Documents are not based on a particular DTD. Rather, documents are validated against a particular DTD. A single instance of a document may be valid against multiple DTDs.



"Other features also contribute to the popularity of XML as a method for data interchange. For one thing, it is written in a text format, which is readable by both human beings and text-editing software. Applications can parse and process XML documents, and human beings can also read them in case there is an error in processing. Another feature is that because an XML document does not include formatting instructions, it can be displayed in various ways. Keeping data separate from formatting instructions means that the same data can be published to different media."

Duh again!
If popularity is expressed as a function of readability, human beings like Word documents better than XML! By no means the popularity of XML should be measured in how much Joe likes reading it.
..and human beings can also read them in case there is an error in processing.
Yeah. Try reading a 64K XML document with seven levels of nesting that has no line breaks between elements, and yes by the way, you are trying to see if there is an error in the document. Go figure.
Another feature is that because an XML document does not include formatting instructions, ....
It's not because formatting instructions are not included. Dude, that was the intent - separating data from presentation logic

Phew! This is what happens when ..... you know what


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Ah. This is what XML advocates need more of, people like Ajith who point out what's wrong with the evangelism or other so-called supporters.
This rhetoric that Map and Ajith attack is the kind of stuff that kills emerging technologies. It reminds me of hype around Java that, upon reflection, surely did more to detract from Java's acceptance than support it.
You need people around a new technology that understand it and somehow still like it. There will always be people who jump on the bandwagon because they want to be the ones to write about it, and many of them do the rest of us a genuine disservice.
Problem is, the people who are usually clearest at understanding a technology by its parts are the ones making use of it -- the reasons for that should be clear to all. As with all things, there are only so many good ones to go around.
[ June 27, 2002: Message edited by: Michael Ernest ]

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: On portability of XML
 
Similar Threads
XML Notes - I
very basic question
some notes on xml
Getting started with XML
Discussion about XML Certification