XML question


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML question

  1. #1
    Pravin Guest

    XML question


    How do we get the xml transformed into wml using xsl on the server side using
    java.i.e. servlets or jsp.as on client side it is not possible to convert
    from an xml to xsl as the browser doesnt support it.
    Please clarify


  2. #2
    Mark Guest

    Re: XML question


    Use the XSLProcessor class.
    In your doGet or doPut or service method put code like this ...

    XSLProcessor processor = new XSLProcessor();
    XSLTInputSource xmlIS = new XSLTInputSource(xml);
    XSLTInputSource xslIS = new XSLTInputSource(xsl);
    StringWriter wml = new StringWriter();
    XSLTResultTarget target = new XSLTResultTarget(wml);
    processor.process(xmlIS, xslIS, target);
    res.getWriter().write(wml.toString);

    Mark

    "Pravin" <mromee123@rediffmail.com> wrote:
    >
    >How do we get the xml transformed into wml using xsl on the server side

    using
    >java.i.e. servlets or jsp.as on client side it is not possible to convert
    >from an xml to xsl as the browser doesnt support it.
    >Please clarify
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center