mixing raw xml display w/ formated display

Discussion in 'XML' started by blank101, Feb 5, 2005.

  1. blank101

    blank101 Guest

    I am an xml beginner trying to figure out if xml will be a good tool
    for a problem.

    I want to use the functionality associated with viewing raw xml files
    (namely the expanding +'s and -'s), but I also want to not display
    elements.

    For example, if I had:

    <name attr='Person 1'>
    <first>Carl</first>
    <last>Strange</last>
    </name>
    <name attr='Person 2'>
    <first>Jules</first>
    <last>Verne</last>
    </name>

    I would want it to display as

    + Person 1
    + Person 2

    where I could then expand it to:

    - Person 1
    Carl Strange
    + Person 2

    Any recommendations? Is this easy in xml? Or is some other tool
    better? Thanks
     
    blank101, Feb 5, 2005
    #1
    1. Advertising

  2. blank101 wrote:


    > I want to use the functionality associated with viewing raw xml files
    > (namely the expanding +'s and -'s)


    Raw XML files are text files so if you view them raw then you should
    only the markup.
    What you describe is what some browsers do (namely IE 5/6 on Win and
    Mozilla browsers) which apply some XSLT default stylesheet to XML not
    associated otherwise with a stylesheet to create a HTML document
    displaying the XML as a tree structure that can be collapsed and
    expanded with the help of script.

    > but I also want to not display
    > elements.
    >
    > For example, if I had:
    >
    > <name attr='Person 1'>
    > <first>Carl</first>
    > <last>Strange</last>
    > </name>
    > <name attr='Person 2'>
    > <first>Jules</first>
    > <last>Verne</last>
    > </name>
    >
    > I would want it to display as
    >
    > + Person 1
    > + Person 2
    >
    > where I could then expand it to:
    >
    > - Person 1
    > Carl Strange
    > + Person 2
    >
    > Any recommendations? Is this easy in xml? Or is some other tool
    > better?


    As said, what you see in the browser is HTML with script generated from
    XSLT, that is possible of course to do, you need to write an XSLT
    stylesheet that generates HTML with script as necessary.
    The default stylesheet is available I think, google for that.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 5, 2005
    #2
    1. Advertising

  3. blank101

    blank101 Guest

    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. Ben
    Replies:
    0
    Views:
    1,093
  2. Mike Allen
    Replies:
    3
    Views:
    432
    xhead
    Oct 24, 2005
  3. =?Utf-8?B?ZGF2aWQ=?=

    Can we populate a XML formated string into a dataset?

    =?Utf-8?B?ZGF2aWQ=?=, Mar 29, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    457
    =?Utf-8?B?ZGF2aWQ=?=
    Mar 30, 2007
  4. walterbyrd
    Replies:
    13
    Views:
    1,331
    walterbyrd
    May 13, 2009
  5. ThoGen
    Replies:
    0
    Views:
    125
    ThoGen
    Apr 21, 2006
Loading...

Share This Page