472,127 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

XSL Display Attributes

Q) How to display table attributes in XSLT?

Solution applied -->
have a table s0Test1 attached to a class s0Test. The table has 4-5 attributes. I want to display them in HTML. I used:

Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="DBE:Object" mode="s0Test"> 
  2.   <table>
  3.     <tr>Test1</tr>
  4.     <tr>
  5.       <td><font size="2">*<xsl:apply-templates select="DBE:Attribute[@name='s0Test1']"/></font></td>
  6.     </tr>
  7.   </table>    
  8. </xsl:template>
Please let me know how should I go ahead to display the attributes?
Sep 14 '09 #1
5 3088
Dormilich
8,658 Expert Mod 8TB
@prao2005
how else will you get the solution?

nevermind. to get an unknow amount of attributes use the attribute axis.
Sep 14 '09 #2
Here the problem is that
class "s0Test" contains an attribute "s0Test1" which itself is a table
and has 4-5 attributes. I want to show child's child attributes.

At present i am unable to show it using the above mentioned code.
Sep 14 '09 #3
Dormilich
8,658 Expert Mod 8TB
@prao2005
that’s impossible, attribute values may only be strings (or numbers).
Sep 14 '09 #4
Suppose for eg. to display the below, what code can suffice in xsl?
s0ShipToTable might contain 25-30 rows.

Expand|Select|Wrap|Line Numbers
  1. <DBE: Attribute name=”s0ShipToTable” type=”Table”>
  2.       <DBE: Table>
  3.             <DBE: TableHeader>
  4.                   <DBE: TableColumn>…</DBE: TableColumn>
  5.                   <DBE: TableColumn>…</DBE: TableColumn>
  6.                   <DBE: TableColumn>…</DBE: TableColumn>
  7.                   <DBE: TableColumn>…</DBE: TableColumn>
  8.                  …
  9.             </DBE: TableHeader>
  10.             <DBE: TableRow>
  11.                   <DBE: TableData>…</DBE: TableData>
  12.                   <DBE: TableData>…</DBE: TableData>
  13.                   <DBE: TableData>…</DBE: TableData>
  14.                   <DBE: TableData>…</DBE: TableData>
  15.                   …
  16.             </DBE: TableRow>
  17.             <DBE: TableRow>
  18.                   <DBE: TableData>…</DBE: TableData>
  19.                   <DBE: TableData>…</DBE: TableData>
  20.                   <DBE: TableData>…</DBE: TableData>
  21.                   <DBE: TableData>…</DBE: TableData>
  22.                   …
  23.             </DBE: TableRow>
  24.             <DBE: TableRow>
  25.                   <DBE: TableData>…</DBE: TableData>
  26.                   <DBE: TableData>…</DBE: TableData>
  27.                   <DBE: TableData>…</DBE: TableData>
  28.                   <DBE: TableData>…</DBE: TableData>
  29.                   …
  30.             </DBE: TableRow>
  31.             …
  32.  
  33.       </DBE: Table>
  34. </DBE: Attribute>
Sep 15 '09 #5
Dormilich
8,658 Expert Mod 8TB
display what thereof how? best is you make an example of how your output shall look like and map that to the input. this should make clear, what to do.

PS. please use [CODE] [/CODE] tags when posting code.
Sep 15 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by DettCom | last post: by
6 posts views Thread by Developer | last post: by
5 posts views Thread by David Elliott | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.