XSLT Функции

Содержание

Коментарии

Building Sablotron on Solaris with.
gcc 3.0.3 and native linker
libtool (sunfreeware)
apache 1.3.24
php-4.2.1
sablotron-0.90
expat-1.95.2

When configuring Apache you might experience this error..

libsablot.so: undefined reference to `operator new[](unsigned)'
libsablot.so: undefined reference to `__cxa_call_unexpected'
libsablot.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libsablot.so: undefined reference to `operator delete(void*)'
libsablot.so: undefined reference to `__gxx_personality_v0'
libsablot.so: undefined reference to `vtable for __cxxabiv1::__class_type_info'
libsablot.so: undefined reference to `operator delete[](void*)'
libsablot.so: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
libsablot.so: undefined reference to `operator new(unsigned)'

To cure it make sure that during the configure stage you feed configure LDFLAGS variable like so.

LDFLAGS=' -lstdc++' ./configure

Otherwise Apache's compiler sanity check will balk.
2002-05-23 00:23:03
http://php5.kiev.ua/manual/ru/ref.xslt.html
In addition to "tk dot lists at fastmail dot fm"'s comment on Windows dependencies: You'll also need iconv.dll in your SYSTEM32 folder. At least, that's what I needed to get it working on my PHP4.2.3-Win install.
2002-09-27 11:09:07
http://php5.kiev.ua/manual/ru/ref.xslt.html
If you get problems with undefined references to gxx_s type stuff, UPDATE LIBTOOL!  I found 1.4.1 worked for some configurations, 1.4.3 worked for almost none, but 1.5 worked for every combination of Sablotron/gettext/sybase/zlib/postgres --with options I tried. 

Make sure you follow the advice of adding -lstdc++ to EXTRA_LD_FLAGS in Makefile after you've run ./configure, and BEFORE you've run make (if you issue make, you'll need to do a make clean before you make again, after changing the Makefile, or it still won't work reliably).

Cheers, Dave.
2003-05-27 12:14:34
http://php5.kiev.ua/manual/ru/ref.xslt.html
Another way to get around the EXPAT-SABLOTRON problems (seg faults) is supposedly to recompile apache with:
--disable-rule=EXPAT
2003-06-08 00:41:24
http://php5.kiev.ua/manual/ru/ref.xslt.html
As an update to the previous advice about the undefined references problem when installing PHP with Sablotron, PHP 4.3.4 has a new EXTRA_LDFLAGS_PROGRAM line added to the Makefile. Make sure to add -lstdc++ to this line as well as the EXTRA_LDFLAGS line.
2003-11-16 16:09:06
http://php5.kiev.ua/manual/ru/ref.xslt.html
Автор:
bat at flurf, you said that Sablotron implements XSLT 1.1, but according to its makers, "Sablotron is ...implementing XSLT 1.0, DOM Level2 and XPath 1.0" [http://www.gingerall.org/sablotron.html]
2006-08-06 06:18:09
http://php5.kiev.ua/manual/ru/ref.xslt.html
The XSLTProcessor, when transforming a document, always resolves entities.
To avoid this (if you want to keep HTML entitities by ex.), you have two solutions:

- if you have full control over the input document, you can encapsulate every text element which contains entities in a CDATA section.

- the previous solution is the smarter and the less computing intensive, but it is not always possible. In other cases, what you can do is to replace every occurence of '&' (entity mark) by something which will be considered as normal text by the parser (let's say '[AMP]' by ex) in the input document before the transformation. After the transformation, you can get these entitites back in the output document by reversing the previous operation.

<?php

$xml 
$input_dom->saveXML();
$xml str_replace('&''[AMP]'$xml);
$input_dom->loadXML($xml);

$xml $xsl->transformToXML($input_dom);
$xml str_replace('[AMP]''&'$xml);
$output_dom->loadXML($xml);

?>

Warning : this second method "escapes" ALL entities, even those you wouldn't want to be escaped. This is a raw explanation, fine-tune it to your own situation.
2007-07-13 01:27:32
http://php5.kiev.ua/manual/ru/ref.xslt.html
Автор:
In addition to the contibution of "tom at kornack dot com" about converting an Apple plist (iPhoto or iTunes library or other) into a more general XML format, I have tried to simplify his xsl file a little further:

<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="no"/>                 
<!-- XSL file based on example on php.net by tom@kornack.com -->

<xsl:template match="dict">                           
  <xsl:for-each select="key">
    <xsl:variable name="n1" select="translate(.,' ','_')"/>
    <xsl:variable name="pName"><xsl:choose>           
      <xsl:when test="string(number($n1))='NaN'">     
        <xsl:value-of select="$n1"/>                   
      </xsl:when>                                     
      <xsl:otherwise>                                 
        <xsl:value-of select="concat('_',$n1,'_')"/>   
      </xsl:otherwise>                                 
    </xsl:choose></xsl:variable>                       
    <xsl:element name="{$pName}">                     
      <xsl:apply-templates select="following-sibling::*[1]"/>
    </xsl:element>
  </xsl:for-each>
</xsl:template>

<xsl:template match="array">                           
  <xsl:for-each select="*"><xsl:element name="item">   
    <xsl:attribute name="nr"><xsl:number/></xsl:attribute>
    <xsl:apply-templates select="."/>                 
  </xsl:element></xsl:for-each>                       
</xsl:template>

<xsl:template match="string|integer|real|date|data">   
  <xsl:value-of select="."/>                           
</xsl:template>

<xsl:template match="true|false">                     
  <xsl:value-of select="name()"/>                     
</xsl:template>

<xsl:template match="text()|@*">                       
</xsl:template>

</xsl:transform>
2008-05-23 14:51:11
http://php5.kiev.ua/manual/ru/ref.xslt.html
How to make a XSLT Side with function 

<code> 
<xsl:output method="xhtml"/>
  <xsl:template match="/">
    <html>
      <head><title>Ausgabe</title></head>
      <body>
        <xsl:apply-templates select="aktien/aktie"></xsl:apply-templates>
      </body>
    </html>
 
  </xsl:template>
 
  <xsl:template match="aktie">
     <xsl:if test="@isin">
       <xsl:value-of select="name" />
       <xsl:value-of select="fn:format-number(fn:sum(kurse/kurs/ausgabepreis) div fn:count(kurse/kurs), '##.00')" />     
     </xsl:if> 
  </xsl:template>

</xsl:stylesheet>
</code>
2011-07-08 02:09:42
http://php5.kiev.ua/manual/ru/ref.xslt.html

    Поддержать сайт на родительском проекте КГБ