massther napisał(a)
Nie do końca wyobrażam sobie co i jak robisz. Możesz pokazać kod?
Taki prosty przykład.
XML do przetworzenia:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpyŽ -->
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<nieCd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</nieCd>
</catalog>
XSL szablonu:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpyŽ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="cd">
<xsl:apply-templates select="title"/>
</xsl:template>
</xsl:stylesheet>
WYNIK:
Empire Burlesque Greatest Hits Hide your heart Bonnie Tyler UK CBS Records 9.90 1988
A chciałbym tylko:
Empire Burlesque Greatest Hits
Problem w tym ze nie znam nazwy elementu ktory mnie nie interesuje ('nieCD'). Po prostu nie znam pliku xml ktory przetwarzam. Jedynie próbuje w nim coś wyszukać i nie chcę aby pokazywały się w wynikach zbędne informacje.