XSLT 元素

నిర్వచనం మరియు వినియోగం

<xsl:value-of> ఎలిమెంట్ ఎంచుకున్న ఎలిమెంట్ యొక్క విలువను ఎంచుకుని ఎగుమతి చేయవచ్చు.

<xsl:value-of> ఎలిమెంట్ ఒక XML ఎలిమెంట్ యొక్క విలువను ఎంచుకుని దానిని అవుట్పుట్ చేయడానికి ఉపయోగిస్తారు.

ప్రకటన:select అనునాది (అవసరమైనది) యొక్క విలువ ఏకైక XPath అభివ్యక్తి ఉంటుంది. ఇది ఫైల్ సిస్టమ్ ను అనుసరించడానికి పరిణామం చేస్తుంది, ఉదాహరణకు ఒక కట్ కంటైనర్ ను ఎంచుకునే ఒక స్లants ఉపయోగిస్తుంది.

విధానం

<xsl:value-of
select="expression"
disable-output-escaping="yes|no"/>

అనునంది

అనునంది విలువ వివరణ
select expression అవసరమైనది. XPath అభివ్యక్తి, విలువను నుండి పొందడానికి ఉపయోగిస్తుంది.
disable-output-escaping
  • yes
  • no

అప్రమేయం "no".

ఇది "yes" గా సెట్ చేస్తే, <xsl:text> ఎలిమెంట్ ద్వారా ప్రతిపాదించబడిన పదబంధం నిష్పత్తిలో ఏ మార్పిడి చేయబడదు.

ఉదాహరణకు, ఇది "yes" గా సెట్ చేస్తే, "<" మార్పిడి చేయబడదు.

ఇది "no" గా సెట్ చేస్తే, దానిని "<" గా అవుతుంది.

ఉదాహరణ

ఉదాహరణ 1

<?xml version="1.0" encoding="ISO-8859-1"?>
<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>
     </tr>
     <tr>
      <td><xsl:value-of select="catalog/cd/title"/></td>
      <td><xsl:value-of select="catalog/cd/artist"/></td>
     </tr>
   </table>
 </body>
 </html>
</xsl:template>
</xsl:stylesheet>

XML ఫైల్ను చూడండి,XSL ఫైల్ను చూడండి,ఫలితాలను చూడండి.

ఉదాహరణ 2

<?xml version="1.0" encoding="ISO-8859-1"?>
<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>
      </tr>
      <xsl:for-each select="catalog/cd">
      <tr>
        <td><xsl:value-of select="title"/></td>
        <td><xsl:value-of select="artist"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

XML ఫైల్ను చూడండి,XSL ఫైల్ను చూడండి,ఫలితాలను చూడండి.