469,352 Members | 1,892 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

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 2968
Dormilich
8,652 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,652 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,652 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
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.