This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

using XML to create wml and html

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,
I have this unique problem that i have to create a site that would dynamically generate stuff according to the type of browser I got. I have got the hint that i can do this using XSL but how to do it i am not clear can anybody help me with this.
Thanx in advance I need this very quickly.
Asim Wagan
SCJP2
 
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 Asim!
To your unique problem, I propose the unique solution: Sure! Go ahead!
Well, er, I don't know how much help that really was but what I mean to say, is that I think you're on the right track, XSL is what you need.
And then, there's only one thing left: you have to learn to use XSL. But even if I had the time, I think you can learn XSL from better sources.
You can try a tutorial somewhere at www.w3.org, they are the body standardising everything regarding XML, and ALL THERE IS about XML is defined and then published there, at that website. It's a great source.
(What I know about XML/XSL is mostly from Microsoft documentation, the msdn library. If you have access to that, that is perhaps the best single source of documentation I know of, with good XSL tutorials as well)
Good luck with your project!
Marius
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Quite a few companies are doing exactly that. I can't comment on how they do it; but this is the general idea. First, define the data you want to publish in XML. Then, find out the parameters of the displays of the devices you want to publish to. As you can imagine, HTML and WML are very different animals, and you will need at least two separate sets of XSLT stylesheets to handle them. Since the devices supporting WML are also quite different in attributes (number of lines, number of columns, fonts supports, imagines supported), in general, you need to program your XSLT well to be able to add more devices without rewriting your WML XSLT stylesheets.
Enough general comments. A bit more specific now. The biggest problem with publishing things that you usually publish with HTML is that they are quite verbose. This is not a good attribute for cell phones, as you can imagine. Think hard about the DTD that will handle both the more verbose HTML site that you are going to publish your information, and also the severely limited text display capabilities of the cellphones and such. Get that done first.
Doing the transformation for some specific devices is not very difficult. The difficult part is how to write your stylesheets so that you don't have to modify them too much when you have another new device to support.
The biggest non-programming issue with multi-device publishing is the usability issue. WML sites are not easy to design well, in terms of usability. I would spend quite a bit of time to make sure the WML sites are acceptable for the devices supported.
I think you will need Java to coordinate the different stages of the publishing process, especially if you want to generate the pages on-the-fly.
Without giving you a technical proposal, this is what I have:
1. Design a DTD that is acceptable for both HTML and WML sites. For HTML sites, you want to display more information so that they don't look bare. But for WML sites, you want to make sure whatever you have is to the point and useful rightaway.
2. Design two or more sets of XSLT stylesheets for HTML, and also for WML devices you have to support. If you decide to write one set of XSLT documents for each device, that is good too. Otherwise, the set for WML will have to be quite flexible to hande most WML devices.
3. Use your servlets, JSPs, whatever to detect the device from the HTTP requests.
4. Apply the appropriate XSLT documents to the appropriate XML document to send out as reply.
Now, this is still very vague, of course. But it can't get much more specific than this right now.
------------------
Khun Yee Fung
Author of XSLT: Working with XML and HTML
 
asim wagan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks folks, That is great.
But as Khun you said that their is big problem in processing the type of content we have got. Now if the XML file is containing a huge amount of text(for WEB), comparatively for the WAP we will be needing a lesser number of text so how we will be approaching this problem.
I mean that how we will be removing some parts of the XML from the final document which will be produced as XML. Please if you provide the example that would be great.
Thanks again.
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Asim,
There's a tutorial/article on Developerworks called Developing Wireless Web Applications that might help.
There's also a WAP Forum site that might be useful.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is WML ?
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic