Вот мой XMLдва вложенным для-каждого петель в XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<main>
<item>
<feed_id>44514</feed_id>
<date_added>2/15/2014 7:01 PM</date_added>
<type_id>20</type_id>
<title>created a new league</title>
<sender>Jordan Bahr</sender>
<recipient>Jordan Bahr</recipient>
<item_content>
<![CDATA[bob]]>
</item_content>
<sender_thumbnail>http://ssl.playerspace.com/assets/images/placeholder.gif</sender_thumbnail>
<sender_profile_url>http://YMCA27McArthur279853.localsportswire.org</sender_profile_url>
<item_content_url/>
<program_created>
<league_id>1228</league_id>
<league_name>McArthur Family YMCA Spring Soccer</league_name>
<league_url>http://mcarthursoccer.localsportswire.org</league_url>
<league_logo>http://content.localsportswire.org/images/default_logos/yorangegreen.png</league_logo>
<league_city>Amelia Island</league_city>
<league_state>FL</league_state>
<league_definition>league</league_definition>
<sport>soccer</sport>
</program_created>
</item>
<item>
<feed_id>44492</feed_id>
<date_added>2/13/2014 4:05 PM</date_added>
<type_id>20</type_id>
<title>created a new league</title>
<sender>Jordan Bahr</sender>
<recipient>Jordan Bahr</recipient>
<item_content>
<![CDATA[bob]]>
</item_content>
<sender_thumbnail>http://ssl.playerspace.com/assets/images/placeholder.gif</sender_thumbnail>
<sender_profile_url>http://YMCA27McArthur279853.localsportswire.org</sender_profile_url>
<item_content_url/>
<program_created>
<league_id>1214</league_id>
<league_name>McArthur Family YMCA Spring Volleyball</league_name>
<league_url>http://MCAvball.localsportswire.org</league_url>
<league_logo>http://master.localsportswire.org/assets/images/subtype1/playerspace/Team Sports/Volleyball.jpg</league_logo>
<league_city>Amelia Island</league_city>
<league_state>FL</league_state>
<league_definition>league</league_definition>
<sport>volleyball</sport>
</program_created>
</item>
</main>
Вот мой таблицы стилей XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<ul id="feedul">
<xsl:for-each select="main/item">
<li class="item clearfix">
<div class="image">
<a>
<xsl:attribute name="href">
<xsl:value-of select="sender_profile_url"/>
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="sender_thumbnail"/>
</xsl:attribute>
<xsl:attribute name="class">img-polaroid img-rounded img-polaroid-table</xsl:attribute>
</img>
</a>
</div>
<div class="info">
<a>
<xsl:attribute name="href">
<xsl:value-of select="sender_profile_url"/>
</xsl:attribute>
<xsl:attribute name="class">name text-info</xsl:attribute>
<xsl:value-of select="sender"/>
</a>
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<a>
<xsl:attribute name="href">
<xsl:value-of select="item_content_url"/>
</xsl:attribute>
<xsl:attribute name="class">name</xsl:attribute>
<xsl:value-of select="title"/>
</a>
<br/>
<p>
<xsl:attribute name="class">title</xsl:attribute>
<span>
<xsl:attribute name="data-id">
<xsl:value-of select="feed_id"/>
</xsl:attribute>
<xsl:attribute name="data-type-id">
<xsl:value-of select="type_id"/>
</xsl:attribute>
<xsl:attribute name="class">
<xsl:if test="type_id=1 or type_id=3 or type_id=21
or type_id=2 or type_id=15">icon-camera</xsl:if>
<xsl:if test="type_id=22"
>icon-comment</xsl:if>
<xsl:if test="type_id=20">icon-bullhorn</xsl:if>
</xsl:attribute>
</span>
Posted on <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<xsl:value-of select="date_added"/>
</p>
<!--<xsl:apply-templates/>-->
<xsl:for-each select="main/item/program_created">
<br/><br/><br/><br/>
<xsl:call-template name="programs">
<xsl:with-param name="league_logo" select = "league_logo" />
<xsl:with-param name="league_url" select = "league_url" />
<xsl:with-param name="league_name" select = "league_name" />
<xsl:with-param name="league_city" select = "league_city" />
<xsl:with-param name="league_state" select = "league_state" />
<xsl:with-param name="sport" select = "sport" />
<xsl:with-param name="league_definition" select = "league_definition" />
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="wire_post">
<xsl:with-param name="item_content" select = "item_content" />
</xsl:call-template>
<br/>
</div>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
<xsl:template name = "programs" >
<xsl:param name = "league_logo" />
<xsl:param name = "league_url" />
<xsl:param name = "league_name" />
<xsl:param name = "league_city" />
<xsl:param name = "league_state" />
<xsl:param name = "sport" />
<xsl:param name = "league_definition" />
<div>
<xsl:attribute name="class">well well-small clearfix</xsl:attribute>
<a>
<img>
<xsl:attribute name="src">
<xsl:value-of select="@league_logo"/>
</xsl:attribute>
<xsl:attribute name="class">pull-left img-polaroid img-polaroid-table marginright10px</xsl:attribute>
</img>
<xsl:attribute name="href">
<xsl:value-of select="@league_url"/>
</xsl:attribute>
<xsl:attribute name="class">name</xsl:attribute>
<xsl:value-of select="@league_name"/>
</a>
<div></div>
<xsl:value-of select="@league_city"/>,
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<xsl:value-of select="@league_state"/>
<div></div>
A <xsl:value-of select="@sport"/>
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<xsl:value-of select="@league_definition"/>
</div>
</xsl:template>
<xsl:template name = "wire_post" >
<xsl:param name = "item_content" />
<xsl:value-of select="$item_content" disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
Это, кажется, не называть шаблон программы на внутренний обмен на каждый ,
Я попытался
- главная/вещь/program_created
- пункт/program_created
- // program_created
Ничто не похоже на работу.
Вызов шаблона wire_post действительно работает. Я в недоумении за то, что вызывает это.
Как насчет просто 'select = "program_created"'? –