Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6775065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:51:45+00:00 2026-05-26T15:51:45+00:00

Below is my XML File – <CVs> <CV> <Name>ABC</Name> <Address></Address> <Introduction></Introduction> <CompSkills>Java, XSLT, XPATH,

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:51:46+00:00Added an answer on May 26, 2026 at 3:51 pm

    To give you an idea how this can be done, here is a complete solution that extracts all or just the wanted CV element (no HTML formatting is done as this isn’t relevant to the question):

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:param name="pName" select="'XYZ'"/>
    
     <xsl:template match="node()|@*" name="identity">
         <xsl:copy>
           <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
     </xsl:template>
    
     <xsl:template match="CV">
      <xsl:if test="$pName = Name or $pName='*'">
       <xsl:call-template name="identity"/>
      </xsl:if>
     </xsl:template>
    </xsl:stylesheet>
    

    When this transformation is applied to the provided XML document (corrected to a well-formed one):

    <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>
    

    the wanted, correct (just the CV with Name XYZ is extracted) is produced:

    <CVs>
       <CV>
          <Name>XYZ</Name>
          <Address/>
          <Introduction/>
          <CompSkills>Java, XSLT, XPATH, XML, JSP, HTML</CompSkills>
          <Experience>
             <Profile/>
             <Duration/>
             <Info/>
          </Experience>
          <Experience>
             <Profile/>
             <Duration/>
             <Info/>
          </Experience>
          <Experience>
             <Profile/>
             <Duration/>
             <Info/>
          </Experience>
       </CV>
    </CVs>
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is my XML File - <School> <Std c=8> <Name>ABC</Name> <Age>12</Age> <Name>EFG</Name> <Age>11</Age> <Name>PQR</Name>
My xml file is structures like below <outer> <inner name=nam attribute1=abc attribute2=def /> </outer>
Below is the XML file - <Seminars> <Seminar> <Venue P=ABC dt=20111223/> <Subject name=Finance> <Topic
I am trying to read the below xml file and get the name-value pairs
One of my application is generating below XML file. <root> <command name=Set> <property name=PWR.WakeupOnLAN
Below is the XML file, I am receiving - <Seminars> <Seminar> <Venue P=ABC dt=20111223/>
I have the below xml file and I need to use an xpath to
Below is my xml file called product.xml <products> <product> <name>Pen</name> <price>8</price> </product> <product> <name>Bag</name>
How to read the below xml file and write its content into a plain
I already implemented to create the XML file below with XmlTextWriter when application initialization.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.