You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2004/01/14 03:07:02 UTC
cvs commit: cocoon-lenya/src/webapp/lenya/pubs/default/lenya/xslt/formeditor xhtml-common.xsl xhtml.xsl
gregor 2004/01/13 18:07:02
Modified: src/webapp/lenya/pubs/default/lenya/xslt/formeditor
xhtml.xsl
Added: src/webapp/lenya/pubs/default/lenya/xslt/formeditor
xhtml-common.xsl
Log:
improve form editor for xhtml doctype
Revision Changes Path
1.4 +10 -19 cocoon-lenya/src/webapp/lenya/pubs/default/lenya/xslt/formeditor/xhtml.xsl
Index: xhtml.xsl
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/lenya/xslt/formeditor/xhtml.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xhtml.xsl 7 Nov 2003 00:06:24 -0000 1.3
+++ xhtml.xsl 14 Jan 2004 02:07:02 -0000 1.4
@@ -2,30 +2,21 @@
<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:import href="../../../../../xslt/authoring/edit/form.xsl"/>
+<xsl:import href="xhtml-common.xsl"/>
-<xsl:template match="xhtml:html" 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/">
-<node name="Dublin Core">
-</node>
+<xsl:template match="xhtml:html">
<node name="Title" select="/xhtml:html/lenya:meta/dc:title[@tagID='{lenya:meta/dc:title/@tagID}']">
- <content><input type="text" name="<xupdate:update select="/xhtml:html/lenya:meta/dc:title[@tagID='{lenya:meta/dc:title/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:value-of select="lenya:meta/dc:title" /></xsl:attribute></input></content>
-</node>
-<node name="Description" select="/xhtml:html/lenya:meta/dc:description[@tagID='{lenya:meta/dc:description/@tagID}']">
- <content><input type="text" name="<xupdate:update select="/xhtml:html/lenya:meta/dc:description[@tagID='{lenya:meta/dc:description/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:value-of select="lenya:meta/dc:description" /></xsl:attribute></input></content>
+ <content><input type="text" name="<xupdate:update select="/xhtml:html/lenya:meta/dc:title[@tagID='{lenya:meta/dc:title/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:value-of select="lenya:meta/dc:title"/></xsl:attribute></input></content>
</node>
-<node name="XHTML">
-</node>
-<node name="Title" select="/xhtml:html/xhtml:head/xhtml:title[@tagID='{xhtml:head/xhtml:title/@tagID}']">
- <content><input type="text" name="<xupdate:update select="/xhtml:html/xhtml:head/xhtml:title[@tagID='{xhtml:head/xhtml:title/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:value-of select="xhtml:head/xhtml:title" /></xsl:attribute></input></content>
-</node>
-<!--
-<node name="H1 Title">
- <content><input type="text" name="<xupdate:update select="/xhtml:html/xhtml:body/xhtml:h1[@tagID='{xhtml:body/xhtml:h1/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:value-of select="xhtml:body/xhtml:h1" /></xsl:attribute></input></content>
-</node>
--->
+<xsl:apply-templates select="xhtml:body"/>
+
</xsl:template>
-
-</xsl:stylesheet>
+
+</xsl:stylesheet>
1.1 cocoon-lenya/src/webapp/lenya/pubs/default/lenya/xslt/formeditor/xhtml-common.xsl
Index: xhtml-common.xsl
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<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/"
xmlns:unizh="http://unizh.ch/doctypes/elements/1.0"
>
<xsl:template match="xhtml:body">
<node name="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 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">
<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="40" 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: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="40" rows="30">
<xsl:copy-of select="."/>
</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="40" 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="40" 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: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="40" 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="40" 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="40" 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:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org