[xsl] ordered selection of child elements

Subject: [xsl] ordered selection of child elements
From: "Dr. Patrik Stellmann patrik.stellmann@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Mar 2018 06:36:15 -0000
Hi,

a question more motivated by curiosity than by a real problem:

With
            <xsl:sequence select="a, b"/>
I will get first element a and second element b - no matter of the order
within the input document.

But with
            <xsl:sequence select="root/(a, b)"/>
I will get the elements a and b in document order. So this behaves identical
to
            <xsl:sequence select="root/(a | b)"/>

Why?

Of course I could write
            <xsl:sequence select="root/a, root/b"/>
To ensure a specific order. But sometimes the expression of "root" is much
more complex so I'd like to avoid writing it twice or putting it in a
variable...

Thanks and regards,
Patrik



------------------------------------------------------------------
Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: Patrik.Stellmann@xxxxxxxxx<mailto:Patrik.Stellmann@xxxxxxxxx>

[cid:mailteaser_mks_2018.png]
GDV Dienstleistungs-GmbH
GlockengieCerwall 1
D-20095 Hamburg
www.gdv-dl.de

Niederlassungen:

WilhelmstraCe 43 / 43 G
10117 Berlin

FrankenstraCe 18a
20097 Hamburg

Sitz und Registergericht: Hamburg
HRB 145291
USt.-IdNr : DE 205183123

GeschC$ftsfC<hrer:
Dr. Jens Bartenwerfer
Michael Bathke
Fred di Giuseppe Chiachiarella
Thomas Fischer

Aufsichtsratsvorsitzender: Werner Schmidt

------------------------------------------------------------------
Diese E-Mail und alle AnhC$nge enthalten vertrauliche und/oder rechtlich
geschC<tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtC<mlich erhalten haben, in-formieren Sie bitte sofort den
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this
e-mail in error) please notify the sender im-mediately and destroy this
e-mail. Any unauthorised copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.

[demime 1.01d removed an attachment of type application/octet-stream which had a name of mailteaser_mks_2018.png]

Current Thread