I'm using XSLT to create HTML forms from XML. Forms are dynamically created. There is no ready teamplate for that. There will be as many inputs as user wants. I want to keep it as short as possible so I'm using attributes to create e.g. options in select tags. The problem is that I can't figure out how to turn this XML:
<input mapTo="dropdown" nameId="sampleId" inputDomain="[a, b, c, d, e]" />
into:
<select id="sampleId">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
<option value="e">e</option>
</select>
My problem is exactly the inputDomain attribute. I can modify for an easier method but I want to keep it in one attribute (like an array). Is it possible? Or maybe you have more convenient ideas?
SET:[a, b, c, d, e]supposed to represent?[a, b, c, d, e]. I just want to know if there is any way to provide multiple options in one attribute. I'm also not strictly bound to versions of anything. I'm flexible with this.<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">. So there isn't completely any way to get some strings divided by comma or whatever in XML attribute?tokenize. With an XSLT 1 processor there might be support for an extension function doing the job. But it will short fall if your data gets more complex and the token separator can appear in your data values.