|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RSS feed with custom additional values - how best
At 2009-04-24 14:22 -0500, Kent Nielsen wrote:
<rss version="2.0" xmlns:customns="http://www.helpyoulist.com/customns"> <channel> ... <item> <title>2008 Acme Floor Sander</title> <guid>http://www.acmeinc.com/ACL1.html</guid> ... Here would be my XSL file: You probably want to add the following to clean up your HTML: exclude-result-prefixes="customns" ... <xsl:template match="item"> <xsl:if test="customns:guid='http://www.acmeinc.com/ACL1.html'"> <!-- WILL REPLACE WITH VAR LATER --> I think that should be: test="guid='.....'" ... and then both items appear for me. <xsl:value-of select="title" /><br /> <!-- WORKS FINE! --> That didn't work for me until I changed the xsl:if test. <xsl:value-of select="customns:model" />|<br /> <!-- IT'A NO LIKA! --> No problem once I changed the xsl:if tset. What am I missing? I've tried aliases and such to no avail. Just getting carried away with your prefixes is all. I hope the running example below helps. . . . . . . . . . Ken
T:\ftemp>call xslt2 kent.xml kent.xsl <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2008 Acme Floor Sander<br>FS1|<br> T:\ftemp>type kent.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" exclude-result-prefixes="customns" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:customns="http://www.helpyoulist.com/customns"> <xsl:output method="html" version="4.01" /> <xsl:output doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" /> <xsl:template match="rss/channel">
<xsl:apply-templates select="item"/>
</xsl:template><xsl:template match="item">
<xsl:if test="guid='http://www.acmeinc.com/ACL1.html'"> <!--
WILL REPLACE WITH VAR LATER -->
<xsl:value-of select="title" /><br /> <!-- WORKS FINE! -->
<xsl:value-of select="customns:model" />|<br /> <!-- IT'A NO LIKA! -->
</xsl:if>
</xsl:template>
</xsl:stylesheet>T:\ftemp>rem Done! -- XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






