codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  XSL Problem  pssuresh1979 at 09:29 on Thursday, December 02, 2004
 

Here is my sample XML


<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Table>
<empppgid>100002</empppgid>
<Name>Wyatt,Aasen</Name>
<email>aasen@ppg.com</email>
</Table>
<TableHeader>
<Name>Name</Name>
</TableHeader>
</NewDataSet>


Here is my sample XSL


<xsl:for-each select="NewDataSet">
<table border="1" cellpadding="0" cellspacing="1" width="100%" bordercolor="#CFCFCF">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<xsl:variable name="bcolor" select="0"></xsl:variable>
<tr>
<xsl:for-each select="child::TableHeader">
<tr>
<xsl:for-each select="child::*">
<th align="left" class="theader">
<xsl:value-of select="name()">
</xsl:value-of>
</th>
</xsl:for-each>
</tr>
<tr>
<td><br></br></td>
</tr>
</xsl:for-each>
</tr>
<tr>
<td><br></br></td>
</tr>

<xsl:for-each select="Table">
<tr bgcolor="white">
<xsl:for-each select="child::*">
<td>
<xsl:value-of select="text()">
</xsl:value-of>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</table>


I have attached XML and XSL code.My output has to be HTML after applying transformation. It should emit HTML elements only for the child Nodes in the <TableHeader> Tag.for e.g..My XML is given below.

Now <TableHeader> tag has two child node "Name" & "Function".So LastName & Email should not displayed in HTML

So the Html Output after passing the XPAth (NewDataSet/Tables)

1.Name
2.Function












CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Develop website with 3 tier architecture
•  Re: TaylorMade R11s Fairway Wood
•  Re:
•  What do you mean by ASP.NET MVC Execution Process?
•  Re:
•  Re:
•  one java progarm handle two socket connection
•  How to navigate database page?
•  "Fitting Wedges


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012