XML/XSLT stylesheet/abbreviation — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 11:26, 26 мая 2010

apply-templates select="*"

   <source lang="xml">

File: Data.xml <?xml version="1.0"?>

<start_date xmlns="http://www.wbex.ru">1999-07-25</start_date> File: Transform.xslt <?xml version="1.0"?> <xsl:stylesheet version="1.0"

 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/">
   <xsl:apply-templates select="*"/>
 </xsl:template>

</xsl:stylesheet> Output: <?xml version="1.0" encoding="UTF-8"?>1999-07-25

</source>
   
  


for-each select="@*"

   <source lang="xml">

File: Data.xml <?xml version="1.0"?>

<start_date xmlns="http://www.wbex.ru">1999-07-25</start_date> File: Transform.xslt <?xml version="1.0"?> <xsl:stylesheet version="1.0"

 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="*">
   <xsl:copy>
     <xsl:for-each select="@*">
       <xsl:copy/>
     </xsl:for-each>
     <xsl:apply-templates/>
   </xsl:copy>
 </xsl:template>

</xsl:stylesheet> Output: <?xml version="1.0" encoding="UTF-8"?><start_date xmlns="http://www.wbex.ru">1999-07-25</start_date>

</source>
   
  


template match="/"

   <source lang="xml">

File: Data.xml <?xml version="1.0"?>

<start_date xmlns="http://www.wbex.ru">1999-07-25</start_date> File: Transform.xslt <?xml version="1.0"?> <xsl:stylesheet version="1.0"

 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/">
   <xsl:copy-of select="*"/>
 </xsl:template>

</xsl:stylesheet> Output: <?xml version="1.0" encoding="UTF-8"?><start_date xmlns="http://www.wbex.ru">1999-07-25</start_date>

</source>