Find all elements that start with 'A'

Hi Lun,
I think what you want to do can be done as simple as this:
/article/subject[.~=“a*”] sortall (.)

A prerequisite is of course that you have set the right index properties regarding sorting of upper-/lower-case and that there is only one word in “subject”.

Finn

Maybe my example data is too simple…

I have subjects likes
Actors and Actresses
History and Criticism


But thank you very much anyway.
Regards,
Lun

Hello all,

Anyone know of the clue? What I want to do is something like
/article[subject start with ‘A’]
I can’t use /article[subject~=‘A*’] because the text in subject maybe “You And Me”, “Boys And Girls”…etc, so that “~=‘A*’” will include these result, which is definitely not what I want.
I’m still seeking the right way to do so…

Thanks in advance,
Lun

What about /article[subject between ‘A’,‘A999’]?

Regards
Roland

Hi Roland,

That’s what I’m using, and I think
/article[subject between ‘A’, ‘A~’]
is better, provided that this is really the right approach.

But, can anyone point out that this is really the only way, I suppose may not…

Many thanks and best regards,
Lun

Hello

I think that the following query is a better choice:

/article[starts-with(subject, ‘A’)]

Plus starts-with function makes use of standard index for optimization.

Oh yes, thank you very much Alexander.
This is exactly what I still looking for!

B.T.W, is there a list of server extension function supported by Tamino?
I want to use ‘translate’ by it said “server extension function not found”.

Thanks again.

Best regards,
Lun

starts-with is not exactly a server extension function. Server extension is usually what you code yourseft.

The whole list of supported functions in X-Query you can find in Tamino Documentation. Look at the section

Reference > X-Query Reference Guide > Functions

Best regards,
Alexander