incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r795795 - /websites/staging/odftoolkit/trunk/content/odftoolkit/odfdom/ODFDOM-Code-Generator.html
Date Thu, 15 Sep 2011 08:45:32 GMT
Author: buildbot
Date: Thu Sep 15 08:45:32 2011
New Revision: 795795

Log:
Staging update by buildbot

Modified:
    websites/staging/odftoolkit/trunk/content/odftoolkit/odfdom/ODFDOM-Code-Generator.html

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/odfdom/ODFDOM-Code-Generator.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/odfdom/ODFDOM-Code-Generator.html
(original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/odfdom/ODFDOM-Code-Generator.html
Thu Sep 15 08:45:32 2011
@@ -21,7 +21,7 @@
 
 <link href="/odftoolkit/css/odf.css" rel="stylesheet" type="text/css">
 
-<title></title>
+<title>ODFDOM Code Generator</title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
 </head>
@@ -77,149 +77,159 @@
   </div>
   <div id="contenta">
   
-    
-    <p>=ODFDOM Code Generator=</p>
-<p>The ODFDOMCodeGenerator is a java application to create source code for elements
and attributes that are defined using relaxng schema.
+    <h1 class="title">ODFDOM Code Generator</h1>
+    <p>The ODFDOMCodeGenerator is a java application to create source code for elements
and attributes that are defined using relaxng schema.
 It is used in the [[Home|ODFDOM]] project to generate the java source files for the elements
available in the OpenDocument format.</p>
-<p>= Usage =</p>
+<h2 id="usage">Usage</h2>
 <p>To generate source code files, start the application with</p>
-<p>java -jar ODFDOMCodeGenerator.jar your-schema.rng your-config.xml your-template.xml
/your/target/directory</p>
-<p>Please not, if you use the [[Home|ODFDOM]] project, you can change the setting 'gen-flat-odf-schema'
inside the user.properties file
+<div class="codehilite"><pre><span class="n">java</span> <span
class="o">-</span><span class="n">jar</span> <span class="n">ODFDOMCodeGenerator</span><span
class="o">.</span><span class="n">jar</span> <span class="n">your</span><span
class="o">-</span><span class="n">schema</span><span class="o">.</span><span
class="n">rng</span> <span class="n">your</span><span class="o">-</span><span
class="n">config</span><span class="o">.</span><span class="n">xml</span>
<span class="n">your</span><span class="o">-</span><span class="n">template</span><span
class="o">.</span><span class="n">xml</span> <span class="sr">/your/</span><span
class="n">target</span><span class="o">/</span><span class="n">directory</span>
+</pre></div>
+
+
+<p>Please not, if you use the ODFDOM project, you can change the setting 'gen-flat-odf-schema'
inside the user.properties file
 to 'true' and the next build will use the 'schema/OpenDocument-schema-v1.1.rng' schema, the
'codegen/config.xml' config file,
 the 'codegen/javacodetemplate.xml' template file and the src directory of the project as
the target directory. This will override
 all generated code files in your project.</p>
-<p>= The config file =</p>
+<h2 id="the-config-file">The config file</h2>
 <p>The config file must be an xml file with the following structure</p>
-<p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-  &lt;config&gt;
-  &lt;elements&gt;
-  &lt;element .../&gt;
-  &lt;element .../&gt;
-  ...
-  &lt;/elements&gt;
-  &lt;data-types&gt;
-  &lt;data .../&gt;
-  &lt;data .../&gt;
-  ...
-  &lt;/data-types&gt;
-  &lt;attributes&gt;
-  &lt;attribute .../&gt;
-  &lt;attribute .../&gt;
-  &lt;attribute .../&gt;
-  ...
-  &lt;/attributes&gt;
-  &lt;/config&gt;</p>
-<p>== Element ==</p>
+<p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;  <br />
+  &lt;config&gt;   <br />
+  &lt;elements&gt;   <br />
+  &lt;element .../&gt;   <br />
+  &lt;element .../&gt;    <br />
+  ...   <br />
+  &lt;/elements&gt;   <br />
+  &lt;data-types&gt;   <br />
+  &lt;data .../&gt;   <br />
+  &lt;data .../&gt;  <br />
+  ...  <br />
+  &lt;/data-types&gt;  <br />
+  &lt;attributes&gt;  <br />
+  &lt;attribute .../&gt; <br />
+  &lt;attribute .../&gt;  <br />
+  &lt;attribute .../&gt;   <br />
+  ...  <br />
+  &lt;/attributes&gt;   <br />
+  &lt;/config&gt;  <br />
+</p>
+<h2 id="element">Element</h2>
 <p>The &lt;element&gt; element supports the following attributes</p>
-<p>=== Name ===</p>
+<p><strong>Name</strong></p>
 <p>The mandatory attribute 'name' selects the element from the relaxng schema with
its qualified name (qname).</p>
-<p>=== Rename ===</p>
+<p><strong>Rename</strong></p>
 <p>The optional attribute 'rename' changes the variable 'elementname' for this element.
 This can be used f.e. to give an element like &lt;text:a&gt; a more readable implementation
name like &lt;text:anchor&gt;</p>
-<p>=== Base ===</p>
+<p><strong>Base</strong></p>
 <p>The optional attribute 'base' changes the variable 'elementbasename' for this element.</p>
-<p>=== Family ===</p>
+<p><strong>Family</strong></p>
 <p>The optional attribute 'family' changes the variable 'elementstylefamily' for this
element.</p>
-<p>== Attribute ==</p>
+<h2 id="attribute">Attribute</h2>
 <p>The &lt;attribute&gt; element supports the following attributes</p>
-<p>=== Name ===</p>
+<p><strong>Name</strong></p>
 <p>The mandatory attribute 'name' selects the attribute from the relaxng schema with
its qname.</p>
-<p>=== Element ===</p>
+<p><strong>Element</strong></p>
 <p>The optional attribute 'element' selects only the attributes with the qname given
by the attribute 'name'
 with the elements qname.</p>
-<p>=== Rename ===</p>
+<p><strong>Rename</strong></p>
 <p>The optional attribute 'rename' changes the variable 'attributename' for the selected
attributes.
 This can be used f.e. to avoid generating getter/setter methods which names collide with
base class methods.</p>
-<p>=== Type-name ===</p>
+<p><strong>Type-name</strong></p>
 <p>The optional attribute 'type-name' changes the variable 'conversiontype' for the
selected attributes.
 This can be used f.e. to have different attributes from multiple elements with the same defined
values
 to use a shared class for conversions.</p>
-<p>== Data ==</p>
+<h2 id="data">Data</h2>
 <p>The &lt;data&gt; element supports the following attributes</p>
-<p>=== Name ===</p>
+<p><strong>Name</strong></p>
 <p>The mandatory attribute 'name' selects the data type by its qname. Data types are
the types defined in the relaxng
 schema by the &lt;data&gt; elements inside the &lt;attribute&gt; element.
The name can also be the name of a &lt;ref&gt;
 element. In that case the processing of the relaxng schema stops at this &lt;ref&gt;
element and the configuration
 from this element is used.</p>
-<p>=== Value-type ===</p>
+<p><strong>Value-type</strong></p>
 <p>The mandatory attribute 'value-type' changes the variable 'valuetype' for attributes
using this data-type.</p>
-<p>=== Conversion-type ===</p>
+<p><strong>Conversion-type</strong></p>
 <p>The optional attribute 'conversion-type' changes the variable 'conversion-type'
for attributes using this data-type.
 If this attribute is not available, the variable 'conversion-type' will have the same value
as the variable 'valuetype'.</p>
-<p>= The template file =</p>
+<h2 id="the-template-file">The template file</h2>
 <p>The template file must be a valid xml file with the element &lt;template&gt;
as the root element. It can contain
 the following elements</p>
-<p>== Code ==</p>
+<h2 id="code">Code</h2>
 <p>The &lt;code&gt; element outputs the characters inside this element to the
current output file.
 The characters are scanned for expressions before written to the file.</p>
 <p>&lt;code&gt;
   // this element generates a comment
 &lt;/code&gt;<br />
 </p>
-<p>== Define ==</p>
+<h2 id="define">Define</h2>
 <p>The &lt;define&gt; element does not execute its child elements but remembers
them with the given name for later
 use with the &lt;ref&gt; element.</p>
 <p>The mandatory attribute 'name' gives the name for this define.</p>
-<p>&lt;define name="header"&gt;
-  &lt;code&gt;
-  // This file uses the gpl
-  // Do not edit this file as it is automaticaly generated!
-  &lt;/code&gt;
-&lt;/define&gt;</p>
-<p>== Ref ==</p>
+<p>&lt;define name="header"&gt;  <br />
+  &lt;code&gt;  <br />
+  // This file uses the gpl  <br />
+  // Do not edit this file as it is automaticaly generated! <br />
+  &lt;/code&gt;  <br />
+&lt;/define&gt;  <br />
+</p>
+<h2 id="ref">Ref</h2>
 <p>The &lt;ref&gt; element executes the child elements of a &lt;define&gt;
element with the same name.</p>
 <p>The mandatory attribute 'name' selects the &lt;define&gt; by its attribute
'name'.</p>
 <ref name="header"/>
 
-<p>== If ==</p>
+<p>If
+--</p>
 <p>The &lt;if&gt; element executes its child elements only if the evaluated
expression from its attribute 'test' is
 a non empty string and not the string constant 'false'.</p>
 <p>The mandatory attribute 'test' is evaluated as an expression.</p>
-<p>&lt;if test="elementname='text:a'&gt;
-  &lt;code&gt;
-    // interface for links
-    public String getLink();
-    public void setLink( String newLink );
-  &lt;/code&gt;
-  &lt;/if&gt;</p>
-<p>== Else ==</p>
+<p>&lt;if test="elementname='text:a'&gt;   <br />
+  &lt;code&gt; <br />
+    // interface for links <br />
+    public String getLink();  <br />
+    public void setLink( String newLink );  <br />
+  &lt;/code&gt;  <br />
+  &lt;/if&gt; <br />
+</p>
+<h2 id="else">Else</h2>
 <p>The &lt;else&gt; element is always ignored, except if it is a child element
inside an &lt;if&gt; element and the
 test attribute was evaluated to 'false' or an empty string.</p>
-<p>&lt;if test="elementbasename=''"&gt;
-  &lt;code&gt;
-  class %{elementname} extends DefaultElement
-  &lt;/code&gt;
-  &lt;else&gt;
-  &lt;code&gt;
-  class %{elementname} extends %{elementbasename}
-  &lt;/code&gt;
-  &lt;/else&gt;
+<p>&lt;if test="elementbasename=''"&gt;  <br />
+  &lt;code&gt;   <br />
+  class %{elementname} extends DefaultElement   <br />
+  &lt;/code&gt;  <br />
+  &lt;else&gt;  <br />
+  &lt;code&gt;  <br />
+  class %{elementname} extends %{elementbasename}  <br />
+  &lt;/code&gt;  <br />
+  &lt;/else&gt;  <br />
   &lt;/if&gt;</p>
-<p>== Set ==</p>
+<h2 id="set">Set</h2>
 <p>The &lt;set&gt; element changes all variables with the names of the given
attributes to their values. The values
 are scanned for expressions before assignement.</p>
-<p>&lt;set elementname="Hyperlink"/&gt;
-  &lt;set elementclassname="Odf%{elementname}Element"/&gt;
-  &lt;code&gt;
-  class %{elementclassname} extends OdfElement
-  {
-  }
-  &lt;/code&gt;</p>
+<p>&lt;set elementname="Hyperlink"/&gt;  <br />
+  &lt;set elementclassname="Odf%{elementname}Element"/&gt;  <br />
+  &lt;code&gt;   <br />
+  class %{elementclassname} extends OdfElement  <br />
+  { <br />
+  } <br />
+  &lt;/code&gt;  <br />
+</p>
 <p>will output</p>
-<p>class OdfHyperlinkElement extends OdfElement
-  {
-  }</p>
-<p>== Foreach ==</p>
+<div class="codehilite"><pre>  <span class="n">class</span> <span
class="n">OdfHyperlinkElement</span> <span class="n">extends</span> <span
class="n">OdfElement</span>   
+  <span class="p">{</span>  
+  <span class="p">}</span>
+</pre></div>
+
+
+<h2 id="foreach">Foreach</h2>
 <p>The &lt;foreach&gt; element executes its child elements once for all objects
of the given type from the relaxng schema.</p>
 <p>The mandatory attribute 'type' must have one of the following values</p>
-<p>=== 'element' ===</p>
+<p><strong>'element'</strong></p>
 <p>All elements that are defined in the relaxng are iterated. For each element the
following variables will be set</p>
 <ul>
 <li>'elementqname' is the qualified name of the current element.</li>
 <li>'elementname' is the same as 'elementqname' by default. The configuration file
can override this.</li>
 <li>'elementstylefamily' is empty by default. The configuration file can override this.</li>
 </ul>
-<p>=== 'attribute' ===</p>
+<p><strong> 'attribute'</strong></p>
 <p>All attributes of the currently selected element as defined in the relaxng schema
are iterated. For each attribute the following variables will be set</p>
 <ul>
 <li>'attributeqname' is the qualified name of the current attribute</li>
@@ -228,184 +238,246 @@ are scanned for expressions before assig
 <li>'conversiontype' is the same as 'valuetype' by default. The configuration file
can override this.</li>
 <li>'defaultvalue' is the default value for this attribute as defined by the relaxng
schema.</li>
 </ul>
-<p>=== 'value' ===</p>
+<p><strong>'value'</strong></p>
 <p>All values for the currently selected atteribute as defined in the relaxng schmea
are iterated. For each value the following variable 'value' will be set.
 This only works for attributes that are defined using &lt;value&gt; elements in the
relaxng schema.</p>
-<p>=== 'namespace' ===</p>
+<p><strong>'namespace'</strong></p>
 <p>All namespaces used in the relaxng schema are iterated. For each namespace the following
variables will be set</p>
 <ul>
 <li>'namespaceprefix' is the prefix of the current namespace</li>
 <li>'namespaceuri' is the uri of the current namespace</li>
 </ul>
-<p>== Select ==</p>
+<h2 id="select">Select</h2>
 <p>The &lt;select&gt; element works the same as the &lt;foreach&gt;
element but instead of iterating all objects of the given type it selects only one object
by its qname with the mandatory attribute 'name'.
 Can only be used for types 'element', 'attribute' and 'namespace'.</p>
-<p>== File ==</p>
+<h2 id="file">File</h2>
 <p>The &lt;file&gt; element opens a new text file for writing. The following
attributes are supported</p>
-<p>=== Path ===</p>
+<p><strong>Path</strong></p>
 <p>The mandatory attribute 'path' specifies the path of the new file.</p>
-<p>=== Name ===</p>
+<p><strong>Name</strong></p>
 <p>The mandatory attribute 'name' specifies the name of the new file.</p>
-<p>=== Extension ===</p>
+<p><strong>Extension</strong></p>
 <p>The mandatory attribute 'extension' specifies the extension of the new file.</p>
-<p>= Expressions =</p>
+<h2 id="expressions">Expressions</h2>
 <p>Expressions can be part of characters inside &lt;code&gt; elements and inside
some attributes.
 If embedded inside other text they are distinguished by putting them inside %{...} constructs.
 Expressions can contain variable names, contant strings, operators and functions</p>
-<p>== Variables ==</p>
+<h2 id="variables">Variables</h2>
 <p>Variables must start with a us-ascii character ('a-z' or 'A-Z) or one of the following
characters '_' '.' and
 contain more of the same characters and also digits.</p>
 <p>The following example</p>
-<p>&lt;set testvar="World"/&gt;<br />
-  &lt;code&gt;Hello %{testvar}!&lt;/code&gt;</p>
-<p>outputs</p>
-<p>Hello World!<br />
+<p>&lt;set testvar="World"/&gt;    <br />
+  &lt;code&gt;Hello %{testvar}!&lt;/code&gt; <br />
 </p>
-<p>== Constant strings ==</p>
+<p>outputs</p>
+<div class="codehilite"><pre><span class="n">Hello</span> <span
class="n">World</span><span class="o">!</span>
+</pre></div>
+
+
+<h2 id="constant-strings">Constant strings</h2>
 <p>Constand strings must be delimeted by either ' or " like c++ or java strings.</p>
 <p>The following example</p>
-<p>&lt;set testvar="yes"/&gt;
-  &lt;if test="testvar='yes'"&gt;
-  &lt;code&gt;
-  Yes!
-  &lt;/code&gt;
-  &lt;else&gt;
-  &lt;code&gt;
-  No!
-  &lt;/code&gt;
-  &lt;/else&gt;
-  &lt;/if&gt;</p>
-<p>outputs</p>
-<p>Yes!</p>
-<p>== Operators ==</p>
+<p>&lt;set testvar="yes"/&gt;  <br />
+  &lt;if test="testvar='yes'"&gt;   <br />
+  &lt;code&gt;  <br />
+  Yes! <br />
+  &lt;/code&gt;  <br />
+  &lt;else&gt;  <br />
+  &lt;code&gt;  <br />
+  No!  <br />
+  &lt;/code&gt; <br />
+  &lt;/else&gt;  <br />
+  &lt;/if&gt;  <br />
+</p>
+<p>outputs </p>
+<div class="codehilite"><pre>  <span class="n">Yes</span><span
class="o">!</span>
+</pre></div>
+
+
+<h2 id="operators">Operators</h2>
 <p>The following operators are supported (given from lowest to highes priority)</p>
-<p>=== not ===</p>
+<p><strong>not</strong></p>
 <p>The not operator returns 'true' of the following string expression is not empty
and not 'false' or 'false' otherwise.</p>
 <p>The following example</p>
-<p>&lt;set testvar="yes"/&gt;
-  &lt;code&gt;
-  %{ testvar } or %{ not testvar }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>yes or false</p>
-<p>=== + ===</p>
-<p>The + operator concatenates two string expressions.</p>
-<p>The following example</p>
-<p>&lt;code&gt;
-  %{ 'Hello' + ' ' + "World" + "!" }
-  &lt;/code&gt;</p>
+<p>&lt;set testvar="yes"/&gt; <br />
+  &lt;code&gt;  <br />
+  %{ testvar } or %{ not testvar }  <br />
+  &lt;/code&gt; <br />
+</p>
 <p>outputs</p>
-<p>Hello World!</p>
-<p>=== or ===</p>
+<div class="codehilite"><pre>  <span class="n">yes</span> <span
class="ow">or</span> <span class="n">false</span>
+</pre></div>
+
+
+<p><strong>+</strong></p>
+<p>The + operator concatenates two string expressions. <br />
+</p>
+<p>The following example <br />
+</p>
+<p>&lt;code&gt;   <br />
+  %{ 'Hello' + ' ' + "World" + "!" }  <br />
+  &lt;/code&gt;  <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">Hello</span> <span
class="n">World</span><span class="o">!</span>
+</pre></div>
+
+
+<p><strong>or</strong></p>
 <p>The or operator returns 'true' if the previous string expression is not empty and
not 'false' or the next string expression is not empty and not 'false'.</p>
-<p>&lt;code&gt;
-  %{ 'true' or 'false' }
-  &lt;/code&gt;</p>
+<p>&lt;code&gt; <br />
+  %{ 'true' or 'false' }  <br />
+  &lt;/code&gt;  <br />
+</p>
 <p>outputs</p>
-<p>true</p>
-<p>=== and ===</p>
+<div class="codehilite"><pre>  <span class="n">true</span>
+</pre></div>
+
+
+<p><strong>and</strong></p>
 <p>The or operator returns 'true' if the previous string expression is not empty and
not 'false' and the next string expression is not empty and not 'false'.</p>
-<p>&lt;code&gt;
-  %{ 'true' and 'false' }
-  %{ 'true' and 'true' }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>false
-  true</p>
-<p>=== Equals  ===</p>
+<p>&lt;code&gt;  <br />
+  %{ 'true' and 'false' }  <br />
+  %{ 'true' and 'true' }  <br />
+  &lt;/code&gt; <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">false</span>
+  <span class="n">true</span>
+</pre></div>
+
+
+<p><strong>Equals</strong></p>
 <p>The '=' operator returns 'true' if the previous string expression is equal to the
next string expression or 'false' otherwise.</p>
-<p>&lt;code&gt;
-  %{ 'true' = 'false' }
-  %{ 'hello' = 'hello' }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>false
-  true</p>
-<p>=== Unequals  ===</p>
+<p>&lt;code&gt;  <br />
+  %{ 'true' = 'false' }  <br />
+  %{ 'hello' = 'hello' }  <br />
+  &lt;/code&gt;   <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">false</span>
+  <span class="n">true</span>
+</pre></div>
+
+
+<p><strong>Unequals</strong></p>
 <p>The '!=' operator returns 'false' if the previous string expression is equal to
the next string expression or 'true' otherwise.</p>
-<p>&lt;code&gt;
-  %{ 'true' != 'false' }
-  %{ 'hello' != 'hello' }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>true
-  false</p>
-<p>== Functions ==</p>
+<p>&lt;code&gt;   <br />
+  %{ 'true' != 'false' }   <br />
+  %{ 'hello' != 'hello' }   <br />
+  &lt;/code&gt;  <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">true</span>
+  <span class="n">false</span>
+</pre></div>
+
+
+<h2 id="functions">Functions</h2>
 <p>Functions start with a name followed by a pair of brackets with a list of coma seperated
parameters inside. The following functions are supported</p>
-<p>=== toupper ===</p>
+<p><strong>toupper</strong></p>
 <p>The function toupper returns the given string as an upercase version</p>
-<p>&lt;code&gt;
-  %{ toupper('true') }
-  &lt;/code&gt;</p>
+<p>&lt;code&gt;  <br />
+  %{ toupper('true') }    <br />
+  &lt;/code&gt;  <br />
+</p>
 <p>outputs</p>
-<p>TRUE</p>
-<p>=== tolower ===</p>
+<div class="codehilite"><pre>  <span class="n">TRUE</span>
+</pre></div>
+
+
+<p><strong>tolower</strong></p>
 <p>The function tolower returns the given string as a lowercase version.</p>
-<p>&lt;code&gt;
-  %{ toupper('TRUE') }
-  &lt;/code&gt;</p>
+<p>&lt;code&gt;     <br />
+  %{ toupper('TRUE') }      <br />
+  &lt;/code&gt;     <br />
+</p>
 <p>outputs</p>
-<p>true</p>
-<p>=== prefix ===</p>
+<div class="codehilite"><pre>  <span class="n">true</span>
+</pre></div>
+
+
+<p><strong>prefix</strong></p>
 <p>The function 'prefix' returns the namespace prefix from a qualified name.</p>
-<p>=== local_name ===</p>
+<p><strong>local_name</strong></p>
 <p>The function 'local_name' returns the local name from a qualified name.</p>
-<p>&lt;set qname='text:section'/&gt;
-  &lt;code&gt;
-  %{ prefix(qname) }
-  %{ local_name(qname) }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>text
-  section</p>
-<p>=== identifier ===</p>
+<p>&lt;set qname='text:section'/&gt;    <br />
+  &lt;code&gt;   <br />
+  %{ prefix(qname) }     <br />
+  %{ local_name(qname) }       <br />
+  &lt;/code&gt;    <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">text</span>
+  <span class="n">section</span>
+</pre></div>
+
+
+<p><strong>identifier</strong></p>
 <p>The function 'identifier' converts the given string into a valid java/c++ identifier.
 If the given string is a qualified name, it first removes the prefix.
 Then all '-' Characters will be removed and all characters following '-' will be converted
to upercase.
 If the result begins with a non valid character, a '_' will be inserted as the first character.</p>
-<p>&lt;set qname='text:section'/&gt;
-  &lt;code&gt;
-  %{ identifier('text:anchor-position') }
-  %{ identifier('300') }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>AnchorPosition
-  _300</p>
-<p>=== endswith ===</p>
+<p>&lt;set qname='text:section'/&gt;    <br />
+  &lt;code&gt;     <br />
+  %{ identifier('text:anchor-position') }     <br />
+  %{ identifier('300') }   <br />
+  &lt;/code&gt;    <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">AnchorPosition</span>
+  <span class="n">_300</span>
+</pre></div>
+
+
+<p><strong>endswith</strong></p>
 <p>The function 'endswith' returns true if the first parameter ends with the second.</p>
-<p>&lt;code&gt;
-  %{ endswith('foobar','bar') }
-  %{ endswith('foobar','foo') }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>true
-  false</p>
-<p>=== startswith ===</p>
+<p>&lt;code&gt;     <br />
+  %{ endswith('foobar','bar') }  <br />
+  %{ endswith('foobar','foo') }   <br />
+  &lt;/code&gt;   <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">true</span>
+  <span class="n">false</span>
+</pre></div>
+
+
+<p><strong>startswith</strong></p>
 <p>The function 'startswith' returns true if the first parameter starts with the second.</p>
-<p>&lt;code&gt;
-  %{ startswith('foobar','bar') }
-  %{ startswith('foobar','foo') }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>false
-  true</p>
-<p>=== startswith ===</p>
+<p>&lt;code&gt;     <br />
+  %{ startswith('foobar','bar') }      <br />
+  %{ startswith('foobar','foo') }      <br />
+  &lt;/code&gt;     <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">false</span>
+  <span class="n">true</span>
+</pre></div>
+
+
+<p><strong>startswith</strong></p>
 <p>The function 'startswith' returns true if the first parameter starts with the second.</p>
-<p>&lt;code&gt;
-  %{ startswith('foobar','bar') }
-  %{ startswith('foobar','foo') }
-  &lt;/code&gt;</p>
-<p>outputs</p>
-<p>false
-  true</p>
-<p>=== replace ===</p>
+<p>&lt;code&gt;     <br />
+  %{ startswith('foobar','bar') }        <br />
+  %{ startswith('foobar','foo') }    <br />
+  &lt;/code&gt;     <br />
+</p>
+<p>outputs</p>
+<div class="codehilite"><pre>  <span class="n">false</span>
+  <span class="n">true</span>
+</pre></div>
+
+
+<p><strong>replace</strong></p>
 <p>The function 'replace' replaces all occurrences of the first parameter with the
second parameter inside the third parameter.</p>
-<p>&lt;code&gt;
-  %{ replace('USA','World','Hello USA!') }
-  &lt;/code&gt;</p>
+<p>&lt;code&gt;   <br />
+  %{ replace('USA','World','Hello USA!') }   <br />
+  &lt;/code&gt;   <br />
+</p>
 <p>outputs</p>
-<p>Hello World!</p>
-<p style="margin: 15px 0px; text-align:center">Back to: [[Home|ODFDOM Wiki Home]] ||
[http://odftoolkit.org/ ODF Toolkit Wiki Home]</p>
+<div class="codehilite"><pre>  <span class="n">Hello</span> <span
class="n">World</span><span class="o">!</span>
+</pre></div>
   </div>
 
   <div id="footera">



Mime
View raw message