xsl attribute for background-color not working
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 6
- Joined: Fri Jun 24, 2011 4:56 pm
xsl attribute for background-color not working
Hello.
I have set a top level variable for a colour using
<xsl:variable name="my_colour">
<xsl:value-of select="yellow"/>
</xsl:variable>
I have a table defined and I want this variable to be used a s the background colour for a cell so i have added an attribute for background-color witrhthin the block for the cell
<xsl:attribute name="background-color">
<xsl:value-of select="$my_colour"/>
</xsl:attribute>
When I view the fo output it does have the attraibute added but it is null like the following
background-color=""
If I manually add in a colour between the "" and trnasform it then it is fine. Does anyoen know why the fo is not generated to include my colour?
Thanks,
Colm
I have set a top level variable for a colour using
<xsl:variable name="my_colour">
<xsl:value-of select="yellow"/>
</xsl:variable>
I have a table defined and I want this variable to be used a s the background colour for a cell so i have added an attribute for background-color witrhthin the block for the cell
<xsl:attribute name="background-color">
<xsl:value-of select="$my_colour"/>
</xsl:attribute>
When I view the fo output it does have the attraibute added but it is null like the following
background-color=""
If I manually add in a colour between the "" and trnasform it then it is fine. Does anyoen know why the fo is not generated to include my colour?
Thanks,
Colm
-
- Posts: 407
- Joined: Mon Dec 05, 2011 6:08 pm
Re: xsl attribute for background-color not working
Hello,
Please note that you should enclose the color within apostrophes in order to be evaluated as a string. Otherwise, the <xsl:value-of> element is trying to extract the value of an XML element called yellow.
Let us know if you need further assistance.
Regards,
Ionela
Please note that you should enclose the color within apostrophes in order to be evaluated as a string. Otherwise, the <xsl:value-of> element is trying to extract the value of an XML element called yellow.
Code: Select all
<xsl:variable name="my_colour">
<xsl:value-of select=" 'yellow' "/>
</xsl:variable>
Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
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