Nie działa css w xml-u

0

dlaczego :" przetwarzanie arkusza stylów się nie powiodło"
chodzi o linijkę xsl:coose bo coś z nią jest nie tak, co?

xsl:for-each select="/places/place"> 
				 <tr> 
                    <td> 
                        <xsl:value-of select = "@category"/> 
                    </td> 
					
				<xsl:choose>
					<xsl:when type="small">
						<td bgcolor="#ff00ff">
						<xsl:value-of select = "name"/>
						</td>
					</xsl:when>
					<xsl:otherwise>
						<td><xsl:value-of select="name"/></td>
					</xsl:otherwise>
					
				</xsl:choose>
					
                    <td><xsl:value-of select = "population"/></td> 
                    <td><xsl:value-of select = "area"/></td> 
                    <td><xsl:value-of select = "MAMSL"/></td> 
					<td>
					<a target="_blank">
					<xsl:attribute name="href" ><xsl:value-of select="img/@url" /></xsl:attribute>
					<img width="60" alt="no image">
					<xsl:attribute name="src" ><xsl:value-of select="img/@url" /></xsl:attribute>
					</img>
					</a>
					</td> 
					
                  </tr> 
               </xsl:for-each> 
0

Tu jest problem: <xsl:when type="small"> when ma atrybut test, więc powinno być mniej więcej tak:

<xsl:when test="type='small'">

0

to mój xml:
strona się wyświetla ale nie zmienia się background color dla tablicy, czy czegokolwiek

<place category="mountains">
	<name type ="big" region="south_poland">Tatry</name>
	<population type="big">no info</population>
		<area type="big">785km</area>
			<MAMSL type="big">2655m</MAMSL>
			<img url="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Tatry_Wysokie_1-T9.jpg/240px-Tatry_Wysokie_1-T9.jpg" ></img>
</place>
<place category="city">
	<name type ="small" region="lubelskie">Kazimierz Dolny</name>
	<population type="small">3,5tys.</population>
	<area type="small">30km</area>
	<MAMSL type="small">125m</MAMSL>
	<img url="https://podroze.smcloud.net/t/photos/t/142228/kazimierz-dolny_1102083.jpg" >3</img>
</place>

xlst :

 <xsl:for-each select="/places/place"> 
				 <tr> 
                    <td> 
                        <xsl:value-of select = "@category"/> 
                    </td> 
					
					
					<xsl:choose>
					<xsl:when test="type='small'">
						<td bgcolor="#99ffb3">
						<xsl:value-of select = "name"/>
						</td>
					</xsl:when>
					<xsl:otherwise>
						<td><xsl:value-of select="name"/></td>
					</xsl:otherwise>
					
				</xsl:choose>
                    
                    <td><xsl:value-of select = "population"/></td> 
                    <td><xsl:value-of select = "area"/></td> 
                    <td><xsl:value-of select = "MAMSL"/></td> 
					<td>
1

Bo ty chcesz testować wartość atrybutu wązła name...

<xsl:when test="name/@type='small'">
0

dziękuje

0

Popracuj nad znajomością xslt, bo ten foreach nie jest Ci potrzebny... mozna to zrobić czytelniej i tak, zeby łatwo było zmieniać/dodawać poprawki. Pokaż całość to podpowiem jak zmienić, aby się w tym nie pogubić.

1 użytkowników online, w tym zalogowanych: 0, gości: 1