Last active
February 2, 2017 08:49
-
-
Save torstenwerner/4fdd48c3d46a114b3ad1a8bd38735287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple Xml validation using the joox library. | |
*/ | |
@Grapes( | |
@Grab(group = 'org.jooq', module = 'joox', version = '1.4.0') | |
) | |
import static org.joox.JOOX.* | |
def document = $(new File('instance-xs11.xml')) | |
def match = $(document).namespace('ch', 'http://choice.egal').xpath('//ch:Ort[string-length() < 3]') | |
if (match.empty) { | |
println('Erfolg!') | |
} else { | |
println('Ort muss mindestens 3 Zeichen haben.') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment