shorten a XPATH expression (or-junction)

Questions about XML that are not covered by the other forums should go here.
mariomueller
Posts: 30
Joined: Wed Feb 14, 2018 3:27 pm

shorten a XPATH expression (or-junction)

Post by mariomueller »

Hi all,

is there a way to write to expression

Code: Select all

<xsd:assert test="(G_SG8/G_SG10/S_CCI[D_7059='Z01']/D_4051='Z30') or (G_SG8/G_SG10/S_CCI[D_7059='Z01']/D_4051='Z31') " />
in a shorter way like e.g. (the following is not working, as also Z99 would be valid and I don't no why?)

Code: Select all

<xsd:assert test="G_SG8/G_SG10/S_CCI[D_7059='Z01']/D_4051='Z30' or 'Z31' " />

Thanks
Regards
Mario
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: shorten a XPATH expression (or-junction)

Post by adrian »

Hi,

Try:

Code: Select all

<xsd:assert test="G_SG8/G_SG10/S_CCI[D_7059='Z01']/(D_4051=('Z30', 'Z31'))" />
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
mariomueller
Posts: 30
Joined: Wed Feb 14, 2018 3:27 pm

Re: shorten a XPATH expression (or-junction)

Post by mariomueller »

Hi Adrian,

thanks for your reply. Unfortunatelly this does not work :-(

Regards
Mario
mariomueller
Posts: 30
Joined: Wed Feb 14, 2018 3:27 pm

Re: shorten a XPATH expression (or-junction)

Post by mariomueller »

Hi adrian,

I found it. This works:

<xsd:assert test="G_SG8/G_SG10/S_CCI[D_7059='Z01']/D_4051=('Z30','Z31')"/>

Regards
Mario
Post Reply