You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Brent L Johnson <br...@bjohnson.net> on 2004/02/12 20:16:42 UTC
Reading Configuration Data in an XSP
I'm sure this question has been posed to this list, but
I searched around on the archives all the way back to 2002
and didn't find anything (at least with the keywords I
was searching for).
I'm using the authentication framework to handle logins,
I then store the person's userID in the session. I've got
a config.xml file that I want to hold user configuration
data. I.e.
<config>
<user id="1">
<someconfigtag>blah</someconfigtag>
</user>
</config>
In XSP - I'd like some conditional cinclude tags. For example,
if "/config/user[@id='1']/someconfigtag = 'blah'" I want to add
a cinclude. If its not 'blah' then dont.
One solution would be to just use Java in the XSP to read
the file into a Document, then run some Xalan XPath queries
to test for the tags. This is a kludgy way to do it though.
Is there a better way to do this? Is anyone doing something
similar? Can I read data from an external XML file in an XSP?
I could just use the config.xml as the generator then
use XSL to add the cinclude tags, then perform the cinclude
transformer after that point in the pipeline. The problem
is, I need the generator be to XSP because I'm doing more
than just adding these cincludes.
Thanks,
- Brent
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org