0
と、私はこのような何かを行うには、XSLTを使用する必要があります:XSLT:どのように解析し、エコーのxml件のデータ条件
foreach(product as product{
if(itemType == "processor" && price < 100$) echo processor["brand"]
if(itemType == "laptop" && color=="black") echo laptop["price"]
)
私は間違いなく、XSLT <xsl:for-each>
声明とも<xsl:if>
ステートメントを使用して2日以来してみてください、私 いくつかのWebチュートリアルを見た後でも正しく使用する方法を知らない。誰でも私を助けてくれる?
<myShop>
<product itemType="processor">
<brand>Intel</brand>
<price secondHand="false">230$</price>
<nbCore>4</nbCore>
</product>
<product itemType="processor">
<brand>Amd</brand>
<price secondHand="true">90$</price>
<nbCore>2</nbCore>
</product>
<product itemType="laptop">
<brand>Dell</brand>
<price secondHand="false">600$</price>
<color>black</color>
</product>
<product itemType="laptop">
<brand>Apple</brand>
<price secondHand="true">900$</price>
<color>silver</color>
</product>
</myShop>
編集: このXMLコード
<agency>
<product productType="appartement">
<price transactionType="rent">1000€</prix>
<location>Paris</location>
<surface>80m²</surface>
<bedroom>1</bedroom>
<bathoom>2</bathoom>
<heating heatingType="gaz">yes</heating>
</product>
</product>
<product productType="house">
<price productType="sell">280000€</prix>
<location>London</location>
<surface>190m²</surface>
<bedroom>3</bedroom>
<bathoom>2</bathoom>
<heating heatingType="electric">yes</heating>
</product>
</agency>
を見て、ここに私のXSLTスタイルシートが
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>agence.xsl</title>
</head>
<body>
//help me echo house having price > 200000 and price < 300000 and having bedroom >= 3 order by location, surface desc
</body>
</html>
</xsl:template>
</xsl:stylesheet>
でくださいあなたは私のエコー家が価格> 200000と価格< 300000を持つ助けてもらえ場所でベッドルームが3つ以上の場合は、表面の深さは?
ありがとうございます。あなたの答えは私の多くを助けました。 – zm455