The document() function should work as expected, with relative and absolute URLs. Note that a relative URL doesn't begin with oxf:/. For example, "dir/mydoc.xml" is a relative to the current directory. "oxf:/default/dir/mydoc.xml" is the corresponding absolute URL. Caching and dependencies also work correctly with the document() function. In your examples, the following two expressions should work:
document('clientOrderSettingsTabs.xml') (assuming the file is in the same dir. as the XSL)
document('oxf:/default/clientOrderSettingsTabs.xml')
Are you certain that these files exist?
The solution suggested by Justin would work as well. You should modify the XPL statement that calls your XSLT Transformer. Assuming the original transformer is called like:
<p:processor uri="oxf/processor/xslt"> <p:input name="config" href="stylesheet.xsl"/> <p:input name="data" href="#data"/> <p:output name="data" id="out"/> <p:processor>
The aggregation is done like that:
<p:processor uri="oxf/processor/xslt">
<p:input name="config" href="stylesheet.xsl"/>
<p:input name="data" href="aggregate('root', #data, clientOrderSettingsTabs.xml)"/>
<p:output name="data" id="out"/>
<p:processor>
And don't forget to prefix all path in your stylesheet with /root since the input document now looks like:
<root> [content of #data] [content of clientOrderSettingsTabs.xml] </root>
Please let me now if it solve your problem.
Regards, Julien
Kesara Kudalugodaarachchi wrote:
Thanks Justin, Wasn't aware that it doesn't get cached. However tried your suggetion but in vain.
<p:input name="tabs" href="clientOrderSettingsTabs.xml" debug="tabs"/> -> in same folder as the XPL.
but that also gives me 4913716 [Thread-10] INFO OXF org.orbeon.oxf.processor.generator.BeanGenerator - Beantabs is null (I'm positive that this file has content in it)
But this used to work fine with OXF 1.5.X. Wonder whether it has anything to do with the fact that we are using it along with Struts. Because it says "Bean"tabs is null.
Kesara.
-----Original Message----- From: Justin Makeig [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 5:01 PM To: OXF Users Subject: Re: Accessing an external XML within a XSL
Because of file system dependencies such as the one's you've indicated below, I try to stay away from XSLT's document() function. (It also doesen't get cached and makes using XSLT keys much more difficult.) Try aggregating the contents of clientOrderSettingsTabs.xml to the data input that the XSLT processor receives.
- Justin Makeig
--
Center for Document Engineering
University of California, Berkeley
On 8/8/03 2:43 PM, "Kesara Kudalugodaarachchi" <[EMAIL PROTECTED]> wrote:
Hi, How can I define an external XML document in a XSL using the following construct with OXF? <xsl:apply-templates mode="applyTabsbar" select="document('clientOrderSettingsTabs.xml')"/>
I tried the following as well document('oxf:/clientOrderSettingsTabs.xml') -> XML is in the same folder
as
XSL
document('oxf:/default/clientOrderSettingsTabs.xml') -> relative to /WEB-INF/resources
because of this entry.
<context-param> <param-name>oxf.resources.webapp.rootdir</param-name> <param-value>/WEB-INF/resources</param-value> </context-param>
All of them threw up with "File not found exception"
Basically I'm trying to access a XML in the same directory as XSL or is there a way to define the XML segment within the XSL file like
<xsl:template match="/"> <tabs:tabsbar> <tabs:tab> <tabs:tabindex>4</tabs:tabindex> <tabs:name>Cover Letter</tabs:name> <tabs:url>/coverLetter</tabs:url> </tabs:tab> </tabs:tabsbar> </xsl:template> <xsl:template mode="applyTabsbar" match="/"> <xsl:call-template name="clientOrderSettingsTabsbar"> <xsl:with-param name="disable" select="false()"/> <xsl:with-param name="selectedIndex" select="1"/> </xsl:call-template> </xsl:template>
Regards, Kesara. _______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users _______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
