XSL样式表 - 图像调整大小

时间:2017-05-04 16:30:38

标签: xml xslt rss

我想调整不具有设置尺寸属性的RSS Feed(XML文件)中的图像。

<description>
<![CDATA[
<img src="https://s.aolcdn.com/dims-shared/dims3/GLOB/crop/5270x3360+0+0/resize/1600x1020!/format/jpg/quality/85/http://hss-prod.hss.aol.com/hss/storage/midas/bd48965fe1e1f68f097f1ffacf4eae4f/202451485/482332148.jpg" />Google is no stranger to using machine learning to improve its products -- or save manatees. To that end, the internet juggernaut has announced that its algorithms are capable of successfully pulling business names and phone numbers from Street View...
]]>
</description>

我的XSL文件到现在为止:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>
<xsl:template match="rss">
  <div style="padding:0; font-size:1em;">

     <xsl:for-each select="//*[local-name()='item'][position() &lt; 6]">
        <a href="{link}" target="_new"><xsl:value-of select="title"/></a>, 

        <xsl:value-of disable-output-escaping="yes" select="description"/><br/>

        <xsl:value-of disable-output-escaping="yes" select="pubDate"/><br/>
      </xsl:for-each>
  </div>
</xsl:template>
<xsl:template match="description"><xsl:value-of select="."/><br/></xsl:template>
</xsl:stylesheet>

0 个答案:

没有答案