data fra 2 xml filer
HejSkal selecte data fra en xml fil afhængigt af data fra en anden xmml fil.
hvordan skal jeg uforme mit select statement i foreach løkken?? Som det ser ud nu har jeg
select="plist/dict/dict/dict[descendant::key[contains(text(),document('music.xml')//Body/Profile/ImplicitData/Concepts/Concept[descendant::key])]]">
Det virker ikke. Vil kun have de numre ud der har en genre det matcher en concept key i 1.xml
Håber det giver lidt mening
På forhånd tak
<---1.xml--->
<Body defaultprofile="music">
<Profile name="music">
<ImplicitData>
<Concepts>
<Concept key="rock" value="1.0"/>
<Concept key="heavy metal" value="1.0"/>
<----------->
<---itunes.xml---->
plist version="1.0">
<dict>
<key>Major Version</key><integer>1</integer>
<key>Minor Version</key><integer>1</integer>
<key>Application Version</key><string>8.0.1</string>
<key>Features</key><integer>5</integer>
<key>Show Content Ratings</key><true/>
<key>Music <key>Library Persistent ID</key><string>05C43127CC3EA5CD</string>
<key>Tracks</key>
<dict>
<key>495</key>
<dict>
<key>Track ID</key><integer>495</integer>
<key>Name</key><string>Highway To Hell</string>
<key>Artist</key><string>AC/DC</string>
<key>Album</key><string>Highway To Hell</string>
<key>Genre</key><string>Industrial</string>
<---------->
<---filter.xslt--->
<xsl:for-each select="plist/dict/dict/dict[descendant::key[contains(text(),document('music.xml')//Body/Profile/ImplicitData/Concepts/Concept[descendant::key])]]">
<xsl:variable name="name" select="key[text()='Name']/following::string"/>
<xsl:variable name="artist" select="key[text()='Artist']/following::string"/>
<xsl:variable name="album" select="key[text()='Album']/following::string"/>
<xsl:variable name="genre" select="key[text()='Genre']/following::string"/>
<xsl:variable name="year" select="key[text()='Year']/following::integer"/>
<tr>
<td><xsl:value-of select="$name"/></td>
<td><xsl:value-of select="$artist"/></td>
<td><xsl:value-of select="$album"/></td>
<td><xsl:value-of select="$genre"/></td>
<td><xsl:value-of select="$year"/></td>
</tr>
</xsl:for-each>