Using xsl Stylesheet - html view including images
Having trouble installing Oxygen? Got a bug to report? Post it all here.
Using xsl Stylesheet - html view including images
Post by Marc »
Hi George,
Thank you again for your help it works fine so far but I still have my problems with the "broken image". When I am using
<Bild>
<Pfad/> <!-- no path for a picture-->
</Bild>
in my xml document I will have a broken image (red X) in my html view.
How can I fix this problem? I don't want to have this "red X" instead I will have a text like "no picture available". I was trying the following:
<xsl:for-each select=".//Pfad">
<img alt="no picture available">
<xsl:attribute name="src">
<xsl:value-of select="."/>
</xsl:attribute>
</img>
The html view still show me the "red X" followed by my text "no picture available". Do you have an idea how to solve this problem? Only showing me my text and nothing else.
Thank you very much again.
cu Marc
Thank you again for your help it works fine so far but I still have my problems with the "broken image". When I am using
<Bild>
<Pfad/> <!-- no path for a picture-->
</Bild>
in my xml document I will have a broken image (red X) in my html view.
How can I fix this problem? I don't want to have this "red X" instead I will have a text like "no picture available". I was trying the following:
<xsl:for-each select=".//Pfad">
<img alt="no picture available">
<xsl:attribute name="src">
<xsl:value-of select="."/>
</xsl:attribute>
</img>
The html view still show me the "red X" followed by my text "no picture available". Do you have an idea how to solve this problem? Only showing me my text and nothing else.
Thank you very much again.
cu Marc
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Marc,
You have to test if you have any text nodes and generate the img tag only if an image is specified:
Best Regards,
George
P.S. Please post your replies to the same topic.
You have to test if you have any text nodes and generate the img tag only if an image is specified:
Code: Select all
<xsl:for-each select=".//Pfad">
<br/><br/>
<xsl:choose>
<xsl:when test="text()">
<img><xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute></img>
</xsl:when>
<xsl:otherwise>[No picture available]</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
George
P.S. Please post your replies to the same topic.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service