is it possible to use left angle bracket in xsl

Discussion in 'XML' started by antonycsf, Mar 26, 2011.

  1. antonycsf

    antonycsf

    Joined:
    Mar 26, 2011
    Messages:
    1
    I have tried to use the < and > token in

    <xsl:if test="company = 'CBS &lt;&gt; Records'">

    but still fail to run the xsl.

    Is it possible to do it?

    You can paste and test the code at here
    http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog_if


    Anyone can help, thanks!

    Antony
    :adore:

    xml file
    ============================================================
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Edited by XMLSpy?-->
    <catalog>
      <cd>
      <title>Hide your heart</title>
      <artist>Bonnie Tyler</artist>
      <country>UK</country>
      <company>CBS <![CDATA[<>]]> Records</company>
      <price>9.90</price>
      <year>1988</year>
     </cd>
     <cd>
      <title>Greatest Hits</title>
      <artist>Dolly Parton</artist>
      <country>USA</country>
      <company>RCA</company>
      <price>9.90</price>
      <year>1982</year>
     </cd>
     <cd>
      <title>Still got the blues</title>
      <artist>Gary Moore</artist>
      <country>UK</country>
      <company>Virgin records</company>
      <price>10.20</price>
      <year>1990</year>
     </cd>
     <cd>
      <title>Unchain my heart</title>
      <artist>Joe Cocker</artist>
      <country>USA</country>
      <company>EMI</company>
      <price>8.20</price>
      <year>1987</year>
     </cd>
    </catalog>



    xls file
    ============================================================
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Edited by XMLSpy?-->
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
      <html>
      <body>
        <h2>My CD Collection</h2>
        <table border="1">
          <tr bgcolor="#9acd32">
          <th>Title</th>
          <th>Artist</th>
          <th>Company</th>
        </tr>
        <xsl:for-each select="catalog/cd">
        <xsl:if test="company = 'CBS &lt;&gt; Records'">
          <tr>
            <td><xsl:value-of select="title"/></td>
            <td><xsl:value-of select="artist"/></td>
     <td><xsl:value-of select="company"/></td>
         </tr>
        </xsl:if>
        </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet>
    Last edited: Mar 26, 2011
    antonycsf, Mar 26, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. schaf@2wire.ch
    Replies:
    1
    Views:
    3,588
    A. Bolmarcich
    May 27, 2005
  2. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Help on table align on left of page vs left hanging indent

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Jul 10, 2007, in forum: XML
    Replies:
    2
    Views:
    987
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Jul 16, 2007
  3. skippyd277@yahoo.com
    Replies:
    1
    Views:
    2,213
    Pavel Lepin
    Mar 14, 2008
  4. winterTTr
    Replies:
    2
    Views:
    346
    winterTTr
    Apr 29, 2009
  5. pc
    Replies:
    2
    Views:
    1,293
    crisgoogle
    Jun 8, 2011
Loading...

Share This Page