JSTL and XML

Hi, I don't know if i can post this problem/question on this forum, so apologies if i'm wrong.

I was wondering if anyone can help me with a problem that I have or at least advise me on the direction. I have an XML file that essentially looks something like this:

<display-groups>

<group name="Date (Platform)">

<field-name name="Start" pi-fieldname="Start" />

<field-name name="In Service" />

<field-name name="InitialGate" />

<field-name name="MainGate" />

<field-name name="Retired" />

</group>

<group name="Date (Programmes, Systems and Sub-System)">

<field-name name="Start Date Range Blocks -5yrs blocks" />

<field-name name="Initial Gate - Range Blocks - 5yr blocks" />

<field-name name="Main Gate - Range Blocks -5yrs blocks" />

<field-name name="In Service - Range Blocks -5yrs blocks" />

</group>

</display-groups>

I then call this XML file in the JSP page using JSTL. Using JSTL i create a dropdown list from <group>. The idea is to create a list of headers that are dependent on the group name. that is to say if I selected Date (Platform) the headers that should be displayed on the JSP are:

Start

In Service

Initial Gate

Main Gate

Retired

Any help would be highly appreciated.

Thanks

[1749 byte] By [amin1977] at [2007-9-30 21:05:21]
# 1
Hi sorry the message is not formatted properly....I idea is that when u select an option ( group name ) then the JSP should display the relevant header...Thanks
amin1977 at 2007-7-7 2:37:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
So I am not sure exactly where your problem is.Are you having trouble using JSTL to parse the XML file?Are you having problems with getting the header (what is a header? Like text in <h3></h3> tags?) to change when a select option is changed?
stevejluke at 2007-7-7 2:37:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi,

I can parse the XML document and full values to create the dropdown box, my problem/ query is that what's the best way to create a set of headers depending on the value selected from the dropdown box. e.g.

Date (platform) [should display the following children nodes of parent Date(platform)

--

//these values are held in the xml file

Start

In Service

Initial Gate

Main Gate

Retired

and so on....

Thanks

amin1977 at 2007-7-7 2:37:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

I still don't understand what you mean by a header.

Is it something that is included at the top of the NEXT page. ie, the user makes a selection from the drop down and submits to the next page. Depending on the option chosen, the next page will look different.

Is it part of a Table on the same page? The user makes a selection from the drop down, and the title of a table shown on that page changes.

Is it some text between one of the html header tags? When the user makes a selection, there is a second part of the page, with <h1>Some Text</h1> and you want to change the value between <h1><><h1>

Is it some JSP that is included in the page, so when the user changes their selection, a different JSP is include on the same page?

If the problem isn't reading the XML, and it isn't making a select box, and the problem IS changing the header, we have to know what you mean by a header.

stevejluke at 2007-7-7 2:37:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Hi,

sorry again for not explaining things properly....

header is a view concept. It's a label that is displayed on the JSP page. So each option in the dropdown box has a set of labels that need to be displayed on the JSP page. Under each label is a set of values (not a problem there). Each label value is held in the XML file (field-name) and each option in the dropdown box is held in the same file (group). The objective is to display the set of labels for each option in the dropdown box using JSTL and parsing the XML file.

Does this help?

Thanks

amin1977 at 2007-7-7 2:37:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...