Below is my XML File –
<CVs>
<CV>
<Name>ABC</Name>
<Address></Address>
<Introduction></Introduction>
<CompSkills>Java, XSLT, XPATH, XML, Oracle, VB.NET</CompSkills>
<Experience>
<Profile></Profile>
<Duration></Duration>
<Info></Info>
</Experience>
<Experience>
<Profile></Profile>
<Duration></Duration>
<Info></Info>
</Experience>
<Experience>
<Profile></Profile>
<Duration></Duration>
<Info></Info>
</Experience>
<CV>
<CV>
<Name>XYZ</Name>
<Address></Address>
<Introduction></Introduction>
<CompSkills>Java, XSLT, XPATH, XML, JSP, HTML</CompSkills>
<Experience>
<Profile></Profile>
<Duration></Duration>
<Info></Info>
</Experience>
<Experience>
<Profile></Profile>
<Duration></Duration>
<Info></Info>
</Experience>
<Experience>
<Profile></Profile>
<Duration></Duration>
<Info></Info>
</Experience>
<CV>
</CVs>
below is the XSLT file – a short version to get an idea
<xsl:template match="Name">
<table align='center' width='800' style="font-family:tahoma; font-size:13pt;">
<tr><td>
<xsl:apply-templates/>
</td></tr>
</table>
</xsl:template>
<xsl:template match="Experience">
<table align='center' width='800' style="font-family:tahoma; font-size:13pt;">
<tr><td>
<xsl:apply-templates/>
</td></tr>
</table>
</xsl:template>
I am using Java as front-end. To display the output in HTML format I have an XSLT file. This XSLT file is a standard one ie; it displays all the CVs.
Now what I have to do is use a ListBox with Names of all candidates and when clicked on a particular name ONLY his CV should get displayed. I have coded the Java part to display the names of the candidates into the ListBox. Now have some trouble with displaying the CV of the selected candidate in HTML format.
The current XSLT file is displaying all the CVs. So Will I need another XSLT file which use parameter passed from the program and display its details..? If yes then some help on how to do this… ??
Thanks in advance – John
To give you an idea how this can be done, here is a complete solution that extracts all or just the wanted
CVelement (no HTML formatting is done as this isn’t relevant to the question):When this transformation is applied to the provided XML document (corrected to a well-formed one):
the wanted, correct (just the
CVwithNameXYZ is extracted) is produced:Explanation:
The wanted name or “*” must be passed externally as a global parameter (in this case named
pName) to the transformation. Read your XSLT processor documentation how this must be done, as this is implementation-dependent.