Hi - in some of the latest work I have been doing in umbraco I have had href links with no text - this has caused no end of problems with my xslt files.
They have been used in jquery thing and so on.
<a href="#" class="toogle"></a>
It renders like this:
<a href="#" class="toogle" />
And totally blows out my code :(
Is there a way to put content in these using xslt which stops these problems?
It's probably because you have the output mode set to XML in your XSLT file. (It's set to render XML by default). You could change this to HTML instead and then your layout should be fine.
However, this could give some other problems so to be 100% sure nothing breaks you can insert an empty XSLT comment in between the opening a tag and the closing a tag, like this: <a href="#" class="toggle"><xsl:comment /></a>
Empty href (no link text) links cause problems
Hi - in some of the latest work I have been doing in umbraco I have had href links with no text - this has caused no end of problems with my xslt files.
They have been used in jquery thing and so on.
It renders like this:
And totally blows out my code :(
Is there a way to put content in these using xslt which stops these problems?
Or is this just me who gets this?
Hi Tizer
It's probably because you have the output mode set to XML in your XSLT file. (It's set to render XML by default). You could change this to HTML instead and then your layout should be fine.
However, this could give some other problems so to be 100% sure nothing breaks you can insert an empty XSLT comment in between the opening a tag and the closing a tag, like this: <a href="#" class="toggle"><xsl:comment /></a>
Does this help you?
/Jan
Thanks Jan... the comment didn't work
I'll test the output mode of the xslt file - this probably sounds like the culprit, not sure if I can change it on that particular xslt though :(
Hi Tizer,
As Jan says adding an empty XSLT tag should work... try this one instead:
Cheers, Lee.
If you can get absolutely nothing else to work, you can hack it:
<xsl:text disable-output-escaping="yes"><![CDATA[<a href="#" class="toogle"></a>]]></xsl:text>
You can split it if you need to add attributes, I guess for client side use, an id is most likely:
This is highly unreadable, generally awful, and should only be used when you have exhausted all other avenues though :o)
Thanks - that fixed it Lee :)
Robs works aswell :)
is working on a reply...