Kip Posted September 16, 2005 Posted September 16, 2005 Does anyone know how to use the count function within xsl? I know have the following structure: The xml should show something like: But how? Thanks in advance. Kip
Fenton Posted September 16, 2005 Posted September 16, 2005 The xml should show something like: The above is not xml. Just like HTML, attributes must be in this form: or some value No spaces in element or attribute names. One space after an element name before an (optional) named attribute (or space-separated multiple attributes). You cannot have an attribute value (="6") with no attribute name. is correct (or would be, but you forgot the quote), the rest is not. You could have: you're the best the other 9 titles the other 5 items Or something similar: ABCD you're the best the other 9 titles the other 5 items We don't know what xml exactly you are trying to produce; there's more than one way to do the above. But what you posted is not valid xml.
Kip Posted September 16, 2005 Author Posted September 16, 2005 Hi Fenton, Thank you for your quick reply. I now see that I wasnt clear enough. In the xsl I want to use the count function that counts the number of childs of and all values of within . I tried something like:
Martin Brändle Posted September 16, 2005 Posted September 16, 2005 (edited) Kip, this can not work. You try to count on a node-set that you are generating in the very moment, i.e. on an output node-set. The count() function is defined for input node-sets, i.e. existing node-sets only. But anyway, if I understand correctly what you want to do, you don't need the count() function for your ITEMS. If it worked in your case, it would just be the number of records, wouldn't it? This information is just in the FOUND attribute of your RESULTSET tag in the FMPXMLRESULT grammar. So, The number of titles, however, per item must be counted. The final result would be, when we take the correct remarks of Fenton (you MUST produce well-formed and valid XML) into account: Edited September 16, 2005 by Guest code changed after remarking comments of Fenton
Kip Posted September 20, 2005 Author Posted September 20, 2005 Many, many Thanks! It is working fine now!
Newbies Preeti S Posted September 22, 2005 Newbies Posted September 22, 2005 Hi!!! The following gives the count of the number of records in the resultset found This should possibly solve your problem Preeti
Martin Brändle Posted September 22, 2005 Posted September 22, 2005 Hi!!! The following gives the count of the number of records in the resultset found This should possibly solve your problem Preeti This is true for the fmresultset grammar. However, he used the FMPXMLRESULT grammar. See my post above.
Recommended Posts
This topic is 7000 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now