Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>The following transformation uses an external parameter (and can easily be adjusted to read from another document) the desired sections and their desired order</strong>:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:param name="pRanks"&gt; &lt;section name="contact-information" r="1"/&gt; &lt;section name="professional-experience-section" r="2"/&gt; &lt;section name="education-section" r="3"/&gt; &lt;/xsl:param&gt; &lt;xsl:variable name="vRanks" select= "document('')/*/xsl:param[@name='pRanks']"/&gt; &lt;xsl:template match="/resume"&gt; &lt;xsl:apply-templates select="*[name()=$vRanks/*/@name]"&gt; &lt;xsl:sort select="$vRanks/*[@name=name(current())]/@r" data-type="number"/&gt; &lt;/xsl:apply-templates&gt; &lt;/xsl:template&gt; &lt;xsl:template match="contact-information"&gt; &lt;xsl:value-of select="full-name"/&gt; &lt;xsl:value-of select="address_line_1"/&gt; &lt;xsl:value-of select="address_line_2"/&gt; &lt;xsl:value-of select="city"/&gt; &lt;xsl:value-of select="state"/&gt; &lt;xsl:value-of select="country"/&gt; &lt;xsl:value-of select="phone"/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="company"&gt; &lt;!--for company name--&gt; &lt;xsl:value-of select="name"/&gt; &lt;xsl:value-of select="city"/&gt;, &lt;xsl:value-of select="state"/&gt; &lt;xsl:value-of select="country"/&gt; &lt;!--loop into job title--&gt; &lt;xsl:for-each select="job-title"&gt; &lt;!--for job title--&gt; &lt;xsl:value-of select="title"/&gt; &lt;!--for job start date and job end date--&gt; &lt;xsl:value-of select="start-date"/&gt; – &lt;xsl:value-of select="end-date"/&gt; &lt;!--Loop into job description--&gt; &lt;xsl:for-each select="job-description"&gt; &lt;!--loop into each bullet point--&gt; &lt;xsl:for-each select="bullet-point"&gt; &lt;xsl:value-of select="statement"/&gt; &lt;/xsl:for-each&gt; &lt;/xsl:for-each&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; &lt;xsl:template match="institution"&gt; &lt;!--for institution name --&gt; &lt;xsl:value-of select="name"/&gt; &lt;!--for institution city and state--&gt; &lt;xsl:value-of select="city"/&gt;, &lt;xsl:value-of select="state"/&gt; &lt;xsl:value-of select="country"/&gt; &lt;!--for degree of a particular institution--&gt; &lt;xsl:value-of select="degree"/&gt;-&lt;xsl:value-of select="expected-completion-date"/&gt; &lt;xsl:for-each select="bullet-point"&gt; &lt;xsl:for-each select="statement" &gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:for-each&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; &lt;xsl:template match="education-section"&gt; &lt;!--education section--&gt; &lt;!--for education section's section name--&gt; &lt;xsl:value-of select="section-name"/&gt; &lt;!--loop into each institution name--&gt; &lt;xsl:apply-templates select="institution"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>Do note</strong>:</p> <p>I haven't corrected any of the specific processing that was provided -- just grouped it into templates and provided the ordering mechanism. It is up to the OP (original poster) to decide how to finalize the presentation.</p> <p>In particular, most of the code can still be refined by grouping it into templates, which will allow decoupling the code, simplifying it and dectreasing the dependencies and hard-coded information.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload