I'm having a big issue with my 4.0.2.1 installation. I've got several xslt macro's that seems to change the output. Initially the xslt output type was 'html'. This because then you don't have to worry about empty tags being collapsed and thereby causing problems for your css. Problem is that I found xslt to change some tags. Examples:
The compliance filter stuff i put on codeplex does fix this sort of thing see here i do have a newer version ping me if you need it. It may be overkill but it will for example take <img src="blah.gif"> and give you <img src="blah.gif"/> it will also fix other self closing tags that have not been closed. There a couple of issues with it mainly to do the asp.net ajax but you wont know until you try it.
if your output type still is xml you can just do: <input type="hidden" value="3333" name="horse" id="horse"></input> i think, xml will close it itself because there is no content between the tags :)
It is heavy weight but it works and will fix other issues like missing alt tags and .net compliance issues. If you are going to use it ping me i will send you latest version.
Problem with XSLT changing output
Hi all,
I'm having a big issue with my 4.0.2.1 installation. I've got several xslt macro's that seems to change the output. Initially the xslt output type was 'html'. This because then you don't have to worry about empty tags being collapsed and thereby causing problems for your css. Problem is that I found xslt to change some tags. Examples:
becomes:
... without closing the tag with /. The html doctype is xhtml 1.0 strict and this would of course mean that the page no longer validates.
Changing the output type to XML changed this. Though now I have to identify collapsed tags causing some problems. Like <textarea></textarea>
Has anyone else seen this? Now the cure? Any hints is much appreciated.
/Jesper Ordrup
Hi Jesper,
I've tried the following although it may not be what you're looking for exactly, the output is set to xml but that shouldn't matter for this:
And for dynamic properties (below I've added a variable to rows) you can break the xsl:text like so:
Admittedly it is quite messy, I hope this helps.
... or would swapping the tags around work to? (I haven't tested this btw)
You could put a space in the CDATA, but that would be rendered back to the browser.
This would make your XSLT more readable if you wanted to add the dynamic properties, like Jamie suggests:
Hi Lee,
That solution unfortunately does not work, which is a shame because it does look a lot cleaner.
good effort :)
Jesper,
The compliance filter stuff i put on codeplex does fix this sort of thing see here i do have a newer version ping me if you need it. It may be overkill but it will for example take <img src="blah.gif"> and give you <img src="blah.gif"/> it will also fix other self closing tags that have not been closed. There a couple of issues with it mainly to do the asp.net ajax but you wont know until you try it.
Regards
Ismail
if your output type still is xml you can just do: <input type="hidden" value="3333" name="horse" id="horse"></input> i think, xml will close it itself because there is no content between the tags :)
Gerty,
The xslt wont self close it, the output will be <input type="hidden" value="3333" name="horse" id="horse"></input>
Regards
Ismail
Thanks for the good tips. I added a space between and a jquery that removes it :-)
@Ismail: the compliance http module sounds violent but it might help me if nothing else works.
The strange thing is that when outputting html both <input/> and <input></input> becomes <input> . But that might be what is expected - I just didn't.
/Jesper
Jesper,
It is heavy weight but it works and will fix other issues like missing alt tags and .net compliance issues. If you are going to use it ping me i will send you latest version.
Regards
Ismail
is working on a reply...