chris wrote:
> Hello all -
>
> I am trying to display some XML data as html via a transform (XSLT).
> The XML data is as follows:
>
> <TopElement>
> <NextElement>
> <String1>AAAAA</String1>
> <String2>BBBBB</String2>
> <String3>CCCCC</String3>
> <String4>DDDDD</String4>
> </NextElement>
> </TopElement>
>
> There could be a great many <NextElement> nodes in the XML file. I want
> the resultant file (structure) to look like this:
>
> ... <stuff>
> <tr><td>
> <xsl:value-of select="String2">
> </td></tr>
>
> <tr>
> <td><xsl:value-of select="String3"></td>
> <td><xsl:value-of select="String4"></td>
> </tr>
> ... <more stuff>
>
>
>
> Where String2 might be a constant for several nodes. Using the
> <xsl:for-each select=""> structure, I get the value of String2 repeated
> over and over again when I want one instance of the value of String2
> displayed and the other data displayed via the iteration (it will always
> be different). I can sort the value etc but can't get it to display the
> way I like. I have looked for a solution i the book I'm using (XSLT &
> XPATH) but no straightforward answer. Please let me know if I have not
> stated the problem correctly. Thank you in advance for any assistance.
>
> Regards,
>
> chris
>
HI all -
I figured it out
For those interested, see:
http://www.jenitennison.com/index.xml for good info on XSLT in general and
http://www.jenitennison.com/xslt/grouping/index.xml for info regarding the
problem outlines above in particular.
Also, for those who don't know (like me) and are using C# to transform XML
using keys, *don't* follow the MS example at MSDN. There is an identified
problem with XmlDataDocument. See a solution here:
http://tinyurl.com/2htx8.
Thanks to all.
--
chris