Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's the solution that works. It's based on Tomalak's original solution with some minor modifications (like mode flags etc.) Again, thanks to Tomalak!!</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" version="1.0"&gt; &lt;xsl:import href="projDisplay.xsl"/&gt; &lt;xsl:template match="/"&gt; &lt;!-- store intermediate form as RTF --&gt; &lt;xsl:variable name="newXmlData"&gt; &lt;xsl:apply-templates mode="filter"/&gt; &lt;/xsl:variable&gt; &lt;!-- Now apply templates (with xslt-fo) defined in projDisplay.xsl with --&gt; &lt;!-- the root template as &lt;xsl:template match="projectteam" mode="display"&gt; --&gt; &lt;!-- to the above RTF (i.e. after the original XML has be convertedr) --&gt; &lt;xsl:apply-templates select="exslt:node-set($newXmlData)/projectteam" mode="display"/&gt; &lt;/xsl:template&gt; &lt;!-- use identity templates to copy and modify original XML --&gt; &lt;xsl:template match="@*|node()" mode="filter"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()" mode="filter"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;!-- replace element 'role' with a new element - role name (i.e. dev or qa) --&gt; &lt;!-- and set its value as 'hrs --&gt; &lt;xsl:template match="member/role" mode="filter"&gt; &lt;xsl:element name="{.}"&gt; &lt;xsl:value-of select="../hrs"/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;!-- eliminate element 'hrs' --&gt; &lt;xsl:template match="hrs" mode="filter"/&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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