1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
<HTML><HEAD><SCRIPT language="JavaScript" src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>FP Taglib</TITLE></HEAD><BODY alink="#cc0000" bgcolor="#ffffff" leftmargin="4" link="#039acc" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0086b2"><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif" vspace="0" width="135"></TD><TD align="left" background="resources/line.gif" colspan="2" height="5" valign="top" width="100%"><IMG align="left" border="0" height="5" hspace="0" src="resources/line.gif" vspace="0" width="1"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="2" height="35" valign="top" width="100%"><IMG align="right" alt="" border="0" height="35" hspace="0" src="graphics/fp-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" background="resources/bottom.gif" bgcolor="#0086b2" height="20" valign="top" width="100%"><IMG align="left" border="0" height="20" hspace="0" src="resources/bottom.gif" vspace="0" width="3"></TD><TD align="right" background="resources/bottom.gif" bgcolor="#0086b2" height="20" valign="top" width="288"><TABLE border="0" cellpadding="0" cellspacing="0" width="288"><TR><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');" src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');" src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');" src="resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="resources/join.gif" vspace="0" width="120"><BR>
<A href="index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Index" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');" src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="license.html" onMouseOut="rolloverOff('side-license');" onMouseOver="rolloverOn('side-license');"><IMG alt="License" border="0" height="12" hspace="0" name="side-license" onLoad="rolloverLoad('side-license','graphics/license-label-2.jpg','graphics/license-label-3.jpg');" src="graphics/license-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Install" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','graphics/install-label-2.jpg','graphics/install-label-3.jpg');" src="graphics/install-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="install-case-solaris.html" onMouseOut="rolloverOff('side-install-case-solaris');" onMouseOver="rolloverOn('side-install-case-solaris');"><IMG alt="Install on Solaris8" border="0" height="12" hspace="0" name="side-install-case-solaris" onLoad="rolloverLoad('side-install-case-solaris','graphics/install-case-solaris-label-2.jpg','graphics/install-case-solaris-label-3.jpg');" src="graphics/install-case-solaris-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="install-case-windows.html" onMouseOut="rolloverOff('side-install-case-windows');" onMouseOver="rolloverOn('side-install-case-windows');"><IMG alt="Install on Win2k" border="0" height="12" hspace="0" name="side-install-case-windows" onLoad="rolloverLoad('side-install-case-windows','graphics/install-case-windows-label-2.jpg','graphics/install-case-windows-label-3.jpg');" src="graphics/install-case-windows-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="technologies.html" onMouseOut="rolloverOff('side-technologies');" onMouseOver="rolloverOn('side-technologies');"><IMG alt="Technologies" border="0" height="12" hspace="0" name="side-technologies" onLoad="rolloverLoad('side-technologies','graphics/technologies-label-2.jpg','graphics/technologies-label-3.jpg');" src="graphics/technologies-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="infrastructure.html" onMouseOut="rolloverOff('side-infrastructure');" onMouseOver="rolloverOn('side-infrastructure');"><IMG alt="Infrastructure" border="0" height="12" hspace="0" name="side-infrastructure" onLoad="rolloverLoad('side-infrastructure','graphics/infrastructure-label-2.jpg','graphics/infrastructure-label-3.jpg');" src="graphics/infrastructure-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="guide.html" onMouseOut="rolloverOff('side-guide');" onMouseOver="rolloverOn('side-guide');"><IMG alt="User Guide" border="0" height="12" hspace="0" name="side-guide" onLoad="rolloverLoad('side-guide','graphics/guide-label-2.jpg','graphics/guide-label-3.jpg');" src="graphics/guide-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="dynamic.html" onMouseOut="rolloverOff('side-dynamic');" onMouseOver="rolloverOn('side-dynamic');"><IMG alt="Dynamic Content" border="0" height="12" hspace="0" name="side-dynamic" onLoad="rolloverLoad('side-dynamic','graphics/dynamic-label-2.jpg','graphics/dynamic-label-3.jpg');" src="graphics/dynamic-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="how-it-works.html" onMouseOut="rolloverOff('side-how-it-works');" onMouseOver="rolloverOn('side-how-it-works');"><IMG alt="How it works" border="0" height="12" hspace="0" name="side-how-it-works" onLoad="rolloverLoad('side-how-it-works','graphics/how-it-works-label-2.jpg','graphics/how-it-works-label-3.jpg');" src="graphics/how-it-works-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="xsp.html" onMouseOut="rolloverOff('side-xsp');" onMouseOver="rolloverOn('side-xsp');"><IMG alt="XSP Processor" border="0" height="12" hspace="0" name="side-xsp" onLoad="rolloverLoad('side-xsp','graphics/xsp-label-2.jpg','graphics/xsp-label-3.jpg');" src="graphics/xsp-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="sqltaglib.html" onMouseOut="rolloverOff('side-sqltaglib');" onMouseOver="rolloverOn('side-sqltaglib');"><IMG alt="SQL XSP Taglib" border="0" height="12" hspace="0" name="side-sqltaglib" onLoad="rolloverLoad('side-sqltaglib','graphics/sqltaglib-label-2.jpg','graphics/sqltaglib-label-3.jpg');" src="graphics/sqltaglib-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG alt="FP XSP Taglib" border="0" height="12" hspace="0" src="graphics/fp-label-1.jpg" vspace="0" width="120"><BR>
<A href="connection-pool.html" onMouseOut="rolloverOff('side-connection-pool');" onMouseOver="rolloverOn('side-connection-pool');"><IMG alt="SQL Conn Pool" border="0" height="12" hspace="0" name="side-connection-pool" onLoad="rolloverLoad('side-connection-pool','graphics/connection-pool-label-2.jpg','graphics/connection-pool-label-3.jpg');" src="graphics/connection-pool-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="sql.html" onMouseOut="rolloverOff('side-sql');" onMouseOver="rolloverOn('side-sql');"><IMG alt="SQL Processor" border="0" height="12" hspace="0" name="side-sql" onLoad="rolloverLoad('side-sql','graphics/sql-label-2.jpg','graphics/sql-label-3.jpg');" src="graphics/sql-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="ldap.html" onMouseOut="rolloverOff('side-ldap');" onMouseOver="rolloverOn('side-ldap');"><IMG alt="LDAP Processor" border="0" height="12" hspace="0" name="side-ldap" onLoad="rolloverLoad('side-ldap','graphics/ldap-label-2.jpg','graphics/ldap-label-3.jpg');" src="graphics/ldap-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="dcp.html" onMouseOut="rolloverOff('side-dcp');" onMouseOver="rolloverOn('side-dcp');"><IMG alt="DCP Processor" border="0" height="12" hspace="0" name="side-dcp" onLoad="rolloverLoad('side-dcp','graphics/dcp-label-2.jpg','graphics/dcp-label-3.jpg');" src="graphics/dcp-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="wd-xsp.html" onMouseOut="rolloverOff('side-wd-xsp');" onMouseOver="rolloverOn('side-wd-xsp');"><IMG alt="XSP WD" border="0" height="12" hspace="0" name="side-wd-xsp" onLoad="rolloverLoad('side-wd-xsp','graphics/wd-xsp-label-2.jpg','graphics/wd-xsp-label-3.jpg');" src="graphics/wd-xsp-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="./api/index.html" onMouseOut="rolloverOff('side-ext-48');" onMouseOver="rolloverOn('side-ext-48');"><IMG alt="Javadocs" border="0" height="12" hspace="0" name="side-ext-48" onLoad="rolloverLoad('side-ext-48','graphics/ext-48-label-2.jpg','graphics/ext-48-label-3.jpg');" src="graphics/ext-48-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="cocoon2.html" onMouseOut="rolloverOff('side-cocoon2');" onMouseOver="rolloverOn('side-cocoon2');"><IMG alt="Cocoon 2" border="0" height="12" hspace="0" name="side-cocoon2" onLoad="rolloverLoad('side-cocoon2','graphics/cocoon2-label-2.jpg','graphics/cocoon2-label-3.jpg');" src="graphics/cocoon2-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="faqs.html" onMouseOut="rolloverOff('side-faqs');" onMouseOver="rolloverOn('side-faqs');"><IMG alt="FAQ" border="0" height="12" hspace="0" name="side-faqs" onLoad="rolloverLoad('side-faqs','graphics/faqs-label-2.jpg','graphics/faqs-label-3.jpg');" src="graphics/faqs-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="changes.html" onMouseOut="rolloverOff('side-changes');" onMouseOver="rolloverOn('side-changes');"><IMG alt="Changes" border="0" height="12" hspace="0" name="side-changes" onLoad="rolloverLoad('side-changes','graphics/changes-label-2.jpg','graphics/changes-label-3.jpg');" src="graphics/changes-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="todo.html" onMouseOut="rolloverOff('side-todo');" onMouseOver="rolloverOn('side-todo');"><IMG alt="Todo" border="0" height="12" hspace="0" name="side-todo" onLoad="rolloverLoad('side-todo','graphics/todo-label-2.jpg','graphics/todo-label-3.jpg');" src="graphics/todo-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="livesites.html" onMouseOut="rolloverOff('side-livesites');" onMouseOver="rolloverOn('side-livesites');"><IMG alt="Live Sites" border="0" height="12" hspace="0" name="side-livesites" onLoad="rolloverLoad('side-livesites','graphics/livesites-label-2.jpg','graphics/livesites-label-3.jpg');" src="graphics/livesites-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
<A href="http://xml.apache.org/websrc/index.cgi/xml-cocoon/" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="Code Repository" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','graphics/ext-68-label-2.jpg','graphics/ext-68-label-3.jpg');" src="graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="http://xml.apache.org/from-cvs/xml-cocoon/" onMouseOut="rolloverOff('side-ext-70');" onMouseOver="rolloverOn('side-ext-70');"><IMG alt="Dev Snapshots" border="0" height="12" hspace="0" name="side-ext-70" onLoad="rolloverLoad('side-ext-70','graphics/ext-70-label-2.jpg','graphics/ext-70-label-3.jpg');" src="graphics/ext-70-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="mail-lists.html" onMouseOut="rolloverOff('side-mail-lists');" onMouseOver="rolloverOn('side-mail-lists');"><IMG alt="Mail Lists" border="0" height="12" hspace="0" name="side-mail-lists" onLoad="rolloverLoad('side-mail-lists','graphics/mail-lists-label-2.jpg','graphics/mail-lists-label-3.jpg');" src="graphics/mail-lists-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="http://mail-archives.apache.org/" onMouseOut="rolloverOff('side-ext-74');" onMouseOver="rolloverOn('side-ext-74');"><IMG alt="Mail Archive" border="0" height="12" hspace="0" name="side-ext-74" onLoad="rolloverLoad('side-ext-74','graphics/ext-74-label-2.jpg','graphics/ext-74-label-3.jpg');" src="graphics/ext-74-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="*"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD><BR>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD align="right" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-top.gif"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD align="left" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-right.gif" vspace="0" width="9"></TD></TR><TR><TD background="resources/bar-border-left.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD><TD bgcolor="#0086b2" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Description</B></FONT></TD><TD background="resources/bar-border-right.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD></TR><TR><TD align="right" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-bottom.gif"><IMG border="0" height="12" hspace="0" src="resources/void.gif" vspace="0"></TD><TD align="left" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-right.gif" vspace="0" width="9"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">The FP logicsheet is an XSP logicsheet, a TagLib, that performs tasks useful to people wanting to build and handle HTML Forms within Cocoon. Some of the tags are general enough to be used for other purposes as well. </P>
<P align="justify">The Tags form a simple XML language that can be mixed with other TagLibs, for writing the typical logic required for modifying XML Files with HTML Forms.</P>
<P align="justify">They allow you to work with data (Strings and Nodes) from external XML Files, both reading and writing to them using the XPath Specification to identify your target. There are also tags to choose between HTTP Methods GET and POST, so you could have a page that can both build a Form and handle saving it's data.</P>
</FONT></TD></TR></TABLE></DIV><BR>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD align="right" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-top.gif"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD align="left" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-right.gif" vspace="0" width="9"></TD></TR><TR><TD background="resources/bar-border-left.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD><TD bgcolor="#0086b2" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Installation</B></FONT></TD><TD background="resources/bar-border-right.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD></TR><TR><TD align="right" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-bottom.gif"><IMG border="0" height="12" hspace="0" src="resources/void.gif" vspace="0"></TD><TD align="left" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-right.gif" vspace="0" width="9"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">Check your cocoon.properties for this line and add it if it's not already there:</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>processor.xsp.logicsheet.fp.java =
resource://org/apache/cocoon/processor/xsp/library/java/fp.xsl</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P align="justify">Note the line break is for formatting purposes, it should not appear in your cocoon.properties file.</P>
</FONT></TD></TR></TABLE></DIV><BR>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD align="right" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-top.gif"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD align="left" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-right.gif" vspace="0" width="9"></TD></TR><TR><TD background="resources/bar-border-left.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD><TD bgcolor="#0086b2" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Configuration</B></FONT></TD><TD background="resources/bar-border-right.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD></TR><TR><TD align="right" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-bottom.gif"><IMG border="0" height="12" hspace="0" src="resources/void.gif" vspace="0"></TD><TD align="left" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-right.gif" vspace="0" width="9"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">Map the</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>http://apache.org/cocoon/XSP/FP/1.0</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P align="justify">namespace to the fp prefix. Elements in the fp taglib namespace will be interpreted as input to the fp taglib and will be stripped from the output.</P>
<P align="justify">This is typically done like this:</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>
<xsp:page
language="java"
xmlns:sql="http://apache.org/cocoon/XSP/FP/1.0"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
. . .
</xsp:page>
</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
</FONT></TD></TR></TABLE></DIV><BR>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD align="right" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-top.gif"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD align="left" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-right.gif" vspace="0" width="9"></TD></TR><TR><TD background="resources/bar-border-left.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD><TD bgcolor="#0086b2" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>The Tags</B></FONT></TD><TD background="resources/bar-border-right.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD></TR><TR><TD align="right" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-bottom.gif"><IMG border="0" height="12" hspace="0" src="resources/void.gif" vspace="0"></TD><TD align="left" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-right.gif" vspace="0" width="9"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> element with it's mandatory <CODE><FONT face="courier, monospaced">id</FONT></CODE> attribute, is for defining a file you would like to read and/or write to. It takes a series of configuration elements as children.</P>
<P align="justify">The list of valid child elements is:</P>
<BLOCKQUOTE><DL>
<LI><STRONG>fp:resource-file (mandatory)</STRONG> - </LI>
The path to a file you want to work with
<LI><STRONG>fp:resource-node (mandatory)</STRONG> - </LI>
An XPath to select the Node in your file that you want to work with
<LI><STRONG>fp:default-mode (defaults to replace if not present)</STRONG> - </LI>
The default mode you want to use when <B>writing</B> your Nodes, <CODE><FONT face="courier, monospaced">replace</FONT></CODE> replaces the selected Node, <CODE><FONT face="courier, monospaced">insert-before</FONT></CODE> and <CODE><FONT face="courier, monospaced">inser-after</FONT></CODE> create a new Node, with the same name as the selected, and inserts before or after.
</DL></BLOCKQUOTE>
<P align="justify">None of the above tags have any relevance outside of the <CODE><FONT face="courier, monospaced">fp:resource-file</FONT></CODE>.</P>
<P align="justify">You can use as many <CODE><FONT face="courier, monospaced">fp:resource-file</FONT></CODE> elements as you have unique files to work with, each one should have a unique <CODE><FONT face="courier, monospaced">id</FONT></CODE> attribute, this is what you use to refer to them. ie. the FP TagLib can work with multiple files at the same time.</P>
<P align="justify">Errors are flagged by placing an <CODE><FONT face="courier, monospaced">fp-error</FONT></CODE> attribute into the parent of the <CODE><FONT face="courier, monospaced">fp:resource-file</FONT></CODE> tag, with a value that is an IDREF pointing to an <CODE><FONT face="courier, monospaced">fp-error</FONT></CODE> element in your document root.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> element reads TextNodes or Nodes from the specified <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> into it's parent Element using a relative XPath. It has several mandatory attributes.</P>
<P align="justify">The list of valid attributes is:</P>
<BLOCKQUOTE><DL>
<LI><STRONG>from (mandatory)</STRONG> - </LI>
The <CODE><FONT face="courier, monospaced">id</FONT></CODE> of the <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> you want to read
<LI><STRONG>select (mandatory)</STRONG> - </LI>
An XPath (relative to <CODE><FONT face="courier, monospaced">fp:resource-node</FONT></CODE>) to select the Node(s) in the <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> you want to read
<LI><STRONG>as (defaults to string)</STRONG> - </LI>
The way you want to read the Node(s) selected by your XPath. The default, <CODE><FONT face="courier, monospaced">string</FONT></CODE> reads all of the TextNodes that are children of the selected Node(s); <CODE><FONT face="courier, monospaced">node</FONT></CODE> reads all of the selected Nodes as deep cloned XML.
</DL></BLOCKQUOTE>
<P align="justify">It is safe to use an XPath in your <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> element <CODE><FONT face="courier, monospaced">select</FONT></CODE> attribute that selects multiple Nodes.</P>
<P align="justify">If the parent of an <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> element is an <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element, the output of the <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> element goes to the <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element and is written to file. Otherwise the output goes to the user, like any other TagLib.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element writes TextNodes or Nodes to the specified <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> at the location specified by it's relative XPath. It has several mandatory attributes.</P>
<P align="justify">The list of valid attributes is:</P>
<BLOCKQUOTE><DL>
<LI><STRONG>to (mandatory)</STRONG> - </LI>
The <CODE><FONT face="courier, monospaced">id</FONT></CODE> of the <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> you want to write
<LI><STRONG>select (mandatory)</STRONG> - </LI>
An XPath (relative to <CODE><FONT face="courier, monospaced">fp:resource-node</FONT></CODE>) to select the Node in the <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> you want to write
<LI><STRONG>as (defaults to string)</STRONG> - </LI>
The way you want to write the Node selected by your XPath. The default, <CODE><FONT face="courier, monospaced">string</FONT></CODE> overwrites all of the TextNodes that are children of the selected Node with the text content of the <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element; <CODE><FONT face="courier, monospaced">node</FONT></CODE> replaces the selected Node with the content of the <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element as XML.
</DL></BLOCKQUOTE>
<P align="justify">It is <B>not</B> safe to use an XPath in your <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element <CODE><FONT face="courier, monospaced">select</FONT></CODE> attribute that selects multiple Nodes.</P>
<P align="justify">Only FP or other TagLib Tags can be used as child elements of the <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element. To do otherwise, causes compilation errors that can be difficult to track down. There may be a solution to this</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element may only use a simplified form of XPath in it's <CODE><FONT face="courier, monospaced">select</FONT></CODE> attribute, one that is just a simple "path/to/node", because the TagLib has to be able to construct any Nodes you ask for and it can only interpret the simplest case. ie. you can use an XPath like <CODE><FONT face="courier, monospaced">this/is/an/xpath/to/nowhere</FONT></CODE> and the data will be written with all the intervening elements whether they currently exist or not, but an XPath like <CODE><FONT face="courier, monospaced">title/*</FONT></CODE> will not work. (This is different from <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE>'s behaviour).</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:if-post</FONT></CODE> element allows simple logic, based on the HTTP Method of the incoming request.</P>
<P align="justify">Any child elements of the <CODE><FONT face="courier, monospaced">fp:if-post</FONT></CODE> element are ignored during GET, HEAD, PUT and DELETE requests.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:if-get</FONT></CODE> element allows simple logic, based on the HTTP Method of the incoming request.</P>
<P align="justify">Any child elements of the <CODE><FONT face="courier, monospaced">fp:if-get</FONT></CODE> element are ignored during POST, HEAD, PUT and DELETE requests.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:redirect</FONT></CODE> element can be used to redirect the user to another URL when two conditions have been met, that this was a POST Request, and there were no errors generated by any of the other FP Tags.</P>
<P align="justify">The value of the <CODE><FONT face="courier, monospaced">fp:redirect</FONT></CODE> element, is the URL you want users to go to, it should accept relative, root and absolute addressed URLs.</P>
</FONT></TD></TR></TABLE></DIV><BR>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD align="right" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-top.gif"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD align="left" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-right.gif" vspace="0" width="9"></TD></TR><TR><TD background="resources/bar-border-left.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD><TD bgcolor="#0086b2" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Usage</B></FONT></TD><TD background="resources/bar-border-right.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD></TR><TR><TD align="right" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-bottom.gif"><IMG border="0" height="12" hspace="0" src="resources/void.gif" vspace="0"></TD><TD align="left" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-right.gif" vspace="0" width="9"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">Try the sample. The URL is http://[your server]/[your cocoon path]/samples/fp/index.xml</P>
<P align="justify">The sample files</P>
<BLOCKQUOTE><DL>
<LI><STRONG>form/default.xml</STRONG> - </LI>
Default values used by the Forms
<LI><STRONG>form/form-html.xsl</STRONG> - </LI>
Renders the Form to HTML
<LI><STRONG>form/form-xml.xsl</STRONG> - </LI>
Renders the Form to XML (for debugging purposes)
<LI><STRONG>form/item-add.xml</STRONG> - </LI>
Builds and saves a Form to add new Items in index.xml
<LI><STRONG>form/item-edit.xml</STRONG> - </LI>
Builds and saves a Form to edit existing Items in index.xml
<LI><STRONG>images</STRONG> - </LI>
Folder of images
<LI><STRONG>index.xml</STRONG> - </LI>
The content XML file
<LI><STRONG>page-html.xsl</STRONG> - </LI>
Renders the normal view of the project
</DL></BLOCKQUOTE>
</FONT></TD></TR></TABLE></DIV><BR>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD align="right" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-top.gif"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD align="left" height="7" valign="bottom" width="9"><IMG border="0" height="7" hspace="0" src="resources/bar-top-right.gif" vspace="0" width="9"></TD></TR><TR><TD background="resources/bar-border-left.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD><TD bgcolor="#0086b2" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Samples</B></FONT></TD><TD background="resources/bar-border-right.gif" width="9"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="9"></TD></TR><TR><TD align="right" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-left.gif" vspace="0" width="9"></TD><TD background="resources/bar-border-bottom.gif"><IMG border="0" height="12" hspace="0" src="resources/void.gif" vspace="0"></TD><TD align="left" height="12" valign="top" width="9"><IMG border="0" height="12" hspace="0" src="resources/bar-bottom-right.gif" vspace="0" width="9"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">These are bits of annotated code from fp/form/item-add.xml</P>
<P align="justify">This is how to set up a file resource that you want to modify.</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>
<fp:resource id="external-item">
<fp:resource-file>../index.xml</fp:resource-file>
<fp:resource-node>item[position()=<request:get-parameter name="item"/>]</fp:resource-node>
<fp:default-mode>insert-before</fp:default-mode>
</fp:resource>
</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P align="justify">We are nesting an element from the Request TagLib inside an FP element to build an XPath on the fly from the "item" request parameter. Now you can use <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> and <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> elements to read and/or write to this file, inserting a new "item" Node before the current one, from text in a Form field.</P>
<P align="justify">You can have as many <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> elements in your XSP as you need.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">id</FONT></CODE> attribute of the <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE> must be unique, you use it's value in the <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> or <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> elements to define which file you want.</P>
<P align="justify">Here, I want to get the Title of all onf the Items, to build a Menu.</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>
<menu action="item-add.xml?item=">
<fp:read select="../item/title" from="external-item" as="node"/>
</menu>
</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> element is replaced by the contents of the read.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">from</FONT></CODE> attribute is the name of the resource you want to read.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">select</FONT></CODE> attribute is an XPath relative to the Node specified in this resource's "resource-node".</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">as</FONT></CODE> attribute, in this case <CODE><FONT face="courier, monospaced">node</FONT></CODE> specified that the data should be read and passed on as XML.</P>
<P align="justify">Status and Error id's are added as attributes to the parent of the <CODE><FONT face="courier, monospaced">fp:read</FONT></CODE> tag, in this case the <CODE><FONT face="courier, monospaced"><menu/></FONT></CODE>tag.</P>
<P align="justify">If there is an error, you get the ID of the error report, placed at the end of the page.</P>
<P align="justify">The output looks like this:</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>
<menu fp-action="read" [fp-error="fp-1"] fp-from="external-item" fp-select="../item/title" fp-type="text/xml">
<title>Title 1</title>
<title>Title 2</title>
<title>Title ...</title>
</menu>
</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P align="justify">Here we make a Form <CODE><FONT face="courier, monospaced">input</FONT></CODE> Field, so the name is important, but it does not need to relate to the name of the location where the data is to be stored. The parent deos not have to be <CODE><FONT face="courier, monospaced">input</FONT></CODE>, use whatever you want.</P>
<DIV align="center"><TABLE border="0" cellpadding="0" cellspacing="4"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"><PRE>
<input name="title">
<xsp:attribute name="label"><fp:read select="title/label" from="default-item"/></xsp:attribute>
<fp:if-post>
<fp:write to="external-item" select="title">
<request:get-parameter name="title"/>
</fp:write>
<fp:read select="title" from="external-item"/>
</fp:if-post>
<fp:if-get>
<fp:read select="title/value" from="default-item"/>
</fp:if-get>
</input>
</PRE></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P align="justify">I create a <CODE><FONT face="courier, monospaced">label</FONT></CODE> attribute in the <CODE><FONT face="courier, monospaced">input</FONT></CODE> element, using XSP, but the content comes from reading Text from the defaults file (I would have had to set this file up previously as a <CODE><FONT face="courier, monospaced">fp:resource</FONT></CODE>). The default value for the <CODE><FONT face="courier, monospaced">as</FONT></CODE> attribute is "string", so I am leaving it out. I understand Xerces prefers you to write attributes before elements.</P>
<P align="justify">Next I write, only if someone is POSTing a Form.</P>
<P align="justify">Write the contents of the <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element, in this case the value of the POSTed Form field called "title" (this one), to the <CODE><FONT face="courier, monospaced">title</FONT></CODE> Node of our selected <CODE><FONT face="courier, monospaced">item</FONT></CODE> in the external file, as Text.</P>
<P align="justify">The <CODE><FONT face="courier, monospaced">fp:write</FONT></CODE> element does not emit anything into the <CODE><FONT face="courier, monospaced"><input/></FONT></CODE> tag, except status Attributes. </P>
<P align="justify">After finishing the write, we read the info back out, this is what ends up being the contents of the <CODE><FONT face="courier, monospaced">input</FONT></CODE> element. I am reading it back out incase I want to display that the user has written etc.</P>
<P align="justify">Lastly, only get the default value for the field if someone is GETting a Form.</P>
</FONT></TD></TR></TABLE></DIV><BR>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT color="#0086b2" face="arial,helvetica,sanserif" size="-1"><I>
Copyright © 1999-2000 The Apache Software Foundation.
All Rights Reserved.
</I></FONT></TD></TR></TABLE></BODY></HTML>
|