viewing xml

Discussion in 'ASP .Net Web Controls' started by SilentCry, Apr 15, 2009.

  1. SilentCry

    SilentCry Guest

    i'm writing a composite control in ASP.Net within which i want to display
    the contents of an xml file. i want to be able to view the xml 2 different
    ways - as straight text and as a treeview (the way IE displays the file when
    it is double-clicked on). the text view is pretty simple - just use a
    multiline textbox w/wrap=true and read the file in. what i can't figure out
    is how to display the xml in a treeview. i originally thought of using a
    browser control (AxInterop.SHDocVw) but apparently, this is only available
    for windows forms based applications.
    anybody have any ideas on how to display xml as a tree just like IE does?
    SilentCry, Apr 15, 2009
    #1
    1. Advertising

  2. SilentCry wrote:
    > i'm writing a composite control in ASP.Net within which i want to
    > display the contents of an xml file. i want to be able to view the xml 2
    > different ways - as straight text and as a treeview (the way IE displays
    > the file when it is double-clicked on). the text view is pretty simple -
    > just use a multiline textbox w/wrap=true and read the file in. what i
    > can't figure out is how to display the xml in a treeview. i originally
    > thought of using a browser control (AxInterop.SHDocVw) but apparently,
    > this is only available for windows forms based applications.
    > anybody have any ideas on how to display xml as a tree just like IE does?


    Oleg Tkachenko's eXml control http://www.xmllab.net/downloads/exml/ has
    a setting to pretty print the source of an XML document. It's based on
    an XSLT stylesheet that is then applied using
    System.Xml.Xsl.XslCompiledTransform. So you could either use that eXml
    control directly or have a look at its source to use the stylesheet and
    XslCompiledTransform yourself.

    --

    Martin Honnen --- MVP XML
    http://msmvps.com/blogs/martin_honnen/
    Martin Honnen, Apr 15, 2009
    #2
    1. Advertising

  3. SilentCry

    miher Guest

    "SilentCry" <> wrote in message
    news:...
    > i'm writing a composite control in ASP.Net within which i want to display
    > the contents of an xml file. i want to be able to view the xml 2 different
    > ways - as straight text and as a treeview (the way IE displays the file
    > when it is double-clicked on). the text view is pretty simple - just use a
    > multiline textbox w/wrap=true and read the file in. what i can't figure
    > out is how to display the xml in a treeview. i originally thought of using
    > a browser control (AxInterop.SHDocVw) but apparently, this is only
    > available for windows forms based applications.
    > anybody have any ideas on how to display xml as a tree just like IE does?


    Hi,

    As mentioned in the previous post You can transform the xml with an xslt.
    To get the one IE7 uses type
    res://msxml.dll/DEFAULTSS.xsl
    in the address bar in IE7.

    -Zsolt
    miher, Apr 16, 2009
    #3
    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. shaun
    Replies:
    2
    Views:
    560
    shaun roe
    May 18, 2006
  2. MartinC

    Viewing XML

    MartinC, Dec 12, 2006, in forum: XML
    Replies:
    4
    Views:
    569
    Peter Flynn
    Dec 13, 2006
  3. Toby Newman
    Replies:
    13
    Views:
    1,135
    Andrzej Adam Filip
    Jan 29, 2007
  4. SilentCry

    viewing xml

    SilentCry, Apr 15, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    368
    miher
    Apr 16, 2009
  5. Replies:
    0
    Views:
    103
Loading...

Share This Page