xsl-list
[Top] [All Lists]

Need help on that tricky selection

2004-05-25 12:10:08
hi everybody,

i'm working on that for days, but didn't find a solution yet,
maybe some can help me on that tricky thing.

got the follwoing xml:

<lines>
        <hst_list>
                <hst index="1">1031501</hst>
                <hst index="2">1031401</hst>
                <hst index="3">1031301</hst>
                <!-- followed by another 20-->
        </hst_list>
        <orte>
                <ort>
                        <ort_nr>1031501</ort_nr>
                        <ort_name>HBF Gleis 1</ort_name>
                        <ort_dr_name>Hauptbahnhof, Gleis 1</ort_dr_name>
                        <ort_pos_x>4526402</ort_pos_x>
                        <ort_pos_y>5689992</ort_pos_y>
                </ort>
                <ort>
                        <ort_nr>1031401</ort_nr>
                        <ort_name>TOKI</ort_name>
                        <ort_dr_name>Thomaskirche</ort_dr_name>
                        <ort_pos_x>4526402</ort_pos_x>
                        <ort_pos_y>5689992</ort_pos_y>
                </ort>
                <!-- followed by another 3000-->
        </orte>
<lines>


as you can maybe see, every <hst> element belongs to a
<ort> element and can be identified by its <ort_nr>

what i want to do is: select all the <ort> elements, complete
with all their childs, where the <hst> is equal to the <ort_nr>
and throw the rest away.

one problem is, that i need exactly the order which is given
within the <hst_list> (the index attribute)
the other problem may be the performance, because it's possible
that this xml contains  about 3-5 thousend of <ort> elements

so far i tried lots of different approaches, with
<xsl:if> , <xsl:for-each> and variables, but can't get even
near a solution.

normally i would just put it all in a database and ask my
best friend sql, but its not possible here.


thanks fo taking trouble
Christoph Wieseke


<Prev in Thread] Current Thread [Next in Thread>