tags:

views:

39

answers:

2

Im using XSLT to return some values, output as XHTML. However I usually structre my XSL like this:

<div id="something">
  call template=Something
</div>

The trouble is when the XML returned is empty it just outputs:

<div id="something">
Empty set.

And as you can imagine this screws up my page.

Is there any function i can use to detect if there is any data there or not? Or can anyone think of a better way of stopping this from happening.

+2  A: 

I think you may be using

<xsl:output method="html" />

try

<xsl:output method="xml" />

instead.

Tomalak
I need to ouput as HTML, I dont want to output the RAW XML, however at somepoints nothing is returned from the XML so the XSLT messes up the page.
danit
You said XHTML. Which is XML. The `mode="html"` is for traditional HTML output, including the possibility of unclosed tags.
Tomalak
A: 

It's just a dirty hack, but I had the same problem and I was in a hurry, so I ended using

<div id="something">
    <span>call template=Something</span>
</div>
antispam