Is there a possible way to go about the following:
You can have two columns, one titled 'sign' the other 'post'. But to only show what one is actually in use? (if you have 400 customers, then those who signed have a <th> saying Sigh Via etc where as if they received by post then the PostID and other <th> appears in the table).
I was using this method:
<th> Sign Via</th>
<th> Sign Name</th>
<th> Sign Address</th>
<th> Sign City</th>
<xsl:for-each select="delivery/sign">
<td><xsl:value-of select="SignVia"/></td>
<td><xsl:value-of select="SignName"/></td>
<td><xsl:value-of select="SignAddress"/></td>
<td><xsl:value-of select="SignCity"/></td></xsl:for-each>
<th> Post ID</th>
<th> Post Date</th>
<th> Post Address</th>
<xsl:for-each select="delivery/post">
<td>
<xsl:value-of select="postID"/>
</td>
<td>
<xsl:value-of select="postDate"/>
</td>
<td>
<xsl:value-of select="postAddress"/>
</td>
</xsl:for-each>
I attempted to add in an XSL choose statement:
<xsl:choose>
<xsl:when test="PostID">
<td>
<xsl:value-of select="postID"/>
</td>
<td>
<xsl:value-of select="postDate"/>
</td>
<td>
<xsl:value-of select="postAddress"/>
</td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="SignVia"/></td>
<td><xsl:value-of select="SignName"/></td>
<td><xsl:value-of select="SignAddress"/></td>
<td><xsl:value-of select="SignCity"/></td>
</xsl:for-each>
</xsl:otherwise>
I am extremely new to XSL and XML and using W3 tutorials to get me through each stage, however I think I am missing something as I can't find a way to do this whilst using
Cheers in advance.
No comments:
Post a Comment