| <?xml version="1.0" encoding="iso-8859-1"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <!-- $Id: xhtml-common.xsl 153165 2005-02-10 06:01:01Z gregor $ --> |
| |
| <xsl:stylesheet version="1.0" |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| xmlns:xhtml="http://www.w3.org/1999/xhtml" |
| xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" |
| xmlns:dc="http://purl.org/dc/elements/1.1/" |
| > |
| |
| <xsl:template match="xhtml:body"> |
| <xsl:apply-templates mode="body"/> |
| </xsl:template> |
| |
| <xsl:template name="insertmenu"> |
| <xsl:param name="path"/> |
| <xsl:variable name="ns">namespace="http://www.w3.org/1999/xhtml"</xsl:variable> |
| <insert-after select="{$path}[@tagID='{@tagID}']"> |
| <element name="Paragraph" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:p" {$ns}>New Paragraph</xupdate:element></xupdate:insert-after>"/> |
| <element name="Table" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:table" {$ns}><tr><td>New Table</td></tr></xupdate:element></xupdate:insert-after>"/> |
| <element name="Unordered List" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:ul" {$ns}><li>New Unordered List</li></xupdate:element></xupdate:insert-after>"/> |
| <element name="Ordered List" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:ol" {$ns}><li>New Ordered List</li></xupdate:element></xupdate:insert-after>"/> |
| <element name="Headline 1" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h1" {$ns}>New Headline 1</xupdate:element></xupdate:insert-after>"/> |
| <element name="Headline 2" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h2" {$ns}>New Headline 2</xupdate:element></xupdate:insert-after>"/> |
| <element name="Headline 3" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h3" {$ns}>New Headline 3</xupdate:element></xupdate:insert-after>"/> |
| <element name="Headline 4" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h4" {$ns}>New Headline 4</xupdate:element></xupdate:insert-after>"/> |
| </insert-after> |
| </xsl:template> |
| |
| <xsl:template match="xhtml:p" mode="body"> |
| <xsl:choose > |
| <xsl:when test="xhtml:object"> |
| <xsl:apply-templates select="xhtml:object" mode="body"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <node name="Paragraph" select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']">" cols="80" rows="30"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:p</xsl:with-param></xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:template> |
| |
| <xsl:template match="xhtml:table" mode="body"> |
| <node name="Table" select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']">" cols="80" rows="30"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:table</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:ul" mode="body"> |
| <node name="Unordered List" select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']">" cols="80" rows="30"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:ul</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:ol" mode="body"> |
| <node name="Ordered List" select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']">" cols="80" rows="30"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:ol</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:h1" mode="body"> |
| <node name="Headline 1" select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']">" cols="80" rows="3"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h1</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:h2" mode="body"> |
| <node name="Headline 2" select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']">" cols="80" rows="3"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h2</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:h3" mode="body"> |
| <node name="Headline 3" select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']">" cols="80" rows="3"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h3</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:h4" mode="body"> |
| <node name="Headline 4" select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']">" cols="80" rows="3"> |
| <xsl:copy-of select="node()"/> |
| </textarea> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h4</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:hr" mode="body"> |
| <node name="Horizontal Rule" select="/*/xhtml:body/xhtml:hr[@tagID='{@tagID}']"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:hr[@tagID='{@tagID}']"/>"/></action> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:hr</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="xhtml:object" mode="body"> |
| <node name="Object"> |
| <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:p/xhtml:object[@tagID='{@tagID}']"/>"/></action> |
| <content> |
| <input type="text" name="<xupdate:update select="/*/xhtml:body/xhtml:p/xhtml:object[@tagID='{@tagID}']">" size="80"> |
| <xsl:attribute name="value"> |
| <xsl:value-of select="@data"/> |
| </xsl:attribute> |
| </input> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| <xsl:template match="lenya:asset" mode="body"> |
| <node name="Asset"> |
| <action> |
| <delete name="<xupdate:remove select="/*/xhtml:body/lenya:asset[@tagID='{@tagID}']"/>"/> |
| </action> |
| <content> |
| <input type="text" name="<xupdate:update select="/*/xhtml:body/lenya:asset[@tagID='{@tagID}']">" size="80"> |
| <xsl:attribute name="value"> |
| <xsl:value-of select="@src"/> |
| </xsl:attribute> |
| </input> |
| </content> |
| </node> |
| |
| <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body</xsl:with-param></xsl:call-template> |
| |
| </xsl:template> |
| |
| </xsl:stylesheet> |