mercredi 17 juin 2020

How to access nested elements in an if statement XSLT

So I need to access a nested element in an if statement.

Below you can see an example of the XML I am using:

<Publication>
   <PubName>Avoid the Consumer Apps - How to Collaborate Securely and Productively in the Finance Sector</PubName>
   <Attributes>
    <Attribute>
     <AttributeName>Type</AttributeName>
     <Value>Webinar</Value>
     <ValueText>Webinar</ValueText>
    </Attribute>
   </Attributes>
  </Publication>

And here is the XSLT code I am using to try and get to the Webinar value:

<xsl:for-each select="TradePub.com/PublicationTable/Publication">
<xsl:if test="Attributes/Attribute/Value='Webinar'">
    <tr>
      <td><xsl:value-of select="PubName"/></td>
      <td><xsl:value-of select="PubCode"/></td>
    </tr>
</xsl:if>
</xsl:for-each>

But this returns nothings, so I am wondering how I can access the Value element?

Aucun commentaire:

Enregistrer un commentaire