bayard 01/09/16 19:20:33
Modified: string/xml string.xml
Log:
Added some examples to this. Still a bunch to go.
Revision Changes Path
1.3 +217 -1 jakarta-taglibs/string/xml/string.xml
Index: string.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/string/xml/string.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- string.xml 2001/09/06 05:38:06 1.2
+++ string.xml 2001/09/17 02:20:33 1.3
@@ -242,7 +242,7 @@
]]>
</code>
</usage>
- </example>
+ </example>
</tag>
<tag>
<name>removeXml</name>
@@ -256,6 +256,21 @@
</description>
<availability>1.0</availability>
<restrictions>None</restrictions>
+ <example>
+ <usage>
+ <comment>
+ All it currently does is strip any
+ <xx> tags out. It doesn't check that the tags are correct
+ xml and it would be confused by < or > signs inside a
+ tag attribute.
+ </comment>
+ <code>
+<![CDATA[
+<str:removeXml><name>John Brown</name></str:removeXml>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>encodeUrl</name>
@@ -267,6 +282,19 @@
</description>
<availability>1.0</availability>
<restrictions>None</restrictions>
+ <example>
+ <usage>
+ <comment>
+ Especially useful if database output is being put into
+ an <a href="..">
+ </comment>
+ <code>
+<![CDATA[
+<str:encodeUrl>http://www.apache.org/some file//page.html</str:encodeUrl>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>decodeUrl</name>
@@ -278,6 +306,20 @@
</description>
<availability>1.0</availability>
<restrictions>None</restrictions>
+ <example>
+ <usage>
+ <comment>
+ Useful in parallel with its counterpart. If a database
+ contains the URL in encoded form, then this could be used
+ to show a human readable version.
+ </comment>
+ <code>
+<![CDATA[
+<str:decodeUrl>http://www.apache.org/some+file%20/page.html</str:decodeUrl>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<!-- 'set' attribute tags -->
@@ -309,6 +351,18 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ There is 1 a, 2 e's and no f's. So the result is 3.
+ </comment>
+ <code>
+<![CDATA[
+<str:count set="aef">Some sample text to count</count>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>delete</name>
@@ -332,6 +386,18 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Will output: 'Som smpl txt to dlt rom'
+ </comment>
+ <code>
+<![CDATA[
+<str:delete set="aef">Some sample text to delete from</str:delete>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>squeeze</name>
@@ -357,6 +423,18 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Will output: 'Some sample text to squeeze'
+ </comment>
+ <code>
+<![CDATA[
+<str:squeeze set="xo">Some sample texxxt toooo squeeze</str:squeeze>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<!-- Delimiter and width attribute tags -->
@@ -391,6 +469,19 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Outputs a header with 'The Title' embedded in a
+ bunch of - characters.
+ </comment>
+ <code>
+<![CDATA[
+<str:center width="40" delimiter="-">The Title</str:center>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>rightPad</name>
@@ -425,6 +516,18 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Will output: 'An arrow------->'
+ </comment>
+ <code>
+<![CDATA[
+<str:rightPad width="15" delimiter="-">An arrow</str:rightPad>&gt;
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>leftPad</name>
@@ -459,6 +562,18 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Will output: '<-------An arrow>'
+ </comment>
+ <code>
+<![CDATA[
+&lt;<str:leftPad width="15" delimiter="-">An arrow</str:rightPad>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<!-- Delimiter attribute tags -->
@@ -484,6 +599,19 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ One use could be to remove # and // comments from
+ code when outputted.
+ </comment>
+ <code>
+<![CDATA[
+<str:chomp delimiter="#">Some code; # A comment</str:chomp>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>getChomp</name>
@@ -507,6 +635,19 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Similarily to its counterpart, this could be used to
+ get the comments from a piece of code.
+ </comment>
+ <code>
+<![CDATA[
+<str:getChomp delimiter="#">Some code; # A comment</str:getChomp>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>prechomp</name>
@@ -530,6 +671,20 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Again, this could be used to get the comment from
+ a piece of code. However it would not include the
+ delimiter as getChomp would.
+ </comment>
+ <code>
+<![CDATA[
+<str:prechomp delimiter="#">Some code; # A comment</str:prechomp>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>getPrechomp</name>
@@ -553,6 +708,19 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ In the code comment theme, this would return the code
+ but include the comment character itself.
+ </comment>
+ <code>
+<![CDATA[
+<str:getPrechomp delimiter="#">Some code; # A comment</str:getPrechomp>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>strip</name>
@@ -576,6 +744,19 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Default is isWhitespace, that is tab or newline or space
+ character.
+ </comment>
+ <code>
+<![CDATA[
+<str:strip delimiter="-">---A Title---</str:strip>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>stripEnd</name>
@@ -599,6 +780,17 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ </comment>
+ <code>
+<![CDATA[
+<str:stripEnd delimiter="-">A Title---</str:stripEnd>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>stripStart</name>
@@ -622,6 +814,17 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ </comment>
+ <code>
+<![CDATA[
+<str:stripStart delimiter="-">---A Title</str:stripStart>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>
<name>reverseDelimitedString</name>
@@ -646,6 +849,19 @@
</description>
<availability>1.0</availability>
</attribute>
+ <example>
+ <usage>
+ <comment>
+ Major use is to turn domain names into java package names.
+ Bound to be other uses.
+ </comment>
+ <code>
+<![CDATA[
+<str:reverseDelimitedString
delimiter=".">org.apache.taglib.string.String</str:reverseDelimitedString>
+]]>
+ </code>
+ </usage>
+ </example>
</tag>
<tag>