I have this gigantic completly unoptimized xslt (optimizing it is for a later date because its ugly and im not proud of it) that gets job categories from an xml webservice.
For each category it checks if they have any contents and changes the CSS markup accordingly, it also counts the number of items.
Yes, that piece of code is repeated about 20 times for each category.
But anyway, the problem is that some categories has to be condensed into fewer, so an example with the above, category number 109, it now also has to contain the contents from category 101.
How do i do that? (im guessing my explanation isnt that comprehensive but please ask for further info, i will answer asap).
Sorry for double posting, but editing my original post didnt work.
Ok, i will try and clarify the bare minimum i need help with. In the code above, i am navigating through an XML retrieved from a webservice ($service), it is supposed to first check if it is as the specific category ID, then check if its zero and if it is change the "class" attribute.
Then after the category name ("Kontor" in this case) it looks for the specific category again, and checks the value and outputs it, to show the user the number of items in that category.
Now, several categories has been merged, so some now containg contents of two categories, some three. The problem is i dont know how to check the RsJobCount value for ALL of the categories, and output the sum of RsJobCount for those categories.
Selecting multiple XML nodes and more
Hopefully this is somewhat simple.
I have this gigantic completly unoptimized xslt (optimizing it is for a later date because its ugly and im not proud of it) that gets job categories from an xml webservice.
For each category it checks if they have any contents and changes the CSS markup accordingly, it also counts the number of items.
Yes, that piece of code is repeated about 20 times for each category.
But anyway, the problem is that some categories has to be condensed into fewer, so an example with the above, category number 109, it now also has to contain the contents from category 101.
How do i do that? (im guessing my explanation isnt that comprehensive but please ask for further info, i will answer asap).
Sorry for double posting, but editing my original post didnt work.
Ok, i will try and clarify the bare minimum i need help with. In the code above, i am navigating through an XML retrieved from a webservice ($service), it is supposed to first check if it is as the specific category ID, then check if its zero and if it is change the "class" attribute.
Then after the category name ("Kontor" in this case) it looks for the specific category again, and checks the value and outputs it, to show the user the number of items in that category.
Now, several categories has been merged, so some now containg contents of two categories, some three. The problem is i dont know how to check the RsJobCount value for ALL of the categories, and output the sum of RsJobCount for those categories.
Hi Frederik,
Here's a way to do it - hopefully it explains itself enough for you to be able to wipe a couple of hundred lines off the file :-)
/Chriztian
is working on a reply...