I am trying to create cascading dropdowm boxes.
I saw a nice tute on the forum with this but here is the problem I am faced with:
The sample code on the site is:
SAMPLE on Site:
<?xml version="1.0" encoding="UTF-8"?>
<Vehicles>
<Vehicle year="1963" make="Chevrolet" model="Corvette"/>
<Vehicle year="1963" make="Chevrolet" model="Nova"/>
<Vehicle year="1963" make="Porsche" model="356"/>
<Vehicle year="1963" make="Porsche" model="Carrera"/>
<Vehicle year="1973" make="Ford" model="Bronco"/>
<Vehicle year="1973" make="Ford" model="Mustang"/>
SAMPLE Changes I made to data to reflect my data:
<?xml version="1.0" encoding="UTF-8"?>
<arp>
<Division name="Refining" department="GM-Refining" costcentre="40000"/>
<Division name="Refining" department="GM-Refining" costcentre="40100"/>
<Division name="Refining" department="GM-Refining" costcentre="47200"/>
<Division name="Refining" department="GM-Refining" costcentre="49220"/>
<Division name="Refining" department="Heavy Oils/Conversion" costcentre="42000"/>
<Division name="Refining" department="Heavy Oils/Conversion" costcentre="42010"/>\
<Division name="Marketing and Trading" department="Crude Purchasing" costcentre="53200"/>
<Division name="Marketing and Trading" department="GM-Marketing and Trading" costcentre="53000"/>
<Division name="Marketing and Trading" department="GM-Marketing and Trading" costcentre="53400"/>
<Division name="Marketing and Trading" department="Port Operations" costcentre="41010"/>
Now I created the three dropdown fields (name, department and costcentre) and followed the tutorial to make a cascading dropdown. The name field filtered great... and the cost centre as well, but somehow the Expression they have for the middle field, which in my case is the department field, is not working, it still shows GM-Refining (4times) and Heavy Oils (2 times etc.) and its a lot of data, I just sent you a sample, but the truth is, all of the departments are displayed in the dropdown, all the way down, and not filtered for unique records, whereas in the name field Refining is filtered and Marketing & Trading. is also filtered as showing up only once. This field works great..
This is the Expression from the tutorial to filter the department field, but it does not seem to work...
/arp/Division/@department[(../@name = xdXDocument:get-DOM()/dfs:myFields/my:Division/my:Name) and (not(. = ../preceding-sibling::Division[@Name = current()/my:Division/my:name]/@dept))]
Any assistance to show me how to filter the department field will be greatly appreciated. Thanks..