Hi Greg,
I experienced some of the same problems understanding the 'paradigm
shift' that is xml/oxf development as you seem to be having. Its tricky to
begin with but worth the effort I think. Here are some things that may help
you.
1. Be very, very careful of namespaces.. Its really easy to do
<d:table xmlns="blah" />
and then
<xsl:copy-of select="d:table">
And wonder why things aren't being output. Things aren't being output
because the xslt processor doesn't know what a d:table is unless you have an
xmlns="blah" in your xslt as well. <d:table> may look like an xhtml tag but
its not unless you have it in the xhtml namespace.
2. Take a look at the chainsaw log4j tool, the log4j.xml config and the
debug="debug-comment" attribute on processor input and output. This makes it
really easy to track xml through your pipeline from beginning to end and its
really easy to setup (at least in oxf 2.1). Chainsaw is a nice GUI tool that
shows the beginning of a http request, the xml at each point you add a debug
and the end of a http request.
3. The oxf epilogue.xpl is a little arcane. :-) But I think its what your
missing right now. You need it in the controller.xml <view> to transform
your <d:table> elements into xhtml. And you need the oxf-theme and welcome
folders too if you want to use it out of the box. You may want to consider
not using an epilogue at all and outputing xhtml directly yourself until
your get xforms and actions sorted out.
4. A good way to start is to copy the oxf webapp and then keep deleting
things until you get down to helloworld.
5. persistance and xforms. The web application controller is very, very
flexible. Almost too flexible. ;-) You need to know when NOT to use some of
the features available.. When I first began I was creating very complex
pipelines to make persistance work and using the xforms processors manually.
This is almost never necessary. Here is the simplest way I have found so far
to use the WAC and handle forms persistance. You mileage may vary..
<page path-info="/credit-card"
xforms="oxf:/credit-card/xform-model.xml"
model="oxf:/credit-card/model.xpl"
view="oxf:/credit-card/xform-view.xml">
<action/>
</page>
a) xforms: Define your default instance here. ie. What you would provide
when a user hits 'new'. This will almost always be a plain xml file.
b) model: This is where the real work happens. You read persisted data
here. The model will usually be xpl. OXF will automatically merge form
submission b4 this step so your input here will contain your defaults from
a) + user submission if there is any. A useful strategy here is to use
xupdate or xslt to extend this input instance with persisted data from a DB
or session and reoutput the extended instance. ie. One input (instance) and
one output (instance). I don't use the second data output very often.
c) view: Two common scenarios.
i). You have a plain xml file here. It is in a standard document
format. eg. xhtml document or a forrest document or an oxf document or a
docbook document. It contains embedded <xform> elements. After the view OXF
will replace the <xform> elements with data from the input instance from b).
ii) Often you need a simple xslt file here. This xslt generates a
standard document format. eg. xhtml document or a forrest document or an oxf
document or a docbook document. This output contains embedded <xform>
elements. After this xslt OXF will replace the <xform> elements using the
input instance from b).
When do you need xslt vs xml in the view? Usually you need xslt to augment
missing xforms features such as <xf:repeat>. As extra elements of the xforms
spec are added then more views may be pure xml. Most of my xslt views are
called things like imageresultset2document.xsl or photoform2document.xsl.
Finally, if you find you need an xpl file in c) then you may be trying to do
something unnecessarily complicated.
d) action: This is where you persist your form submission to a database
or session to later be retrieved in b).
Finally use the epilogue to handle menus and xhtml presentation. My epilogue
could be called document2xhtml.xpl.
Damon.
----- Original Message -----
From: "Greg Hess" <[EMAIL PROTECTED]>
To: "Oxf-Users" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:51 PM
Subject: Layout ignored???
> Hi All,
>
> I have build a xform-view following many of the examples using the <d:p>
> and <d:table> tags to properly layout the form. For some reason all the
> <d> tags are not being interpreted as they all show up in the output.
> Below is my code:
_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users