L
Luca
Hello,
have a problem with this XML, I need XSLT to filter the products list
based on rules writes in RULE tag.
I need copy only CAT and PROD data in PRODUCTS-LIST that match CAT and
PROD ID's in RULE tag.
for ex:
==========================================================================
<ROOT>
<PAGE NAME="homepage" URL="HP.html">
<RULES>
<RULE>
<CAT ID="1">
<PRO ID="3"></PRO>
<PRO ID="6"></PRO>
</CAT>
<CAT ID="3">
<PRO ID="2"></PRO>
<PRO ID="10"></PRO>
</CAT>
</RULE>
</RULES>
</PAGE>
<PRODUCTS-LIST>
<CAT ID="1">
<PROD ID="12">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="6">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="3">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
<CAT ID="2">
<PROD ID="7">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
<CAT ID="3">
<PROD ID="10">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="1">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="2">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
</PRODUCTS-LIST>
</ROOT>
==========================================================================
the final result of XSLT trasf.
==========================================================================
<ROOT>
<PRODUCTS-LIST>
<CAT ID="1">
<PROD ID="6">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="3">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
<CAT ID="3">
<PROD ID="10">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="2">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
</PRODUCTS-LIST>
</ROOT>
=========================================================================
Can anybody help me?
Thanks for answers!
Luca
have a problem with this XML, I need XSLT to filter the products list
based on rules writes in RULE tag.
I need copy only CAT and PROD data in PRODUCTS-LIST that match CAT and
PROD ID's in RULE tag.
for ex:
==========================================================================
<ROOT>
<PAGE NAME="homepage" URL="HP.html">
<RULES>
<RULE>
<CAT ID="1">
<PRO ID="3"></PRO>
<PRO ID="6"></PRO>
</CAT>
<CAT ID="3">
<PRO ID="2"></PRO>
<PRO ID="10"></PRO>
</CAT>
</RULE>
</RULES>
</PAGE>
<PRODUCTS-LIST>
<CAT ID="1">
<PROD ID="12">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="6">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="3">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
<CAT ID="2">
<PROD ID="7">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
<CAT ID="3">
<PROD ID="10">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="1">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="2">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
</PRODUCTS-LIST>
</ROOT>
==========================================================================
the final result of XSLT trasf.
==========================================================================
<ROOT>
<PRODUCTS-LIST>
<CAT ID="1">
<PROD ID="6">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="3">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
<CAT ID="3">
<PROD ID="10">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
<PROD ID="2">
<NAME>Prod. name</NAME>
<DESC><![CDATA[ Html desc ]]></DESC>
</PROD>
</CAT>
</PRODUCTS-LIST>
</ROOT>
=========================================================================
Can anybody help me?
Thanks for answers!
Luca