The recipe image and ingredients are displaying but everything in <div id="method"> is not - it's really puzzling me as I can't see any difference in my code?!
The very first <p> element in that <div> will come out as <p/> in the rendered HTML - so this is where you need to just put a comment in:
<p><xsl:comment/></p>
And just to make sure that in the case of none of the following "genericRecipeMethod", "ovenAGAMethod2", "ovenAGAMethod34" or "ovenAGAMethod234" have content, put a comment inside that <p> too, e.g. just before the closing </p>.
There's also a couple of clearing <div>'s you should make sure to safeguard with a <xsl:comment/> inside.
XSLT is working but not displaying in web page?!
Hi,
I've created an XSLT file that is working using the visualiser but when I go to the web page it is not displaying!
However, if I view the source then the correct content is there?!
I've tried removing all styles applied but still the same thing.
Has anyone come across this before?!
Thanks,
Rachel
Hi Rachel,
Most likely this happens in Internet Explorer when a tag gets closed in the XHTML way like this: <script src="xyz.js"/> or <div/>
There are ways to fix this - the easiest (with no side-effects) is to throw a <xsl:comment/> instruction inside, e.g.:
/Chriztian
Thank you for your response Chriztian but I am experiencing the problem in FF as well.
I actually think that the issue may lie in my code because I am trying to update from the old to new schema.
Is the following correct? Or am I missing something?
/Rachel
Hi Rachel,
I'm pretty sure Firefox does that as well :-)
You say that view-source reveals the code being there - and it's not CSS-related, so...
Nothing wrong with your code - though you could do the same with a simple normalize-space() test:
Unless you need a wrapper in the case of there being something in the genericMethod property:
/Chriztian
Hi Chriztian,
I tried using your above example but it made no difference :(
This is my full code...
The recipe image and ingredients are displaying but everything in <div id="method"> is not - it's really puzzling me as I can't see any difference in my code?!
/Rachel
Hi Rachel,
The very first <p> element in that <div> will come out as <p/> in the rendered HTML - so this is where you need to just put a comment in:
And just to make sure that in the case of none of the following "genericRecipeMethod", "ovenAGAMethod2", "ovenAGAMethod34" or "ovenAGAMethod234" have content, put a comment inside that <p> too, e.g. just before the closing </p>.
There's also a couple of clearing <div>'s you should make sure to safeguard with a <xsl:comment/> inside.
/Chriztian
Ah, I finally found the problem - thank you so much for you help!
I just needed to replace
with
/Rachel :)
is working on a reply...