Connecting Tech Pros Worldwide Forums | Help | Site Map

XSL Display Attributes

Newbie
 
Join Date: Sep 2009
Posts: 18
#1: Sep 14 '09
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?

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,664
#2: Sep 14 '09

re: XSL Display Attributes


Quote:

Originally Posted by prao2005 View Post

Please let me know how should I go ahead to display the attributes?

how else will you get the solution?

nevermind. to get an unknow amount of attributes use the attribute axis.
Newbie
 
Join Date: Sep 2009
Posts: 18
#3: Sep 14 '09

re: XSL Display Attributes


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.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,664
#4: Sep 14 '09

re: XSL Display Attributes


Quote:

Originally Posted by prao2005 View Post

class "s0Test" contains an attribute "s0Test1" which itself is a table and has 4-5 attributes.

that’s impossible, attribute values may only be strings (or numbers).
Newbie
 
Join Date: Sep 2009
Posts: 18
#5: Sep 15 '09

re: XSL Display Attributes


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>
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,664
#6: Sep 15 '09

re: XSL Display Attributes


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.
Reply