Note that there are some explanatory texts on larger screens.

plurals
  1. POXSL Traversing Question (with Server Error:)
    primarykey
    data
    text
    <p>I have, what I believe to be, an interesting situation at hand. I have a car garage XML and am transforming it (using XSL) into HTML.</p> <p><strong>CAR XML:</strong></p> <pre><code>&lt;car&gt; &lt;licensePlate&gt;Car001&lt;/licensePlate&gt; &lt;feature&gt; &lt;color&gt;Blue&lt;/color&gt; &lt;fuel&gt;Unleaded&lt;/fuel&gt; &lt;feature&gt; &lt;/car&gt; </code></pre> <p>I only want to print out <code>&lt;color&gt;</code> &amp; <code>&lt;fuel&gt;</code> but want to set the <code>&lt;licensePlate&gt;</code> as href in a HTML link.</p> <p><strong>CAR XSL:</strong></p> <pre><code>&lt;xsl:template match="car"&gt; &lt;tr&gt; &lt;xsl:apply-templates select="licensePlate"/&gt; &lt;xsl:apply-templates select="feature"/&gt; &lt;/tr&gt; &lt;/xsl:template&gt; &lt;xsl:template match="feature"&gt; &lt;td&gt; &lt;a href="{preceding-sibling::licensePlate/text()}&gt; &lt;xsl:apply-templates select="color"/&gt; &lt;/a&gt; &lt;/td&gt; &lt;td&gt;&lt;xsl:apply-templates select="fuel"/&gt;&lt;/td&gt; &lt;/xsl:template&gt; </code></pre> <p>This enables me to achieve my goal of setting the tag as the href value.</p> <p>BUT a problem occurs...all of the values of licensePlate are printed to screen.</p> <p>Can someone recommend how to prevent it from printing to screen?</p> <p>I have tried commenting out <code>&lt;xsl:apply-templates select="licensePlate"/&gt;</code> but I think this affects the <code>preceeding-sibling::</code> statement as I receive an error</p> <p>I have also received this error when trying to apply a CSS <code>display:none</code>.</p> <p>Thankyou for your time and patience, Lucas</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.
 

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