Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: transposing to columns

From: "billdebug" <william.delaney@---.-----.--.-->
To: NULL
Date: 1/4/2006 9:56:00 AM
Joe,
thanks, the <th> tag solves part of my problem. I should have been more 
clear.
I want to dynamically pick up the row header by reading the xml element 
name. I tried using an xsl:element structure in my xslt but that did not 
work.
So, what would I put between the <th> to read the element name?
I can of course use the hardcoded values as you showed me below. That works, 
but I would prefer to read the xml element in case there are changes, or if 
I add more fields. Come to think of it, I have not even thought of looping 
through my elements fields till now.

anyway, thanks for this quick answer.

"Joe Fawcett" <joefawcett@n...> wrote in message 
news:%23TzTbeREGHA.344@T......
> "billdebug" <william.delaney@d...> wrote in message 
> news:eYSp43KEGHA.2648@T......
>>I have some xml data in the form:
>>
>>    <event>
>>        <Location>Amsterdam</Location>
>>        <RequestType>Blue</RequestType>
>>        <Severity>Critical</Severity>
>>    </event>
>>
>> I can use xslt to produce table with elements in event node horizontal, 
>> but what I want to achieve is:
>>
>> Location: Amsterdam
>> RequestType: Blue
>> Severity: Critical
>>
>> to display in the html table. Having trouble understanding how to 
>> tranpose the elements to this columnar arrangment.
>>
>
> Not sure if my newsreader has interpreted this correctly but, assuming you 
> have your <table>e lement something like:
>
> <xsl:template match="event">
>  <tr><th>Location:</th><td><xsl:value-of select="Location" /></td></tr>
>  <tr><th>RequestType:</th><td><xsl:value-of select="RequestType" 
> /></td></tr>
>  <tr><th>Severity:</th><td><xsl:value-of select="Severity" /></td></tr>
> </xsl:template>
>
>
> -- 
>
> Joe Fawcett (MVP - XML)
>
> https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent