Help with XSL to render XML "Cousins"
Posted: Sun Sep 11, 2016 5:42 pm
Hi all,
I'm a newbie to XML/XSL and could use some need help displaying and sorting values that are stored within the child nodes of two different parents (i.e., the data are "cousins").
The XML file includes a schedule of events happening today in different rooms of our building. Each event is represented by the <event> tag, which contains <space> and <event_details> nodes, each of which has child nodes where the values I want to display and sort are stored. It basically has the following structure (using an example with two records below, with closing tags removed for readability):
<schedule>
event_startandendtime, event_name, space_name
event_startandendtime, event_name, space_name
For example:
8:00am to 9:10am, Advanced Calculus, Room 103
9:20am to 10:30am, English Literature, Room 210
So far, I've been unsuccessful. In one attempt to code it, I can generate a sorted list but I can't get the space_name to appear. In other attempt, I can get the space_name, but can't sort the list, nor do I have much control over where to place the space_name.
Is this a straightforward coding task or a much more complicated one for a newbie? Thanks a lot for any directions you can point me in!
BeiJi
I'm a newbie to XML/XSL and could use some need help displaying and sorting values that are stored within the child nodes of two different parents (i.e., the data are "cousins").
The XML file includes a schedule of events happening today in different rooms of our building. Each event is represented by the <event> tag, which contains <space> and <event_details> nodes, each of which has child nodes where the values I want to display and sort are stored. It basically has the following structure (using an example with two records below, with closing tags removed for readability):
<schedule>
- <event>
- <space>
- <space_name>Room 210
- <event_details>
- <event_name>English Literature
- <event_startandendtime>9:20am to 10:30am
- <space>
- <event>
- <space>
- <space_name>Room 103
- <event_details>
- <event_name>Advanced Calculus
- <event_startandendtime>8:00am to 9:10am
- <space>
event_startandendtime, event_name, space_name
event_startandendtime, event_name, space_name
For example:
8:00am to 9:10am, Advanced Calculus, Room 103
9:20am to 10:30am, English Literature, Room 210
So far, I've been unsuccessful. In one attempt to code it, I can generate a sorted list but I can't get the space_name to appear. In other attempt, I can get the space_name, but can't sort the list, nor do I have much control over where to place the space_name.
Is this a straightforward coding task or a much more complicated one for a newbie? Thanks a lot for any directions you can point me in!
BeiJi