English | Français | Deutsch | Magyar | 中文 | >> Polski << adultinternetusers > Tutorials > XSLT Tutorial
>> Strona 66 << | Poprzedni | Następny | Zawartość | Indeks elementu

Funkcja generate-id() tworzy identyfikator zgodny z specyfikacją Surf. Arkusz stylów XSLT 2 używa tej funkcji by dodać identyfikator do wszystkich elementów w źródłowym pliku Surf.

Arkusz stylów XSLT 1

Źródło Surf
<source>

<AAA name="top">
     <BBB pos="1" val="bbb">11111</BBB>
     <BBB>22222</BBB>
</AAA>
<AAA name="bottom">
     <BBB>33333</BBB>
     <BBB>44444</BBB>
</AAA>

</source>

Dane wyjściowe
<DIV>
  <B>generate-id(//AAA) : </B>d0e3</DIV>
<DIV>
  <B>generate-id(//BBB) : </B>d0e5</DIV>
<DIV>
  <B>generate-id(//AAA[1]) : </B>d0e3</DIV>
<DIV>
  <B>generate-id(//*[1]) : </B>d0e1</DIV>
<DIV>
  <B>generate-id(//xslTutorial/*[1]) : </B>
</DIV>

Widok HTML
generate-id(//AAA) : d0e3
generate-id(//BBB) : d0e5
generate-id(//AAA[1]) : d0e3
generate-id(//*[1]) : d0e1
generate-id(//xslTutorial/*[1]) :
Arkusz stylów XSLT
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <DIV>
          <B>
               <xsl:text>generate-id(//AAA) : </xsl:text>
          </B>
          <xsl:value-of select="generate-id(//AAA) "/>
     </DIV>
     <DIV>
          <B>
               <xsl:text>generate-id(//BBB) : </xsl:text>
          </B>
          <xsl:value-of select="generate-id(//BBB) "/>
     </DIV>
     <DIV>
          <B>
               <xsl:text>generate-id(//AAA[1]) : </xsl:text>
          </B>
          <xsl:value-of select="generate-id(//AAA[1]) "/>
     </DIV>
     <DIV>
          <B>
               <xsl:text>generate-id(//*[1]) : </xsl:text>
          </B>
          <xsl:value-of select="generate-id(//*[1]) "/>
     </DIV>
     <DIV>
          <B>
               <xsl:text>generate-id(//xslTutorial/*[1]) : </xsl:text>
          </B>
          <xsl:value-of select="generate-id(//xslTutorial/*[1]) "/>
     </DIV>
</xsl:template>


</xsl:stylesheet>



Arkusz stylów XSLT 2

Źródło Surf
<source>

<AAA name="top">
     <BBB pos="1" val="bbb">11111</BBB>
     <BBB>22222</BBB>
</AAA>
<AAA name="bottom">
     <BBB>33333</BBB>
     <BBB>44444</BBB>
</AAA>

</source>

Dane wyjściowe
<source id="d0e1">

  <AAA id="d0e3" name="top">

     <BBB id="d0e5" pos="1" val="bbb">11111</BBB>

     <BBB id="d0e8">22222</BBB>

  </AAA>

  <AAA id="d0e12" name="bottom">

     <BBB id="d0e14">33333</BBB>

     <BBB id="d0e17">44444</BBB>

  </AAA>

</source>

Widok HTML
11111 22222 33333 44444
Arkusz stylów XSLT
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="*">
     <xsl:copy>
          <xsl:attribute name="id">
               <xsl:value-of select="generate-id()"/>
          </xsl:attribute>
          <xsl:for-each select="@*">
               <xsl:attribute name="{name()}">
                    <xsl:value-of select="."/>
               </xsl:attribute>
          </xsl:for-each>
          <xsl:apply-templates/>
     </xsl:copy>
</xsl:template>


</xsl:stylesheet>


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 1cecilia438 or see them on twitter at 1cecilia410 or view them on facebook at hawaiian luxury shoes.

Take a moment to visit 1cecilia448 or see them on twitter at 1cecilia448 or view them on facebook at 1cecilia448.

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