how to display xml?

Discussion in 'ASP .Net' started by Peter Kirk, Jun 6, 2006.

  1. Peter Kirk

    Peter Kirk Guest

    Hi there

    say I have a string which contains xml. How do I display this on my
    webpage - as tags in an hierarchical structure?

    Thanks,
    Peter
     
    Peter Kirk, Jun 6, 2006
    #1
    1. Advertising

  2. You can display it any way you want. How do you want to dislay it?

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Professional Development Numbskull

    Nyuck nyuck nyuck


    "Peter Kirk" <> wrote in message
    news:...
    > Hi there
    >
    > say I have a string which contains xml. How do I display this on my
    > webpage - as tags in an hierarchical structure?
    >
    > Thanks,
    > Peter
    >
     
    Kevin Spencer, Jun 6, 2006
    #2
    1. Advertising

  3. Peter Kirk

    Peter Kirk Guest

    "Kevin Spencer" <> skrev i en meddelelse
    news:...
    > You can display it any way you want. How do you want to dislay it?


    Well I would like to see things like:

    <item id="123">
    <content>value</content>
    <home name="solutions">
    <address>
    <street></street>
    <post>0067</post>
    </address>
    </home>
    </item>

    etc.

    But I was not getting the tags, only their contents (I think the browser was
    confused by the tags - maybe it thought it was html or something?).

    Anyway I found out to "html-encode" it, and make sure I padded the string
    with <br> tags and spaces at the appropriate places to give an hierarchical
    structure to the output.

    Peter
     
    Peter Kirk, Jun 6, 2006
    #3
  4. Peter Kirk

    Ray Booysen Guest

    Set the mime type to xml and open the document directly in the browser
    Peter Kirk wrote:
    > "Kevin Spencer" <> skrev i en meddelelse
    > news:...
    >> You can display it any way you want. How do you want to dislay it?

    >
    > Well I would like to see things like:
    >
    > <item id="123">
    > <content>value</content>
    > <home name="solutions">
    > <address>
    > <street></street>
    > <post>0067</post>
    > </address>
    > </home>
    > </item>
    >
    > etc.
    >
    > But I was not getting the tags, only their contents (I think the browser was
    > confused by the tags - maybe it thought it was html or something?).
    >
    > Anyway I found out to "html-encode" it, and make sure I padded the string
    > with <br> tags and spaces at the appropriate places to give an hierarchical
    > structure to the output.
    >
    > Peter
    >
    >
     
    Ray Booysen, Jun 6, 2006
    #4
  5. Yes, either way (HtmlEncode or set MIME type) would work. Of course, if you
    want it to be in an HTML document with other HTML, you would go with the
    HtmlEncode method.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Professional Development Numbskull

    Nyuck nyuck nyuck


    "Ray Booysen" <> wrote in message
    news:...
    > Set the mime type to xml and open the document directly in the browser
    > Peter Kirk wrote:
    >> "Kevin Spencer" <> skrev i en meddelelse
    >> news:...
    >>> You can display it any way you want. How do you want to dislay it?

    >>
    >> Well I would like to see things like:
    >>
    >> <item id="123">
    >> <content>value</content>
    >> <home name="solutions">
    >> <address>
    >> <street></street>
    >> <post>0067</post>
    >> </address>
    >> </home>
    >> </item>
    >>
    >> etc.
    >>
    >> But I was not getting the tags, only their contents (I think the browser
    >> was confused by the tags - maybe it thought it was html or something?).
    >>
    >> Anyway I found out to "html-encode" it, and make sure I padded the string
    >> with <br> tags and spaces at the appropriate places to give an
    >> hierarchical structure to the output.
    >>
    >> Peter
     
    Kevin Spencer, Jun 6, 2006
    #5
    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. Imran Aziz
    Replies:
    4
    Views:
    1,543
    Imran Aziz
    Aug 11, 2005
  2. Marc Twain

    Display and display model

    Marc Twain, Jan 13, 2004, in forum: Java
    Replies:
    1
    Views:
    396
    Matt Humphrey
    Jan 13, 2004
  3. blank101
    Replies:
    2
    Views:
    553
    blank101
    Feb 5, 2005
  4. sed_y
    Replies:
    0
    Views:
    1,064
    sed_y
    Feb 15, 2012
  5. Erik Wasser
    Replies:
    5
    Views:
    527
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page