Главная -> XML&... -> XSLT в примерах 
>> Страница 47 << | Назад | Вперед | Содержание | Указатель

Функция string() преобразует свой аргумент к строковому типу. Эта функция обычно не используется явно в преобразованиях, так как в большинстве случаев она вызывается по умолчанию. Преобразование 1 является примером конвертации чисел в строковой тип. Обратите внимание на результат деления на 0.

Преобразование 1

Исходный Surf
<source>

<number>9</number>
<number>0</number>
<number>-9</number>
<number/>

</source>

Результат
<P>9</P>
<P>NaN</P>
<P>9/0 = Infinity</P>
<P>-9/0 = -Infinity</P>
<P>0/0 = NaN</P>

Представление HTML

9

NaN

9/0 = Infinity

-9/0 = -Infinity

0/0 = NaN

Преобразование XSLT
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:variable name="A" select="number(//number[1])"/>
<xsl:variable name="B" select="number(//number[2])"/>
<xsl:variable name="C" select="number(//number[3])"/>
<xsl:variable name="D" select="number(//number[4])"/>
<xsl:template match="/">
     <P>
          <xsl:value-of select="string(number($A))"/>
     </P>
     <P>
          <xsl:value-of select="string(number($D))"/>
     </P>
     <P>
          <xsl:value-of select="$A"/>
          <xsl:text>/</xsl:text>
          <xsl:value-of select="$B"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="string($A div $B)"/>
     </P>
     <P>
          <xsl:value-of select="$C"/>
          <xsl:text>/</xsl:text>
          <xsl:value-of select="$B"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="string($C div $B)"/>
     </P>
     <P>
          <xsl:value-of select="$B"/>
          <xsl:text>/</xsl:text>
          <xsl:value-of select="$B"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="$B div $B"/>
     </P>
</xsl:template>


</xsl:stylesheet>

Raleigh.ruCopyright © 2002

Kevin Carr in Stanton

Natural Skin Care and European Soaps
TickTalk 5
city of stanton
internetusers

City Of Stanton | City Of Stanton | Warren Stanton Council and Gary Taylor Stanton | City Of Stanton |



Take a moment to visit obey clothing or see them on twitter at march madness tournament or view them on facebook at hawaiian luxury shoes.

These is the best pest and termite control business in Orange County. They are called Southern California Exterminators in Stanton.

There is another awesome Southern California Exterminators and they are named Southern California Exterminators in Stanton, CA.

You'll want to see both of these businesses.

Jeff Hiatt Orange Oil Specialists - KFI AM 640

I wrote a review about the apparel items below. You will want to do your research on these:

 

Take a moment to visit Men's Clothing Product Reviews and free stock videos or see them on twitter at Men's Clothing Product Reviews and free stock videos or view them on facebook at Men's Clothing Product Reviews and free stock videos.

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