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. Advertisements

  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. Advertisements

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:
    667
  2. Replies:
    1
    Views:
    1,107
    Esmond Pitt
    Mar 27, 2005
  3. Tony Prichard
    Replies:
    0
    Views:
    1,016
    Tony Prichard
    Dec 12, 2003
  4. Replies:
    19
    Views:
    1,427
    Daniel Vallstrom
    Mar 15, 2005
  5. beginner
    Replies:
    13
    Views:
    732
  6. 7stud --

    optparse: parse v. parse! ??

    7stud --, Feb 20, 2008, in forum: Ruby
    Replies:
    3
    Views:
    359
    7stud --
    Feb 20, 2008
  7. HP
    Replies:
    9
    Views:
    379
    Big and Blue
    Jan 2, 2006
  8. Erik Wasser
    Replies:
    5
    Views:
    850
    Peter J. Holzer
    Mar 5, 2006
Loading...