so your input xml is like
<Booking>
<res ResNo="123" NumberofNights="1"/>
in that case to access an attribute use @ ie <xsl:value-of select="ResNo"/>
saying <xsl:value-of select="ResNo"/> mans look for the child element named
ResNo
Colin
"Pete" <> wrote in message
news:bejl94$2nf$1$...
> Hi,
> I have a simple enough xsl page as shown below but it doesnt quite
work.
> It prints empty elements instead of containing the data. The style sheet
is
> being parsed and output for each record returned by the original xml doc,
> just nothing in the element.
>
> I am trying to convert from a flat list of attributes (returned by FOR XML
> AUTO) into a list of elements with different names to their original
column
> identifiers. I cannot output from the sql as elements for reasons i wont
go
> into here and i cannot rename the attributes within the sql either.
>
> Each line in the code below that is value-of select=",,,," is the correct
> colum name returned by the sql.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns
sl="http://www.w3.org/1999/XSL/Transform">
> <xsl
utput method="xml" version="1.0" encoding="iso-8859-1"
> indent="yes"/>
> <xsl:template match = "/">
> <Bookings>
> <xsl:for-each select="/Booking/res">
> <Res>
> <ResNo>
> <xsl:value-of select="ResNo" />
> </ResNo>
> <Nights>
> <xsl:value-of select="NumberofNights" />
> </Nights>
> <MAdults>
> <xsl:value-of select="NumberofMaleAdults" />
> </MAdults>
> <FAdults>
> <xsl:value-of select="NumberofFemaleAdults" />
> </FAdults>
> <MChildren>
> <xsl:value-of select="NumberofMaleChildren" />
> </MChildren>
> <FChildren>
> <xsl:value-of select="NumberofFemaleChildren" />
> </FChildren>
> <From>
> <xsl:value-of select="TravellingFrom" />
> </From>
> </Res>
> </xsl:for-each>
> </Bookings>
> </xsl:template>
> </xsl:stylesheet>
>
> This is what i get...
>
> <?xml version="1.0" ?>
> - <Bookings>
> - <Res>
> <ResNo />
> <Nights />
> <MAdults />
> <FAdults />
> <MChildren />
> <FChildren />
> <From />
> </Res>
> - <Res>
> <ResNo />
> <Nights />
> <MAdults />
> <FAdults />
> <MChildren />
> <FChildren />
> <From />
> </Res>
> - <Res>
> <ResNo />
> <Nights />
> <MAdults />
> <FAdults />
> <MChildren />
> <FChildren />
> <From />
> </Res>
> - <Res>
> <ResNo />
> <Nights />
> <MAdults />
> <FAdults />
> <MChildren />
> eetc....
>
>