cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yasir Khalil Al Masri" <yalma...@next.jo>
Subject Calling an XML file from an XSP page
Date Sat, 21 Jul 2001 10:51:15 GMT
Hello,

I'm tring in one of the XSP pages to call an XML file that resides on 
my machine.  It came to me that as you can call an image by mapping it 
through:
<map:match pattern="images/**.png">
   <map:read src="project/images/{1}.png" mime-type="image/png"/>
</map:match>

you can do the same for the XML files:
<map:match pattern="**.xml">
   <map:read src="project/XMLfiles/{1}.xml" mime-type="text/xml"/>
</map:match>

Now in one of the XSP files, I'm doing this:
InputSource input = new InputSource( new FileInputStream( 
                  "votes.xml" ) );
where votes.xml is in the XMLfiles directory.  I suppose that mapping 
like this is clear enough to tell the cocoon engine where to find this 
file, but whenever I execute this code I got a large stack dumped to 
the server monitor saying that it cannot find the file mentioned.  I 
tried to put it in many shapes like:
InputSource input = new InputSource( new FileInputStream( 
                  "cocoon:/XMLfiles/votes.xml" ) );

Even I tried to call it directly from the current working directory, or 
from the root of the project without mapping, I always got the same 
result.

I succeeded only when I hardcoded the full path of the file starting 
from the current drive, which I don't think it's a professional way to 
do this.

Do anybody have comment on this?

Thanx.



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message