Using Servlets to Parse XML

Discussion in 'Java' started by bytes.bit@gmail.com, Dec 12, 2006.

  1. Guest

    I would like to create a servlet, which when accessed, will retrieve an
    XML file, remotely over the Internet, and parse it to the browser's
    screen.

    Can anyone point to example code that will help me along?

    Thanks.
     
    , Dec 12, 2006
    #1
    1. Advertising

  2. wrote:
    > I would like to create a servlet, which when accessed, will retrieve an
    > XML file, remotely over the Internet, and parse it to the browser's
    > screen.
    >
    > Can anyone point to example code that will help me along?
    >
    > Thanks.


    You can use XSLT to transform the XML in the servlet and post the
    output to the response. Alternatively, you can push the XML as-is to
    the browser, and have the browser transform it using an XSL hosted on
    the server. You can use the xml directive to point to the xsl like
    <?xml-stylesheet type="text/xml" href="your_stylesheet.xsl"?>. However,
    I am not sure if all browsers support this - all the new ones do for
    sure.

    Hope this helps.

    -cheers,
    Manish
     
    Manish Pandit, Dec 12, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. neil
    Replies:
    0
    Views:
    598
  2. cat_dog_ass

    html to xml to servlets

    cat_dog_ass, Mar 23, 2006, in forum: Java
    Replies:
    1
    Views:
    361
    Timo Stamm
    Mar 23, 2006
  3. Replies:
    19
    Views:
    1,190
    Daniel Vallstrom
    Mar 15, 2005
  4. stevenmac2
    Replies:
    1
    Views:
    626
    stevenmac2
    Aug 23, 2007
  5. 7stud --

    optparse: parse v. parse! ??

    7stud --, Feb 20, 2008, in forum: Ruby
    Replies:
    3
    Views:
    216
    7stud --
    Feb 20, 2008
Loading...

Share This Page