Jump to content

Table-rows with related elements


Guest xmlnono
 Share

Recommended Posts

Guest xmlnono

Hello,In this XML-file is a relation between the resource-elements: to every resource-element with type = alias belongs an other resource-element with type = local or type = remote. For these 3 types some of the content-elements are different.How can I build a table with 1 row for every resource-element with type = alias and at the same row the additional content of the related resource-element.WillemThe xml:[<?xml version="1.0" ?><?xml-stylesheet type="text/xsl" href="Que.xsl"?><config> <resource> <queue>QA-Apl-01-Req</queue> <type>ALIAS</type> <descr>alias Q, appl-01, request</descr> <targq>QR-Apl-01-Req</targq> </resource> <resource> <queue>QR-Apl-01-Req</queue> <type>REMOTE</type> <descr>rmt Q, appl-01, request</descr> <xmitq>QXmit</xmitq> </resource> <resource> <queue>QA-Apl-01-Rpl</queue> <type>ALIAS</type> <descr>alias Q, appl-01- reply</descr> <targq>QL-Apl-01-Rpl</targq> </resource> <resource> <queue>QL-Apl-01-Rpl</queue> <type>LOCAL</type> <descr>local Q, appl-01, reply</descr> </resource></config]The xsl:[<?xml version=1.0" standalone="no" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><html> <body> <h2>MQ-inrichting</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Queue</th> <th>Type</th><th>Description</th><th>TargetQ</th><th>TransmitQ</th></tr> <xsl:for-each select="config/resource[type='ALIAS]"> <tr> <td><xsl:value-of select="queue"/></td> <td><xsl:value-of select="type"/></td> <td><xsl:value-of select="descr"/></td> <td><xsl:value-of select="targq"/></td> <!--The following does not work --> <xsl:for-each select="config/resource[type=REMOTE]"> <td><xsl:value-of select="xmitq"/></td> </xsl:for-each></tr> </xsl:for-each> </table> </body> </html></xsl:template></xsl:stylesheet>]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...