0
XSLT에서 바로 앞으로 XPath 쿼리를 사용하면 목록을 만들 수 있지만 name = something 인 모든 자식 요소의 목록을 만들려면 얻을 수 없습니다. 그것은 작동합니다. 여기 내 XML입니다 :XSLT를 사용하여 Xpath 쿼리에서 순서가 지정되지 않은 목록 만들기
<?xml version="1.0" encoding="UTF-8"?>
<flights
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="flights.xsd">
<flight flightid="1">
<flightno>EK98</flightno>
<callsign>UAE98</callsign>
<airline>Emirates Airline</airline>
<plane planeid="1">
<name>Airbus</name>
<registereddate>07-06-10</registereddate>
</plane>
<registration>3A6-EDJ</registration>
<altitude height="feet">41000</altitude>
<speed ratio="mph">564</speed>
<distance unit="miles">erf</distance>
<route>
<routename>FCO-DXB</routename>
<from>
<iatacode>FCO</iatacode>
<airport>Fiumicino</airport>
<country>Italy</country>
<city>Rome</city>
<latitude>41.8044</latitude>
<longitude>12.2508</longitude>
</from>
<to>
<iatacode>DXB</iatacode>
<airport>Dubai Intl</airport>
<country>UAE</country>
<city>Dubai</city>
<latitude>25.2528</latitude>
<longitude>55.3644</longitude>
</to>
</route>
<course bearing="degrees">154</course>
<journey>
<distance type="miles">2,697</distance>
<time>PT5H30M</time>
</journey>
</flight>
나는 그것이 에어 버스 같은 경우 비행기/이름 노드의 하위 요소의 텍스트를 포함 정렬되지 않은 목록을 만들려면
.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:element name="html">
<xsl:element name="head">
<xsl:element name="title">flights</xsl:element>
</xsl:element>
<xsl:element name="body">
<xsl:element name="ul">
<xsl:attribute name="style">
<xsl:text>width:100px; margin:0 auto; padding: 0;</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="flights/flight/plane[name='Airbus']">
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="name">
<xsl:element name="li">
<xsl:attribute name="style">
<xsl:text>list-style-type:none; width:100px; margin:0 auto;</xsl:text>
</xsl:attribute>
<xsl:value-of select="name" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
그래서 결과는 다음과 같이 될 것입니다 : 내가 잘못하시기 바랍니다 하겠어 어디
이
Name: Airbus
Registered Date: 07-06-10
누군가가 나를 보여줄 수 여기에 XSLT 파일에 내 시도는?
제게 조언 해 주신 데 대해 감사드립니다. – deucalion0