rdonkin 2003/03/19 14:53:51
Modified: betwixt/xdocs overview.xml tasks.xml
Log:
Added documentation for mixed content writing.
Revision Changes Path
1.14 +50 -0 jakarta-commons/betwixt/xdocs/overview.xml
Index: overview.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/betwixt/xdocs/overview.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- overview.xml 9 Feb 2003 22:27:18 -0000 1.13
+++ overview.xml 19 Mar 2003 22:53:51 -0000 1.14
@@ -390,6 +390,56 @@
</p>
</subsection>
+<subsection name="Using .betwixt files To Write Mixed Content">
+ <p>
+ An element with mixed content contains child elements and text.
+ For example, element <code>foo</code> has mixed content in the following:
+<source>
+<![CDATA[<foo>
+ Some text
+ <bar/>
+ </foo>]]>
+</source>
+ Betwixt supports writing mixed content through <code>text</code> elements in
the
+ .betwixt file.
+ </p>
+
+ <p>
+ A <code>text</code> element can be mapped to a property in which case it must
have
+ a <code>property</code> attribute and may (optionally) have a <code>type</code>
attribute.
+ Otherwise, the <code>text</code> element is mapped to a static value, in which
case it
+ must have a <code>value</code> attribute. If a <code>text</code> element has
both
+ <code>value</code> and <code>property</code> attributes then an exception will
be thrown.
+ </p>
+
+ <p>
+ For example, a simple bean with the .betwixt file
+<source><![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
+<info primitiveTypes="attribute">
+ <element name='foo'>
+ <attribute name='version' value='1.0'/>
+ <element name='bar'>
+ <attribute name='version' property='alpha'/>
+ <text value='static text'/>
+ <element name='baa' property='beta'/>
+ <text property='gamma'/>
+ </element>
+ </element>
+</info>]]>
+</source>
+ and with property values alpha='One', beta='Two' and gamma='Three' will write
an output like:
+<source>
+<![CDATA[<foo version="1.0">
+ <bar version="One">static text<baa>Two</baa>Three</bar>
+</foo>
+]]></source>
+ </p>
+
+ <p><strong>Note</strong>Betwixt does not (at the moment) support reading mixed
+ content elements.</p>
+
+</subsection>
+
</section>
<section name='Reading Beans (Advanced)'>
1.11 +11 -0 jakarta-commons/betwixt/xdocs/tasks.xml
Index: tasks.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/betwixt/xdocs/tasks.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- tasks.xml 27 Feb 2003 19:51:19 -0000 1.10
+++ tasks.xml 19 Mar 2003 22:53:51 -0000 1.11
@@ -159,6 +159,11 @@
elements need a definite and predicatable ordering. Pluggable element
ordering strategies
would order the elements according to some algorithm eg. alphabetic.
</li>
+ <li>
+ <strong>Support Mixed Content Round Tripping</strong>
+ This is actually has some conceptual problems. What happens when you
have two text
+ descriptors mapped to properties next to each other?
+ </li>
</ul>
</subsection>
</section>
@@ -192,6 +197,12 @@
An option not to write empty elements has been added. This is
required to correctly write
some kinds of xml.
The RSS full round tripping will only work with this functionality.
+ </li>
+ <li>
+ <strong>Support Writing Mixed Content</strong>
+ Mixed content elements contain elements and body text. Added
support for adding
+ body text between child elements through the .betwixt file. This
text can be
+ static or set from a property.
</li>
</ul>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]