r1701 - branches/bxe_2_0/xsl
[email protected] Sun, 12 Aug 2007 14:36:04 +0200 (CEST)
| Newsgroups | gmane.editors.bitflux.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: chregu
Date: Sun Aug 12 14:36:04 2007
New Revision: 1701
Log:
WS only
Modified:
branches/bxe_2_0/xsl/transformxsl.xsl
Modified: branches/bxe_2_0/xsl/transformxsl.xsl
==============================================================================
--- branches/bxe_2_0/xsl/transformxsl.xsl (original)
+++ branches/bxe_2_0/xsl/transformxsl.xsl Sun Aug 12 14:36:04 2007
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xslt="output.xsl">
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xslt="output.xsl">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:namespace-alias stylesheet-prefix="xslt" result-prefix="xsl"/>
@@ -11,17 +11,17 @@
</xsl:template>
- <xsl:template match="xsl:stylesheet">
+ <xsl:template match="xsl:stylesheet">
<xsl:copy>
- <xsl:for-each select="@*">
+ <xsl:for-each select="@*">
<xsl:copy/>
</xsl:for-each>
<!-- <xsl:copy-of select="document('elementpath.xsl')/root/*"/>-->
-
+
<xsl:apply-templates/>
- </xsl:copy>
-
+ </xsl:copy>
+
</xsl:template>
<!--
@@ -35,7 +35,7 @@
<xsl:for-each select="@*">
<xsl:copy/>
</xsl:for-each>
-
+
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
@@ -51,7 +51,7 @@
<xsl:element name="attribute" namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="name">__bxe_id</xsl:attribute>
<xsl:element name="value-of" namespace="http://www.w3.org/1999/XSL/Transform">
-
+
<xsl:choose>
<xsl:when test="contains(@select, '@')">
<xsl:attribute name="select">
@@ -75,7 +75,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-
+
<xsl:template name="copyValueOfNode">
<!-- attribute nodes... -->
<xsl:if test="contains(@select, '@')">
@@ -83,8 +83,8 @@
<xsl:attribute name="name">__bxe_attribute</xsl:attribute>
<xsl:value-of select="substring-after(@select,'@')"/>
</xsl:element>
-
+
</xsl:if>
<xsl:element name="copy-of" namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="select">
@@ -95,68 +95,86 @@
</xsl:choose>
</xsl:attribute>
</xsl:element>
-
+
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy/>
</xsl:for-each>
-
+
<xsl:apply-templates/>
</xsl:copy>
-
+
</xsl:template>
-
- <xsl:template match="*[((namespace-uri() = '' and xsl:apply-templates) or
- (namespace-uri()='http://www.w3.org/1999/XSL/Transform' and local-name()='element')) and not(@__bxe_id and @__bxe_id = 'none')]">
-
- <xsl:copy><xsl:for-each select="@*">
+
+ <xsl:template match="*[((namespace-uri() = '' and xsl:apply-templates) or (namespace-uri()='http://www.w3.org/1999/XSL/Transform' and local-name()='element')) and not(@__bxe_id and @__bxe_id = 'none')]">
+
+ <xsl:copy>
+ <xsl:for-each select="@*">
<xsl:copy/>
- </xsl:for-each><xsl:element name="attribute" namespace="http://www.w3.org/1999/XSL/Transform">
+ </xsl:for-each>
+ <xsl:element name="attribute" namespace="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute name="name">__bxe_id</xsl:attribute>
- <xsl:element name="value-of" namespace="http://www.w3.org/1999/XSL/Transform">
- <xsl:choose>
- <xsl:when test="@select"><xsl:attribute name="select"><xsl:value-of select="@select"/>/@__bxe_id</xsl:attribute></xsl:when>
- <xsl:otherwise><xsl:attribute name="select">@__bxe_id</xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </xsl:element>
+ <xsl:element name="value-of" namespace="http://www.w3.org/1999/XSL/Transform">
+ <xsl:choose>
+ <xsl:when test="@select">
+ <xsl:attribute name="select">
+ <xsl:value-of select="@select"/>/@__bxe_id</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="select">@__bxe_id</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:element>
- <xsl:element name="copy-of" namespace="http://www.w3.org/1999/XSL/Transform"><xsl:attribute name="select">@__bxe_defaultcontent</xsl:attribute></xsl:element>
-
- <xsl:apply-templates/></xsl:copy>
-
+ </xsl:element>
+ <xsl:element name="copy-of" namespace="http://www.w3.org/1999/XSL/Transform">
+ <xsl:attribute name="select">@__bxe_defaultcontent</xsl:attribute>
+ </xsl:element>
+
+ <xsl:apply-templates/>
+ </xsl:copy>
+
</xsl:template>
-
+
<xsl:template match="*[namespace-uri() = '' and (ancestor::xsl:template ) and not(descendant::xsl:value-of[not(contains(@select,'@') and not (contains(@select,'[')) and not( contains(substring-before(@select,'['),'@')))]) and not (descendant::xsl:apply-templates)]">
- <xsl:copy><xsl:call-template name="descendantOfTemplate"/></xsl:copy>
-
+ <xsl:copy>
+ <xsl:call-template name="descendantOfTemplate"/>
+ </xsl:copy>
+
</xsl:template>
-
+
<xsl:template name="descendantOfTemplate">
- <xsl:for-each select="@*">
- <xsl:copy/>
- </xsl:for-each>
- <xsl:if test="not(following-sibling::*/@__bxe_id) and (.//*[namespace-uri() = 'http://www.w3.org/1999/XSL/Transform'])">
-
+ <xsl:for-each select="@*">
+ <xsl:copy/>
+ </xsl:for-each>
+ <xsl:if test="not(following-sibling::*/@__bxe_id) and (.//*[namespace-uri() = 'http://www.w3.org/1999/XSL/Transform'])">
+
<xsl:element name="attribute" namespace="http://www.w3.org/1999/XSL/Transform">
-
+
<xsl:attribute name="name">__bxe_id</xsl:attribute>
- <xsl:element name="value-of" namespace="http://www.w3.org/1999/XSL/Transform">
- <xsl:choose>
- <xsl:when test="@select"><xsl:attribute name="select"><xsl:value-of select="@select"/>/@__bxe_id</xsl:attribute></xsl:when>
- <xsl:otherwise><xsl:attribute name="select">@__bxe_id</xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </xsl:element>
+ <xsl:element name="value-of" namespace="http://www.w3.org/1999/XSL/Transform">
+ <xsl:choose>
+ <xsl:when test="@select">
+ <xsl:attribute name="select">
+ <xsl:value-of select="@select"/>/@__bxe_id</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="select">@__bxe_id</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:element>
- </xsl:if>
- <xsl:element name="copy-of" namespace="http://www.w3.org/1999/XSL/Transform"><xsl:attribute name="select">@__bxe_defaultcontent</xsl:attribute></xsl:element>
-
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="copy-of" namespace="http://www.w3.org/1999/XSL/Transform">
+ <xsl:attribute name="select">@__bxe_defaultcontent</xsl:attribute>
+ </xsl:element>
- <xsl:apply-templates/>
+
+ <xsl:apply-templates/>
</xsl:template>
-
+
<xsl:template match="xsl:value-of[starts-with(@select,'py:')]">
<xsl:value-of select="@select"/>
</xsl:template>
@@ -165,15 +183,15 @@
<!-- rewrite a tags -->
-<xsl:template match="a|xhtml:a|script|xhtml:script|link|xhtml:link">
+ <xsl:template match="a|xhtml:a|script|xhtml:script|link|xhtml:link">
- <span class="{local-name()}" __bxe_ns="{namespace-uri()}">
- <xsl:for-each select="@*">
+ <span class="{local-name()}" __bxe_ns="{namespace-uri()}">
+ <xsl:for-each select="@*">
<xsl:copy/>
</xsl:for-each>
<xsl:apply-templates/>
- </span>
- </xsl:template>
+ </span>
+ </xsl:template>
</xsl:stylesheet>
--
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs