XML parameters and conditions

Shaldaman

Usenet Archive
Joined
May 19, 2006
Messages
6
Reaction score
0
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...
 

Joseph Kesselman

Usenet Archive
Joined
Feb 3, 2006
Messages
733
Reaction score
0
Shaldaman said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top