English | Français | Deutsch | Magyar | >> 中文 << | Polski adultinternetusers > Tutorials > XSLT Tutorial
>> 页 27 << | 上一条 | 下一条 | 目录 | 元素索引

元素 xsl:choose 用来在多种可能中进行选择。

XSLT stylesheet 1

XML源码
<source>

<SECTION>
     <DATA>I need a pen.</DATA>
     <DATA>I need some paper.</DATA>
     <SUMMARY>I need a pen and some paper</SUMMARY>
</SECTION>
<SECTION>
     <DATA>I need bread.</DATA>
     <DATA>I need butter.</DATA>
</SECTION>

</source>

输出
<P>SUMMARY: I need a pen and some paper</P>

<P>DATA: I need bread.</P>
<P>DATA: I need butter.</P>

用HTML察看

SUMMARY: I need a pen and some paper

DATA: I need bread.

DATA: I need butter.

XSLT stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="//SECTION">
     <xsl:choose>
          <xsl:when test="SUMMARY">
               <P>
                    <xsl:text>SUMMARY: </xsl:text>
                    <xsl:value-of select="SUMMARY"/>
               </P>
          </xsl:when>
          <xsl:otherwise>
               <xsl:for-each select="DATA">
                    <P>
                         <xsl:text>DATA: </xsl:text>
                         <xsl:value-of select="."/>
                    </P>
               </xsl:for-each>
          </xsl:otherwise>
     </xsl:choose>
</xsl:template>


</xsl:stylesheet>


Kevin Carr in Stanton

Natural Skin Care and European Soaps
Kevin Carr
Mayor Dave Shawver Stanton
Internetusers

Dave Shawver Stanton | City Of Stanton Election 2019 Voting Information | Warren Stanton Council and Gary Taylor Stanton | Mayor Dave Shawver Stanton |



Take a moment to visit men's western boots or see them on twitter at cowboy boots mens or view them on facebook at hawaiian luxury shoes.

Take a moment to visit cowboy boots and free stock videos or see them on twitter at cowboy boots and free stock videos or view them on facebook at cowboy boots and free stock videos.

Don't forget to check out the following links. You'll be glad you did:

You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks