XSL: If you perform a data validation and modify this data

0

I must admit that I do not deal with XSL, so I ask for help to understand and understand what I must do to obtain a value different from the one delivered by the XML. I require that the value 1 be modified to "Includes" and if the value is 2 a Does not include and if it is another data is equal to the one given in the XML, can someone help me on the subject

File: Data.xml

<?xml version="1.0"?>
<emailList>
  <person>
    <name>name 1</name>
    <email>[email protected]</email>
    <state>1</state>
  </person>
  <person>
    <name>name 2</name>
    <email>[email protected]</email>
    <state>0</state>
  </person>
    <person>
    <name>name 2</name>
    <email>[email protected]</email>
    <state>2</state>
  </person>
</emailList>

File: Transform.xsl

<html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
  <head>
    <title>Email Listing</title>
  </head>
  <body>
    <table>
      <tr>
        <th>Name</th>
        <th>E-mail Address</th>
        <th>State</th>
      </tr>
      <xsl:for-each select="emailList/person">
        <tr>
          <td><xsl:value-of select="name"/></td>
          <td><xsl:value-of select="email"/></td>
          <td><xsl:value-of select="state"/></td>
        </tr>
      </xsl:for-each>
    </table>
  </body>
</html>
    
asked by Madlosft 26.04.2018 в 17:55
source

0 answers