Pardha

Greenhorn
+ Follow
since May 13, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Pardha

Hi thanks for your suggestion but unfortunately that is also not working..
I got hanged over here....
is there any other solution?
given namespaces also not supported here....
I am using IE 5.5 May be it amy work on IE 6.0 but We have to work on IE 5.5.
Please help me in finding solving this problem
Thanking u in advance
Pardha
Hi Thanks for ur Suggestion but unfortunately
the new name space is not working at all... after implementing that the data which I was getting also disappeared
btw FYI I am using IE 5.5 will it make any difference?
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
Thanking you in advance
Saradhi
"deprecated" stylesheet namespace?
Here I am using IE 5.50..

btw can u please tell me how to find out which namespace I should use?
and is it <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns="http://www.w3.org/TR/REC-html40" result-ns=""> deprecared?
one more thing...
<A href="#{@id}-DESCRIPTION" name="{@id}-COST">
<xsl:value-of select="name"/>
</A>
I worte above code.... but still could not get value of id instead it is showing the string as it is.. what might be the reason?
Thanks in advance
Pardha
Hi I could add some hyperlinks with ids so that in same page I can nevigate..
But it is not working..
****************
<A href="#{@id}-DESCRIPTION" name="{@id}-COST">
<xsl:value-of select="name"/>
</A>
****************
in the above code snippet I could not get the value of {@id}???
and when I add xsl utput tag then it raised the following error
"Keyword xsl utput may not be used here. " what might be the reasong...
Thanks in advance
Saradhi....

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns="http://www.w3.org/TR/REC-html40" result-ns="">
<xsl utput method="html" version="4.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match = "/">
<html>
<body>
<h2> Juicers Example </h2>
<table border="1">
<tr>
<td>Jucers</td>
<td>Cost</td>
</tr>
<xsl:for-each select="/juicers/juicer">
<tr>
<td>
<A href="#{@id}-DESCRIPTION" name="{@id}-COST">
<xsl:value-of select="name"/>
</A>
</td>
<td>

$ <xsl:value-of select="cost[@currency='USD']"/>
</td>
</tr>
</xsl:for-each>

</table>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<table border="1" width="100%">
<tr>
<td>Jucers</td>
<td>Description</td>
</tr>
<xsl:for-each select="/juicers/juicer">
<tr>
<td>
<a href="#{@id}-COST" name="{@id}-DESCRIPTION">
<xsl:value-of select="name"/>
</a>
</td>
<td>
<xsl:value-of select="description"/>
</td>
</tr>
</xsl:for-each>
</table>


</body>
</html>
</xsl:template>
</xsl:stylesheet>
please some one help me in finding the solution....
Hi Here I am pasting my xml and xsl files....
here iam displaying all titles of each CD with a hyper link.....
Question 1:
now when user clicks on title then the corresponding details should be displayed on same page.

Question 2:
When clicked on title then the page should be redirected to another page
please help me in finding out them...
I tried the Question 1.. but I am not getting results which I want..
Hope this info is sufficient...
Thank u in advance
Pardha
XML File :
-------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
</catalog>
***************************************
XSL File :
-------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns="http://www.w3.org/TR/REC-html40" result-ns="">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1" width="40%">
<tr bgcolor="#9acd32">
<th width="50%">Title</th>
</tr>
<xsl:for-each select="/catalog/cd">
<tr>
<td>
<a href="#{generate-id(cd)}">
<xsl:value-of select="title" />
</a>
</td>
</tr>
</xsl:for-each>
</table>

<TABLE border="1" width="25%">
<TR><TH>Artist</TH></TR>
<xsl:for-each select="catalog/cd">
<TR>
<TD>
<A name="{generate-id(cd)}">
<xsl:value-of select="artist"/>
</A>
</TD>
</TR>
</xsl:for-each>
</TABLE>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Hi
I have an xml document with following elemnts
Empid, Name, etc...

I could display the Empid, Name... etc using xslt on browser...
Now I want to put Hyperlink to empid.. clicking on that it shold take me to another page..and the Selected empid should be passed as query string to another jsp page..
For eg: <a href="empdetails.jsp?empid=1234">EmpId</a>
I want to do this using xsl on an XML file
Please help me in solving this problem
or
pls. give me good site name where I can find this
Thanking u inadvance
Pardha

Hi I am new to EJB and trying to execute my first application
but I am getting the following error please help me in finding out the solution
---------------
java.lang.ClassCastException
at com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at HelloClient.main(HelloClient.java:16)
---------------------------------------
Here I am pasting my Java Code
** Home Object **
import javax.ejb.*;
import java.rmi.RemoteException;
public interface HelloHome extends EJBHome
{
Hello create() throws RemoteException,CreateException;
}
==================================
** Remote Interface **
import javax.ejb.*;
import java.rmi.RemoteException;
import java.rmi.Remote;
public interface Hello extends EJBObject
{
public String hello() throws java.rmi.RemoteException;
}
========================
** My Bean **
import javax.ejb.*;
public class HelloBean implements SessionBean
{
public void ejbCreate()
{
System.out.println("ejbCreated()");
}
public void ejbRemove()
{
System.out.println("ejbRemove()");
}
public void ejbActivate()
{
System.out.println("ejbActivate()");
}
public void ejbPassivate()
{
System.out.println("ejbPassivate()");
}
public void setSessionContext(SessionContext ctx)
{
System.out.println("setSessionContext()");
}
// Business methods
public String hello()
{
System.out.println("Hello()");
return "Hello World!";
}
}
===========================
** Client ******
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.*;
import java.util.Properties;
//import javax.rmi.PortableRemoteObect;
public class HelloClient
{
public static void main(String[] args)
{
try
{
Properties props=System.getProperties();
Context ctx=new InitialContext(props);
Object obj = ctx.lookup("HelloBean");
HelloHome home= (HelloHome) PortableRemoteObject.narrow(obj, HelloHome.class);
Hello hello=home.create();
System.out.println(hello.hello());
hello.remove();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
=====================================
Please Help I have been stuck here since 8 days not finding any solution.
Thanking you in advance
Saradhi

------------------
Intelligent Hard work never goes waste
WSDL stands for Web Service Definition Language.
"WSDL is a CONTRAC between server and client"
In order to successfully call a Web service you will need to know how to get to the service, what operations the service supports, what parameters the service expects, and what the service returns. WSDL provides all of this information in an XML document that can be read or machine-processed.
23 years ago
Hi
I have done a small SOAP application using MS.SOAP toolkit 2.0
I have generated WSDL and it is working fine.
I want to call tohse services from java. Now I want to know what should I have at client side to call those services and how to call them?
Thankin you in advance
Regards
Saradhi
23 years ago
Hi thnk u
I got it now and also I woul like to share the some more info which I have collected.
SAX OR DOM
SAX :-
SAX is a stream-based parsing process. You can easily configure a SAX parse to grab certain tags and/or their contents, and ignore others. This makes it quick and effective for extracting specific information from potentially large XML sources.
Another important different is that SAX is read-only while DOM is read-write. This means SAX doesnot have any facility using which one can change the content of the XML document being parsed. On the otherhand, DOM provides mutator methods to get/set XML data and the changes done during parsing are durable.
DOM :-
DOM is a document-based parsing process. A DOM parser reads a whole XML source into a large, complex internal structure and provides lots of operations to extract, insert and modify the loaded data. DOM is good for when you need to load and transform whole documents, or create new XML documents in memory ready for such a peocess.

Perhaps this is the one of the most compelling reason to consider DOM-parsing despite of its performance issues. Ofcourse one can always implement a hybrid-SAX that allows manipulating the XML content. It is not impossible, but may be redundant since DOM is available out there which can do the exact same thing!

-----
Which approach to use also depends on the ultimate use for the data. If you are parsing the XML in order to build some application-specific data structure from it, then using DOM can result in even larger memory requirements, as you duplicate all the information in the DOM while building it.
Don't forget though, that there is a difference between the DOM and a DOM. You can build your own lighter-weight Document Object Model, using SAX or any other simple parsing system. JDOM is an example of this; it's a full document model which is much easier to traverse in Java than using the official DOM interface.
hi
sitll Iam confused whether to use DOM or SAX
how to decide which one to be opted and what
criteria shall I have to opt.
Thanking u
Saradhi
Hi
I am using DOM. I created an XML document by retrieving data from database and it contains more than 500 records.
Now I want to fetch data of particular record from xml doc.
How come it is possible using DOM
please help me if any one knows this
Thanking u
Saradhi
HI
Is it possible to query data in xml doucment and if possible
how can we do that.
Thanking u
Saradhi
Hi
Please help me in creating xml document
I am new to xml and started recently
First let me put my task here.
I have to create xml document retrieving data from the database.
Now I am not clear whether to go for DOM/SAX.

here I am pasting my simple code sample which I worked out
please suggest me that Can I proceed simalarly with the
database?
Thanking u in advance
Saradhi
** begin code **
import com.ibm.xml.parsers.DOMParser;
import org.apache.xerces.dom.*;
import org.apache.xml.serialize.*;
import org.w3c.dom.Document;
import org.w3c.dom.*;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.io.*;
public class createXML
{
public Document getXML()
{
Document doc=null;
try
{
DOMParser domparsersource2 = new DOMParser();
Document Doc1 = domparsersource2.getDocument();

doc = new DocumentImpl();
Node root = doc.createElement("Book");
doc.appendChild(root);
Node node1 = doc.createElement("Name");
Node node2 = doc.createElement("Price");
Node node3 = doc.createElement("ISBN");
Node textNode1 = doc.createTextNode("Professional XML");
Node textNode2 = doc.createTextNode("500");
Node textNode3 = doc.createTextNode("b-x234");
node1.appendChild(textNode1);
node2.appendChild(textNode2);
node3.appendChild(textNode3);
root.appendChild(node1);
root.appendChild(node2);
root.appendChild(node3);
FileOutputStream fos = new FileOutputStream("test.xml");
OutputFormat of = new OutputFormat();
XMLSerializer slz=new XMLSerializer(fos, of);
slz.serialize(doc);
}
catch (Exception e)
{
System.err.println(e);
}
return doc;
}
/*public static void getNodes(Node node)
{
if (node.hasChildNodes()){
NodeList nl=node.getChildNodes();
System.out.println(node.getNodeName()+" "+node.getNodeValue());
for(int i=0;i<nl.getLength();i++)
{
nl.item(i);
getNodes(nl.item(i));
}
}
}
*/
public static void main(String args[])
{
Document D = new createXML().getXML();
Element e =D.getDocumentElement();
createXML createxml=new createXML();
// createxml.getNodes(e);
}
}
** end code **