I'm running into a problem with axis2 and ajax. I'm getting xml from one of my web services with jQuery's ajax functions, and using this jquery plugin to transform the result xml to html.
Here's an example of the relevant xml that the service returns.
<ns:getPatientsByDoctorResponse>
<ns:return type="com.emolst.jdbc.PatientBean">
<ax23:firstName>Bryce</ax23:firstName>
<ax23:lastName>Thompson</ax23:lastName>
</ns:return>
</ns:getPatientsByDoctorResponse>
I looked through the xml Document object that I get from the jQuery ajax call, and it seems to have stripped the namespaces from the tags and made the tags all lowercase. However, I can't seem to get my xsl templates to recognize any of the tags.
Here's what I have now in the xsl.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<option>success1</option>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="//return">
<option>success2</option>
<option>
<xsl:value-of select="firstname"/> <xsl:value-of select="lastname"/>
</option>
</xsl:template>
</xsl:transform>
The best I can get is the success1 option. I found some info here about making axis2 play nicer with ajax, but that looks like it might screw up the java service clients I have.
Here's the javascript in question.
$("select[name=patientlist]").transform({
xml:{
url:"/axis2/services/PatientService/getPatientsByDoctor",
data {
docKey: "6"
},
type:"GET",
dataType:"xml"
},
xsl:"xsl/patients-option.xsl"
});
So am I doing something stupid or is there a better way to do this? Thanks for any help.