The ephox:autoaddbuttons attribute allows the automatically generated action buttons to be suppressed. By default, EditLive! for XML automatically detects optional and repeating elements and optional attributes then automatically inserts action buttons to allow the user to add and remove them. In some situations, the designer of the XSLT may wish to manually position these buttons or to not provide them at all and the ephox:autoaddbuttons attribute enables developers to prevent EditLive! for XML automatically adding action buttons.
ephox:autoaddbuttons attribute can be used within three XSL elements:
template elements
apply-templates elements
for-each elements
The ephox:autoaddbuttons attribute is only of use in XSL elements when they cause action buttons to be inserted. For more information on when EditLive! for XML will automatically add action buttons when processing XSL elements please see the section on Automatically Added Buttons.
The ephox:autoaddbuttons attribute requires a boolean value of either true or false.
When set to true EditLive! for XML will automatically provide action buttons when processing the element containing the ephox:autoaddbuttons attribute.
When set to false EditLive! for XML will not provide action buttons for the element containing the ephox:autoaddbuttons attribute.
The example below uses the ephox:autoaddbuttons attribute to prevent any action buttons from being inserted for the specified element.
<?xml version="1.0" encoding="US-ASCII"?>
<xs:stylesheet version="1.0"
xmlns:xs="http://www.w3.org/1999/XSL/Transform"
xmlns:my="http://www.ephox.com/product/editliveforxml/document/Untitled"
xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0"
xmlns="http://www.w3.org/1999/xhtml">
<xs:template match="/">
<html>
<head/>
<body>
<!-- The ephox:autoaddbuttons="false" attribute prevents an insert
button from automatically being generated if the element
doesn't exist in the document. -->
<xs:apply-templates select="my:document/my:repeatingElement"
ephox:autoaddbuttons="false"/>
</body>
</html>
</xs:template>
<!-- The ephox:autoaddbuttons="false" attribute prevents EditLive! for XML
from automatically inserting a remove and insert after button for each
element in the document. -->
<xs:template match="my:repeatingElement" ephox:autoaddbuttons="false">
<p>Value: <xs:value-of select="." /></p>
</xs:template>
</xs:stylesheet>When using for-each elements, the example would look like:
<?xml version="1.0" encoding="US-ASCII"?>
<xs:stylesheet version="1.0"
xmlns:xs="http://www.w3.org/1999/XSL/Transform"
xmlns:my="http://www.ephox.com/product/editliveforxml/document/Untitled"
xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0"
xmlns="http://www.w3.org/1999/xhtml">
<xs:template match="/">
<html>
<head></head>
<body>
<!-- The ephox:autoaddbuttons="false" attribute prevents any action
buttons from being automatically inserted. -->
<xs:for-each select="my:document/my:repeatingElement"
ephox:autoaddbuttons="false">
<p>Value: <xs:value-of select="." /></p>
</xs:for-each>
</body>
</html>
</xs:template>
</xs:stylesheet>Copyright 2001-2004 Ephox Corporation. All Rights Reserved.