You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2008/06/17 15:09:12 UTC

[DAISY] Updated: Tags

A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/1391.html

Document ID: 1391
Branch: main
Language: default
Name: Tags (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 6/17/08 1:09:02 PM
Updated by: Kamal Bhatt

A new version has been created, state: draft

Parts
=====

Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 18132 bytes (previous version: 16646 bytes)
Content diff:
(494 equal lines skipped)
      letter = g  <br/>  
     </pre>
    
+++ <h2>attribute</h2>
+++ 
+++ <p>The <tt>attribute </tt>tag allows the dynamic addition of attributes to any
+++ element tag. This includes dynamic specification of the attribute name.</p>
+++ 
+++ <pre>&lt;jx:attribute name="AttributeName" value="Attribute Value"/&gt;
+++ 
+++ &lt;jx:attribute name="AttributeName"&gt;Attribute Value&lt;/jx:attribute&gt;</pre>
+++ 
+++ <p>For example,</p>
+++ 
+++ <pre>&lt;Test&gt;
+++   &lt;jx:var name="foo" value="bar"/&gt;
+++   &lt;jx:attribute name="${attrName} value="Expression"/&gt;
+++ &lt;/Test&gt;
+++ </pre>
+++ 
+++ <p>The above template produces the following output:</p>
+++ 
+++ <pre>&lt;Test bar="tar"/&gt;
+++ </pre>
+++ 
+++ <h2>element</h2>
+++ 
+++ <p>The <tt>element</tt> tag allows the dynamic addition of element. This
+++ includes the dynamic specificatgion of the element name.</p>
+++ 
+++ <pre>&lt;jx:element name="AttributeName" [uri="NamespaceUri"] [prefix="Prefix"]&gt;
+++   ...
+++ &lt;/jx:element&gt;
+++ </pre>
+++ 
+++ <p>If a prefix is specified, then a namespace must also be specified. However, a
+++ namespace may be specified without a prefix.<tt><tt><tt> <tt>jx:element
+++ </tt></tt></tt></tt>may be used in conjunction with<tt> jx:attribute</tt>.</p>
+++ 
+++ <p>For example,</p>
+++ 
+++ <pre>&lt;jx:element name="AttributeAndChildNode"&gt;
+++   &lt;jx:attribute name="attribute" value="attr"/&gt;     
+++   &lt;ChildNode&gt;A&lt;/ChildNode&gt;
+++ &lt;/jx:element&gt;</pre>
+++ 
+++ <p>The above template produces the following output:</p>
+++ 
+++ <pre>&lt;AttributeAndChildNode attribute="attr"&gt;
+++   &lt;ChildNode&gt;A&lt;/ChildNode&gt;
+++ &lt;/AttributeAndChildNode&gt;</pre>
+++ 
    <h2>eval</h2>
    
    <p>The <tt>eval</tt> tag permits dynamic evaluation of custom tags.</p>
(71 equal lines skipped)