У меня есть этот вид в XMLПопадая родители подзначение из XML
<?xml version="1.0" encoding="UTF-8"?>
<setting>
<Key name="com.ahsay.afc.cpf.UserGroup" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="1328200856753" />
<Value name="rsv-group-name" inheritParentAttribute="Y" type="string" data="group 1" />
<Value name="rsv-user-type" inheritParentAttribute="Y" type="string" data="backup-user" />
<Value name="rsv-owner" inheritParentAttribute="Y" type="string" data="" />
<Key name="com.ahsay.afc.cpf.User" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="13279083887401" />
<Value name="rsv-login-name" inheritParentAttribute="Y" type="string" data="name1" />
</Key>
<Key name="com.ahsay.afc.cpf.User" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="13279083887401" />
<Value name="rsv-login-name" inheritParentAttribute="Y" type="string" data="name2" />
</Key>
</Key>
<Key name="com.ahsay.afc.cpf.UserGroup" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="1328200856753" />
<Value name="rsv-group-name" inheritParentAttribute="Y" type="string" data="group 2" />
<Value name="rsv-user-type" inheritParentAttribute="Y" type="string" data="backup-user" />
<Value name="rsv-owner" inheritParentAttribute="Y" type="string" data="" />
<Key name="com.ahsay.afc.cpf.User" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="13279083887401" />
<Value name="rsv-login-name" inheritParentAttribute="Y" type="string" data="name3" />
</Key>
<Key name="com.ahsay.afc.cpf.User" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="13279083887401" />
<Value name="rsv-login-name" inheritParentAttribute="Y" type="string" data="name4" />
</Key>
</Key>
</setting>
И я хотел бы делать получить-группы имя RSV данных = «значение» из-Логин имя-RSV данных = «значение»
, что я дать парсер NAME3 и я хочу, чтобы вернуть группе 2
как лучше я не придумали до сих пор это:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="umm" match="Value" use="@data"/>
<xsl:key name="amm" match="Value" use="@name"/>
<xsl:template match="/">
<xsl:for-each select="key('umm','name3')">
<p>
<xsl:value-of select="../../@name" />
</p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Ведьма дает мне "com.ahsay.afc.cpf.UserGroup" не лучший результат :)
Спасибо это обработанное – user1187425