• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reply to Govind K: XML

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The name of this forum has apparently changed, making it difficult to reply to some postings.
In my reseaching XML and related technologies, I see two areas where it can be a tremendous benefit: (1)Data exchange between different systems or companies with different systems, and (2)Dynamic presentation generation using XSL.
If your company and a busines partner or customer want to automate order processing, billing, etc., but don't know anything about each other's systems, you can simply agree to exchange data using XML. Once you agree upon the schema of the documents and the method of transfer (HTTP, FTP, email attachment), then all you need is a way to process the XML documents (or generate them). Now you can exchange data all you want without regard to what type of database your customer is using. They can even change their database vendor, and since you are simply exchanging XML, nothing you have written has to change.
XML also is very powerful when it comes to dynamic content generation. My company (or rather my marketing department) is big on branding portions of our web site for partners or large customers. With CGI scripts or static HTML files, this is an administration nightmare. It also limits just how much you can customize the pages.
Using if our content is in XML, we can dynamically generate the required HTML by selecting which XSL stylesheet to use (based on URL parameters, etc). The custom pages can look *entirely* different from one another, even though the content is the same. Change something in your XML file, and all your clients see it immediately. This can be extended even further, to support differnt types of content type. For example, if you are using XML and XSL, making your web site WAP enabled is simply creating a new style sheet that returns WAP/WML to the client, from your XML document.
Hope this helps,
Bill
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Govind K wrote: what are the specific situations where use of XML can be advantageous?what are the limitations of XML?
I'll discuss the limitations first.
XML is by nature a text-based format, designed for a certain measure of human-readability. This means that it is very good at representing symbolic or textual information, but less efficient at other media. Pure byte-streams such as sound or video are not well suited to an XML format, and neither are pixel-based graphics formats.
XML can also be a bit "wordy"; the markup can be a large proportion of the total data for some applications. This limits its usability for severely space-constrained or bandwidth-constrained applications. The WAP format, for example, uses a "compressed" alternate version of XML for use on low-bandwidth mobile phone connections.
This is not to say that XML can't do the above sorts of applications, just that other constraints may override the many benefits of XML.
XML is particularly good at any data-transfer application where the majority of the content is text-based; this includes all forms of documentation, as well as the great majority of Business-toBusiness transactions. It also includes just about all forms of symbolic information - vector graphics, mathematical and chemical formulae and and so on. One very important use of XML is in configuration files (also known as properties files, ini files etc.). Up until now each new application program has had to have its own specific configuration files and formats; XML sweeps all that away to provide a common basis for configuring any software.
XML has many other uses. I advise my customers to think twice, or even three times before creating any new non-XML data format these days. It's just not worth designing, writing, testing, bugfixing, maintaining and deploying another incompatible format and its parsers and tools when XML is so flexible, robust and cheap.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for providing sufficient insight on the topic.a particular question is,is it possible to create an application in XML such that a request is sent from the browser and the web server supplies some information(which is getting loaded in the web server dynamically).also the output on the browser needs to be in tabular form.
any suggestions?
govind

Originally posted by bpearce4827:
The name of this forum has apparently changed, making it difficult to reply to some postings.
In my reseaching XML and related technologies, I see two areas where it can be a tremendous benefit: (1)Data exchange between different systems or companies with different systems, and (2)Dynamic presentation generation using XSL.
If your company and a busines partner or customer want to automate order processing, billing, etc., but don't know anything about each other's systems, you can simply agree to exchange data using XML. Once you agree upon the schema of the documents and the method of transfer (HTTP, FTP, email attachment), then all you need is a way to process the XML documents (or generate them). Now you can exchange data all you want without regard to what type of database your customer is using. They can even change their database vendor, and since you are simply exchanging XML, nothing you have written has to change.
XML also is very powerful when it comes to dynamic content generation. My company (or rather my marketing department) is big on branding portions of our web site for partners or large customers. With CGI scripts or static HTML files, this is an administration nightmare. It also limits just how much you can customize the pages.
Using if our content is in XML, we can dynamically generate the required HTML by selecting which XSL stylesheet to use (based on URL parameters, etc). The custom pages can look *entirely* different from one another, even though the content is the same. Change something in your XML file, and all your clients see it immediately. This can be extended even further, to support differnt types of content type. For example, if you are using XML and XSL, making your web site WAP enabled is simply creating a new style sheet that returns WAP/WML to the client, from your XML document.
Hope this helps,
Bill



------------------
Govind K
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Govind!
Yes! is the answer to your question. I may even say that what you describe is a prime example scenario for XML to come into play. The methods to use will vary depending on platform, I my self use (don't tell anyone!) Windows NT with IIS web server, which is not particularly java-friendly, but they have implemented some XML methods quite well. There are definately equivalent methods available in various java-servers if that's what you use, but unless you share my platform, it won't be so easy to provide you with any code samples.
However, independent of platform, the process is generally like this:
You know a standard HTML form? Well, the data from a such is processed by some logic at your server, cgi or something, then you usually display some answer dependant on the data received.
If this is all you want do do (the data is for your web-site only) there is no need to convert your HTML input to anything else.
BUT, if any other application should use the data as well,
maybe more than one, you can benefit from using XML as a cross-application, cross-system, cross-platform, cross-browser data format. A lot of apps comes with built-in xml processing methods these days, so you can save yourself some work in data transformation. In addition, being a standard (or rapidly becoming one) the XML format also supports several standardised (cross-cross) methods for sorting, filtering, querying into the data and more.
Finally, well-formed XML can also be TRANSFORMED in a standardised way using XSL, which probably is your best bet in the scenario you mentioned. By using XSL you can just supply, let's call it 'output patterns', and your app will render or display the data as specified. Remember that XML is a text format, and data transformation in this manner will result in text output.
That might limit it's use, but it certainly is well suited for sending data to a browser! Me being a MS nerd, i know that IE5 also comes with built-in XML functionality (quite impressing, actually), and I read on Netscape's pages that they will (or have?) come up with something as well.
However, the web is not yet ready for XML being sent directly to browsers (compatibility issues, old browsers...) so the only sensible thing to do is to perform the transformation at the server.
Consider this XML 'document':
<AElements>
<AElement Name='First'>
<AAttribute Value='1' />
<BAttribute Value='2' />
</AElement>
<AElement Name='Second'>
<AAttribute Value='3' />
<Battribute Value='4' />
</AElement>
</AElements>
This is a well-formed XML document, according to specifications (!! IMPORTANT !! See: www.w3c.org for details)
The following set of XSL instructions:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<BODY>
<TABLE BORDER="1" WIDTH="100%" CELLSPACING="10">
<xsl:for-each select="AElement">
<TR><TD><xsl:value-of select="@Name" /></TD>
<TD><xsl:value-of select="AAttribute@Value" />
</TD><TD><xsl:value-of select="BAttribute@Value" />
</TD></TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
will produce a second document with this content:
<HTML>
<BODY>
<TABLE BORDER="1" WIDTH="100%" CELLSPACING="10">
<TR><TD>First</TD><TD>1</TD><TD>2</TD></TR>
<TR><TD>Second</TD><TD>3</TD><TD>4</TD></TR>
</TABLE>
</BODY></HTML>
As you can see quite simple. No more code required! My advice is to get moving with XML, it's gonna pay off!
Marius
 
reply
    Bookmark Topic Watch Topic
  • New Topic