You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nadine Carlton <na...@hp.com> on 2000/12/13 02:36:02 UTC
xsp and util:include-file
Hi,
I have used util:include-file to include an XML document into my
xsp page. I have some of the basic functionality working that I
want to use, but a couple of things don't work the way I thought
they would.
I don't seem to be able to use a variable to the util:include-file
taglib. For example,
String filename = request.getParameter("filename");
if (filename != null) {
String filepath = XSPUtil.relativeFilename(filename, request, (ServletContext) context);
}
<util:include-file name="<xsp:expr> filepath </xsp:path>" />
Gets an error:
org.xml.sax.SAXParseException: The value of attribute "name" must not contain the '<' character.
Hard coding the file works: <util:include-file name="evueinput.xml" />
<util:include-file name="filepath" /> looks for a file called filepath.
After the file is added to document, I'm able to access elements with
document.getElementsByTagName("myelement"),
but document.getElementsByTagNameNS(NAMESPACE_URI,"myelement")
doesn't return any nodes. I've tried NAMESPACE_URI values of * and xsp:,
but neither works. Should I be trying to use the NS methods? I'm
using Cocoon 1.7.3.
Finally, the document I'm including has input information
that I don't want to include in the output. I'm currently
removing the document subtree using XSLT. Is there a better way
to do it?
Nadine Carlton