shailendra vasale

Ranch Hand
+ Follow
since Dec 17, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by shailendra vasale

hi Friends,
I would like to know whether there is any server which runs both .asp and .jsp.With Tomcat using ISAPI we can redirect the jsp request from IIS to Tomcat but I want it to be done with single server.Is there any server?
Thamks in advance.
Regards,
SHAILENDRA.
23 years ago
hi Friends,
Even I tried the link given by Mapraputa,but what I see is a blank page .But when I view the source of that page it shows the right thing.I'm facing the same problem and me too is confused.Is it a problem with my coding or IE or XSLT
Can anyone throw a light on this to get the solution.
Thanks.
Regards,
SHAILENDRA.
hi,
I got the desired o/p by making changes in my merge.xsl as -
" //.....
<xsl:for-each select="$sty/xsp : page/style/child::*">
//..... "

But can anyone help me for my Question 1? I'm still stuck to that.
Thanks.
Regards,
SHAILENDRA.
hi Mapraputa Is,
Thanks for your reply.Well! I merged two xml files using document('filename.xml').It works fine with following examples.But don't the same o/p on inserting cocoon pi and xsp declaration.
margin.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="merge.xsl" type="text/xsl"?>
<margin>
<margin1>5</margin1>
<margin2>10</margin2>
</margin>

style.xml
---------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xslt"?>
<style>
<style1>
<cost>100</cost>
</style1>
<style2>
<cost>200</cost>
</style2>
</style>

merge.xsl
---------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl utput method="xml"/>
<!--load the merge file -->
<xsl:variable name="sty" select="document(
'style.xml')"/>
<!-- combine the files -->
<xsl:template match="/">
<style1>
<!-- select all the child nodes of the margin tag in
the main file -->
<xsl:for-each select="margin/child::*">
<!-- copy the margin tag -->
<xsl:copy-of select="."/>
</xsl:for-each>
<!-- and all the child nodes of the style tag in the
merge file -->
<xsl:for-each select="$sty/style/child::*">
<!-- copy the style tag -->
<xsl:copy-of select="."/>
</xsl:for-each>
</style1>
</xsl:template>
</xsl:stylesheet>
-------------------------
O/P : 5 10 100 200
-------------------------
But when I insert the cocoon pi and xsp namespace declaration in both of my xml files then the o/p is only from margin.xml file.
eg the changes made in my magin.xml files are -
margin.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<xsp : page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<?xml-stylesheet href="merge.xsl" type="text/xsl"?>
<margin>
<margin1>5</margin1>
<margin2>10</margin2>
</margin>
</xsp : page>

-------------------------
O/P : 5 10
-------------------------

What changes r required to make in my merge.xsl file.
Thanks in advance.
Regards,
SHAILENDRA.

[This message has been edited by shailendra vasale (edited August 08, 2001).]
hi All,
I am facing two problems.Can anyone help me out.
1. I'm generating a xml file using DOM Object reading contents from my database.Now I want to insert a tag <xsp : page> in my .xml file when it gets created.So when I use
" set rootElement=domObj.CreateNode("Element","xsp : page","")
domObj.appendchild(rootElement) "
The server throws error.
I even tried doing it using ISO-Latin-1 Character Set[:] but couldn't succeed.Can you help me out.
2. I want to refer two different xml files in my single xsl,how can I do this?.Using External Entities it is possible to make a single xml document of two different files and can apply xsl to that but what I want to do is - I want to take the data from two diff xml files,do calculation and show the result,using single xsl.How can I do this?
Thanks in advance.
Regards,
SHAILENDRA.
hi Mapraputa Is,
Thanks for such a detailed reply.Actually I was out for a few days so couldn't reply you immediately.My prob has been solved.But there is one more thing troubling me .In this case,I'm generating .xml file using DOM Object reading contents from my database.Now I want to insert a tag <xsp : page> in my .xml file when it gets created.So when I use
" set rootElement=domObj.CreateNode("Element","xsp : page","")
domObj.appendchild(rootElement) "
The server throws error.
I even tried doing it using ISO-Latin-1 Character Set[:] but couldn't succeed.Can you help me out.
Thanks in advance.
Regards,
SHAILENDRA.

[This message has been edited by shailendra vasale (edited August 06, 2001).]
hi Mapraputa,
Here is my code---
MyXML.xml
---------
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="MyXSL.xsl" type="text/xsl"?>
<xsp age language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<page>
<title>Hello</title>
<tag1>FirstTag</tag1>
<tag2>SecondTag</tag2>
<p>Hello World!.</p>
</page>
</xsp age>
--------------------------------------------------------------
Now in my xsl I want to check the value of <tag1>,if it's "FirstTag" then do something otherwise do something else.Hope this will help to find out the prob
My <xsl:choose>[as posted above] is not working.

Thanks.
Regards,
SHAILENDRA
hi All,
I'm facing prob using <xsl:choose> in my stylesheet while working with Cocoon.
When I use the conditional statement -
"<xsl:choose>
<xsl:when test=".[tag1='FirstTag']">
..some code
</xsl:when>
<xsl therwise>
..some code
</xsl therwise>
</xsl:choose> "
The Cocoon engine throws following exception -
" org.apache.xalan.xslt.XSLProcessorException: pattern = '.[tag1='FirstTag']'
'..[predicate]' or '.[predicate]' is illegal syntax. Use 'self::node()[predicate]' instead. "

And when I use " self::tag1['FirstTag'] ".The engine works fine without executing the code of <xsl:choose> tag.
Can anyone please help me out.What I feel is there may be some syntax problem but I failed to locate it.
Thanks in advance.
Regards,
SHAILENDRA
hi All,
I'm running Sample.xml example which I placed under ../samples
directory along with Sample.xsl.When I invoke the url as -" http://localhost:8080/cocoon/samples/Sample.xml " running tomcat server,the cocoon engine throws as exception -
" java.lang.NoClassDefFoundError: sun/tools/javac/Main
at org.apache.cocoon.processor.xsp.language.java.SunJavaCompiler.compile(SunJavaCompiler.java:68)
at org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(Compiled Code)
at org.apache.cocoon.processor.xsp.XSPProcessor.process(Compiled Code)
at org.apache.cocoon.Engine.handle(Compiled Code)
at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479) "
----------------------------------------------------------------
Can anyone please help me out.
Here is the Sample.xml and Sample.xsl files.
Sample.xml
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="../samples/Sample.xsl" type="text/xsl"?>

<xsp age language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>

<xsp:logic>
private static int numHits = 0;

private synchronized int getNumHits( ) {
return ++numHits;
}
</xsp:logic>

<page>
<title>Hit Counter</title>

<p>I've been requested <xsp:expr>getNumHits( )</xsp:expr> times.</p>
</page>
</xsp age>
----------------------------------------------------------------
Sample.xsl
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>

<xsl:template match="page">
<xsl rocessing-instruction name="cocoon-format">
type="text/html"
</xsl rocessing-instruction>
<html>
<head>
<title><xsl:value-of select="title"/></title>
</head>
<body>
<xsl:apply-templates select="*[not(self::title)]" />
</body>
</html>
</xsl:template>

<xsl:template match="p">
<p align="center">
<xsl:apply-templates />
</p>
</xsl:template>

</xsl:stylesheet>
----------------------------------------------------------------
Thanks in advance.
Regards,
SHAILENDRA.
hi Ajith,

I need a help from you.I read your reply on this post - "http://www.javaranch.com/ubb/Forum31/HTML/000151.html".I installed Cocoon-1.8.2 with Tomcat-3.2.3.I installed it as per the installation guide at -"http://xml.apache.org/cocoon/install.html".It is working fine when I type url - "http://localhost:8080/cocoon/Cocoon.xml"
Now I want to use the Producer+Processor+Formatter pattern to run.So how can I do this? I'm stuck at this point,how the producer generate .xml file and then how it goes to the processor.Will you please sugguest in this regard.
Thanks in advance.
Regards,
SHAILENDRA.
hi All,
I installed Cocoon-1.8.2 with Tomcat-3.2.3 server.Now I want to run the following XSP file.
So in which directory of tomcat I should put this Sample.xsp file.Then how to run this? Does it require Sample.xsl also?
Can anybody please help me in running this.
Thanks in advance.
Regards,
SHAILENDRA.
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="sample.xsl" type="text/xsl"?>
<xsp age language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<page title="Time of Day">

<xsp:logic>
// Define a variable to hold the time of day
Date now = new Date();
</xsp:logic>

<p>
To the best of my knowledge, it's now
<!-- Substitute time of day here -->
<xsp:expr>now</xsp:expr>
</p>
</page>
</xsp age>
hi All,

I'm using Cocoon with Tomcat server.I installed it and it is working fine with default producer,processor and formatter.But when I write my own producer where should I plaxe that [in which dir],where should be my servlet/jsp and which type of document should I pass to it.I stuck at this point only,not getting how to run my own producer.
Can anyone guide me with some example.
Thanks in advance.
Regards,
SHAILENDRA.
hi All,
I installed Cocoon successfully for tomcat and it works fine.
Can anyone plz suggest some links from where I'll get more practical examples.
Thanks in advance.
Regards,
SHAILENDRA.
hi All,

I installed Cocoon-1.8.2 for jakarta-tomcat3.2.3.I set all the classpath but it gives error when I type the url
"http://localhost:8080/cocoon/Cocoon.xml".The only thing I missed is - to include files into the main Apache configuration file in to httpd.conf.Actually I couldn't find the httpd.conf file in tomcat directory.The error is as follows -
Unable to open resource: [path-to-cocoon]/WEB-INF/cocoon.properties
Can anyone please help me out.
Thansks in advance.
Regards,
SHAILENDRA.
hi All,
Can anyone please explain what Cocoon is all about? What exactly it does? And how we can use it with Java?
The sites,tutorials & books available for this.
Thanks in advance.
SHAILENDRA.