Thanks so much for the help. I substituted the xpl doc you gave me for the one I had, and added the entry you gave me to the controller, but I still get the same result: a blank page except for the Orbeon copyright notice. The log says: "2003-02-28 11:31:07,796 ERROR OXF ProcessorServlet - Exception with no location data" with a huge stack trace that begins with a NullPointerException. Perhaps this means that some data input in the pipeline is null because the output wasn't assigned properly in the previous step?
The pipeline I'm using is the same as you supplied, with a few changes to the stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline">
<p:param name="class-schedule" type="input"/>
<p:processor uri="oxf/processor/xslt">
<!--<p:input name="config" href="Merge.xsl"/>-->
<p:input name="config">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- the param for the other xml file that will
be merged with the xml that was submitted -->
<xsl:param name="catalog">CourseCatalog.xml</xsl:param>
<xsl:template match="/">
<xsl:text>Matched root</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ClassSchedules">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ClassSchedule">
<xsl:variable name="id" select="@id"/>
<Course id="{$id}">
<!--<xsl:copy-of select="document($catalog)//[EMAIL PROTECTED]/*"/>-->
<xsl:copy-of select="*"/>
</Course>
</xsl:template>
</xsl:stylesheet>
</p:input>
<p:input name="data" href="#class-schedule"/>
<p:output name="data" id="scheduled-course"/>
</p:processor>
<p:processor uri="oxf/processor/xml-serializer">
<p:input name="config">
<config/>
</p:input>
<p:input name="data" href="#scheduled-course"/>
</p:processor>
</p:config>
And the relevant entry in the controller.xml file is what you gave me:
<page path-info="/hello/createClass" model="oxf:/hello/CreateScheduledCourse.xpl" xforms="oxf:/hello/course-schedule.xml"/>
The xforms model (course-schedule.xml) and the other files are in the following directory, relative to webapps: oxf\WEB-INF\resources\hello.
Any ideas about what the problem could be, or how I could go about debugging this?
thanks,
calvin
Julien Mercay wrote:
Hi Calvin,
- You must use the p:input's href attribute to refer to an existing p:output in the same pipeline. The ref attribute is reserved for binding to outputs, defined by <p:param type="output"/>
- While you certainly can use the xforms-input processor by hand, it is not recommended. The Web App controller does most of the work for you. See the documentation here:
http://www.orbeon.com/oxf/doc/processors-controller#N101B9
The following entry in the controller.xml creates a pipeline that fills in the form for you and pass it to your pipeline, via the class-schedule input parameter.
<page path-info="/hello/createClass" model="oxf:/hello/CreateScheduledCourse.xpl" xforms="oxf:/hello/course-schedule.xml"/>
- You don't need to specify the content-type in the XML serializer configuration, since it is the default. An empty <config/> element works just as well.
Here is a modified XPL that should work for you:
<?xml version="1.0" encoding="UTF-8"?>
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline">
<p:param name="class-schedule" type="input"/>
<p:processor uri="oxf/processor/xslt"> <!--<p:input name="config" href="Merge.xsl"/>--> <p:input name="config">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- the param for the other xml file that will
be merged with the xml that was submitted -->
<xsl:param name="catalog">CourseCatalog.xml</xsl:param>
<xsl:template match="/">
<xsl:text>Matched root</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="CourseCatalog">
<ScheduleOfClasses>
<xsl:apply-templates/>
</ScheduleOfClasses>
</xsl:template>
<xsl:template match="Courses">
<Courses>
<xsl:apply-templates/>
</Courses>
</xsl:template>
<xsl:template match="Course">
<xsl:variable name="id" select="@id"/>
<Course id="{$id}">
<xsl:copy-of
select="document($catalog)//[EMAIL PROTECTED]/*"/>
<xsl:copy-of select="*"/>
</Course>
</xsl:template>
</xsl:stylesheet>
</p:input> <p:input name="data" href="#class-schedule"/> <p:output name="data" id="scheduled-course"/> </p:processor>
<p:processor uri="oxf/processor/xml-serializer"> <p:input name="config"> <config/> </p:input> <p:input name="data" href="#scheduled-course"/> </p:processor>
</p:config>
Please let me know if I can be of further help.
Julien Mercay Orbeon Inc.
