I am trying to write some XSLT to format the xml results in my forms that are emailed to include fieldsets in the table of data sent. I don't know if I am doing the Xpath test in the "if" correctly. Here is what I have:
Sorry, I forgot to mention that aparently there is no way to retreve the actual fieldset text, so I am just created a blank "<td>" to separate the various fieldsets.
Well, I ended up getting it to make an empty "<td>" where the form fields were by looking for the attribute of fieldsetindex, since there was no value for fieldset. Which is crazy, just saying.
XSLT Xpath Question
I am trying to write some XSLT to format the xml results in my forms that are emailed to include fieldsets in the table of data sent. I don't know if I am doing the Xpath test in the "if" correctly. Here is what I have:
<xsl:if test="preceding-sibling::*./@fieldsetindex != ./@fieldsetindex"> <td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;background-color:#ccc;"> </td> </xsl:if> <td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;"> <strong> <xsl:value-of select="./caption" disable-output-escaping="yes"/> </strong> </td>
Hi Steve,
In this instance you need to use the
current()
function:(If I understand what you're trying to do :-)
/Chriztian
Sorry, I forgot to mention that aparently there is no way to retreve the actual fieldset text, so I am just created a blank "<td>" to separate the various fieldsets.
I just created a Gist with a file I've created for this purpose - maybe you can use that as inspiration:
It doesn't cover all the field types but at least it's a head start...
/Chriztian
Thanks!
Well, I ended up getting it to make an empty "<td>" where the form fields were by looking for the attribute of fieldsetindex, since there was no value for fieldset. Which is crazy, just saying.
is working on a reply...