Subject: [xsl] accessing specific elements From: Sabine Lehmann <slehmann@xxxxxxx> Date: Mon, 07 May 2001 16:27:37 +0200 |
Hi, I have the following problem. Imagine the concept of a flight 'Brussels - London - Brussels' encoded in XML as follows: <input_stream> <chunk> <token> ... ... </token> </chunk> <chunk > <token> <normalized.form>Brussels</normalized.form> <domlex attribute="location" subattribute="val" value="Brussels"/> </token> <token> <normalized.form>London</normalized.form> <domlex attribute="location" subattribute="val" value="London"/> </token> <token> <normalized.form>and</normalized.form> </token> <token> <normalized.form>Brussels</normalized.form> <domlex attribute="location" subattribute="val" value="Brussels"/> </token> </chunk> ... ... </input_stream> So, <chunk> contains 4 <token> elements out of which only 3 have a domlex[@attribute='location'], namely the 1st, 2nd and 4th. Now *irrespective of their sequential order*, I would like to - count the tokens which have a domlex[@attribute='location'] (this is no problem, I just use count(//domlex[@attribute='location'])"/>)) - access only those tokens with an [@attribute='location'], so that I can express the condition: "If the first element with @attribute='location' and the third have the same value, then write out only one as the origin (and the middle one as the destination). I thought of storing the value of the first in a variable and comparing it with subsequent ones... but I can't get it work... I don't know how to access only the tokens which do have domlex[@attribute='location']. Can anybody help me? Thanks in advance Sabine XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] String match, Michael Kay | Thread | Re: [xsl] accessing specific elemen, Jeni Tennison |
Re: [xsl] XSL FO and change bars, Jim Melton | Date | [xsl] [XSL] How to order numeric da, Peter Tsantes |
Month |