On Nov 30, 2007, at 19:00, Daling Xu wrote:

Hi

I am using FOP to generate PDF from an XML doc.

In my PDF, I would like to insert image in some places, but because not every time I have an image for all the element in the xml, I use a XSL:If statement like this way:
<fo:block >
<xsl:if test="@statusImageURL"><fo:external-graphic src="[EMAIL PROTECTED]"/></xsl:if>
<xsl:value-of select="@status"/>
</fo:block>
<snip />
Any idea what's wrong with my XSLT?

Nothing inherently wrong about it. Are you *absolutely* certain the source does *not* contain the attribute (not even an empty one)?
Another (very remote) possibility:
Does the source XML contain a reference to a DTD, perhaps?
Not 100% certain, but I seem to remember having seen this once: an empty attribute being added due to DTD validation. If the attribute is not defined as #IMPLIED, but with a default value of "" (empty string), then it could be added by the XML parser, so we wouldn't see it in the source, but the XSLT processor would.


HTH!

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to