Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay changed elements in XSLT output in bold
    primarykey
    data
    text
    <p>I'm working on a piece of software that develops flight plans for aircraft operators. The aircraft has a sensor that can have various settings adjusted, and these settings are split by way of what we call "segments" of the flight plan. (A segment is some certain amount of time in the plan, and sensor settings only change when moving between segments.)</p> <p>The flight plan is output as an HTML file, which is generated from an XSL transform of a serialized XML object, via XslCompiledTransform in C# .NET. Its structure is very consistent, since there are a limited number of settings to adjust. For each segment, a pair of tables is output, delimited by <code>&lt;hr /&gt;</code> tags.</p> <p>What I'd like to be able to do is take that output and, each time a setting changes from segment to segment, bold that setting's text in the final output by wrapping it in <code>&lt;b&gt;</code> tags. A (paraphrased) example: (<strong>EDITED for clarification</strong>)</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 1&lt;/td&gt;&lt;td&gt;a&lt;/td&gt; &lt;td&gt;Setting 2&lt;/td&gt;&lt;td&gt;b&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 3&lt;/td&gt;&lt;td&gt;c&lt;/td&gt; &lt;/tr&gt; &lt;table&gt; &lt;hr /&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 1&lt;/td&gt;&lt;td&gt;a&lt;/td&gt; &lt;td&gt;Setting 2&lt;/td&gt;&lt;td&gt;d&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 3&lt;/td&gt;&lt;td&gt;c&lt;/td&gt; &lt;/tr&gt; &lt;table&gt; </code></pre> <p>Given that output from the XSL transform, I'd like to wrap c in a or tag to bold it, resulting in something like this:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 1&lt;/td&gt;&lt;td&gt;a&lt;/td&gt; &lt;td&gt;Setting 2&lt;/td&gt;&lt;td&gt;b&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 3&lt;/td&gt;&lt;td&gt;c&lt;/td&gt; &lt;/tr&gt; &lt;table&gt; &lt;hr /&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 1&lt;/td&gt;&lt;td&gt;a&lt;/td&gt; &lt;td&gt;Setting 2&lt;/td&gt;&lt;td&gt;&lt;b&gt;d&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Setting 3&lt;/td&gt;&lt;td&gt;c&lt;/td&gt; &lt;/tr&gt; &lt;table&gt; </code></pre> <p>I'm not sure whether to write a helper object in .net, use a utility, run the output through a separate XSL transform, or what. <strong>What would be the best method to go about it given the tools I have at hand?</strong></p>
    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.
 

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