Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XLST data display issue 1

Status
Not open for further replies.

rjoubert

Programmer
Oct 2, 2003
1,843
US
I have a flat dataset that contains some redundant information. Here's an example...

<observation>
<auditID>1</auditID>
<auditDate>1/1/2007</auditDate>
<observationID>1</observationID>
<observationDetail>Test 1</observationDetail>
</observation>
<observation>
<auditID>1</auditID>
<auditDate>1/1/2007</auditDate>
<observationID>2</observationID>
<observationDetail>Test 2</observationDetail>
</observation>
<observation>
<auditID>1</auditID>
<auditDate>1/1/2007</auditDate>
<observationID>3</observationID>
<observationDetail>Test 3</observationDetail>
</observation>

Using the <xsl:for-each...> construct, the same auditID and auditDate will display 3 times. I want to only display those values once (in a header row).

I realize the example data I gave above is not normalized...the auditID and auditDate could be considered parent data and should be a level above the other data, but I am not able to modify how the XML is generated. Can anyone give me a quick and easy way to display the auditID and auditDate ONCE? Thanks in advance...
 
You have a requirement for grouping. Unless you have XSLT 2.0 available (few do), you will need to use the Muench method described by me in this thread: thread426-1210886. Look in the second half of the thread or just search for the word "Muench".

Tom Morrison
 
Thank you Tom, and thanks to Steve Meunch for his solution. It worked great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top