XML parameters and conditions

Discussion in 'XML' started by Shaldaman, May 9, 2007.

  1. Shaldaman

    Shaldaman Guest

    I have an XML document with the following layout:

    <committees>

    <committee>
    <title>COMMITTEE 1</title>

    <member>
    <name>Person A</name>
    <org>Organization A</org>
    <address>Address A</address>
    <phone>Telephone: (123) 456-7890</phone>
    <fax>Fax: 123) 456-7890</fax>
    <email>E-mail:</email>
    </member>

    <member>
    <name>Person B</name>
    <org>Organization B</org>
    <address>Address B</address>
    <phone>Telephone: (123) 456-7890</phone>
    <fax>Fax: 123) 456-7890</fax>
    <email>E-mail:</email>
    </member>
    </committee>

    <committee>
    <title>COMMITTEE 2</title>

    <member>
    <name>Person C</name>
    <org>Organization C</org>
    <address>Address C</address>
    <phone>Telephone: (123) 456-7890</phone>
    <fax>Fax: 123) 456-7890</fax>
    <email>E-mail:</email>
    </member>

    <member>
    <name>Person D</name>
    <org>Organization D</org>
    <address>Address D</address>
    <phone>Telephone: (123) 456-7890</phone>
    <fax>Fax: 123) 456-7890</fax>
    <email>E-mail:</email>
    </member>
    </committee>

    </committees>

    The root node is <committees>. There are currently 2 <committee> nodes
    under this. In each committee, there are members.

    In my XSL file, I have written for-each statements to display each
    committee with its respective members. I have 2 problems I need help
    with:

    1. These committees should all not show up at once. There are
    supposed to be links on an ASP page that when the user clicks on one
    of the committee's links, the XML page will only display that
    committee and not the entire list in the XML page. How do i do that?
    2. This is related to the previous question. My XML file is going to
    be dynamic - a user can add committees and members. This would append
    the data to the XML file. Is there a way to generate like an ID or
    something to associate with each new committee? If we had something
    like that, clicking on the link would pass the corresponding ID to the
    XML file to pull up only that specific committee's details.

    Thanks for any help you can provide on this...
     
    Shaldaman, May 9, 2007
    #1
    1. Advertising

  2. Shaldaman wrote:
    > 1. These committees should all not show up at once. There are
    > supposed to be links on an ASP page that when the user clicks on one
    > of the committee's links, the XML page will only display that
    > committee and not the entire list in the XML page. How do i do that?


    Depending on the framework you're using, you may be able to make the ASP
    layer call XSLT with different stylesheet parameters. See the XSLT spec
    for info about how to declare stylesheet parameters; once declared, they
    behave like stylesheet variables whose value is set from outsite.

    > 2. This is related to the previous question. My XML file is going to
    > be dynamic - a user can add committees and members. This would append
    > the data to the XML file. Is there a way to generate like an ID or
    > something to associate with each new committee?


    Sure, in your application code that is editing the XML. There's nothing
    built into XML or the standard XML APIs which will help you with
    generating those unique values.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, May 9, 2007
    #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. Gabriel Lozano-Morán

    How to loop a recordset and display html with conditions

    Gabriel Lozano-Morán, Jul 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    559
    Cactus Corp.
    Jul 6, 2005
  2. Fernie
    Replies:
    6
    Views:
    43,064
    Michael Winter
    Nov 20, 2004
  3. Abdul Mukit
    Replies:
    0
    Views:
    335
    Abdul Mukit
    Nov 17, 2004
  4. Replies:
    2
    Views:
    1,192
  5. mars
    Replies:
    6
    Views:
    366
    Laurent Pointal
    Feb 7, 2007
Loading...

Share This Page