telefonicaid/fiware-orion — pull request #92 by fgalan (2013-11-15 14:52:40+00:00)
Title: ADD functionality to mark XML fragments as invalid in xmlExtractor.py

In order to use this feature:

* Include the following comment line (verbatim) in .test to mark next XML fragment to be stamped as ".invalid." in the corresponding generated file: `#INVALID_XML`. If several fragments needs to be stamped with ".invalid.", you have to include several `#INVALID_XML` lines.
* Use this mark only in the "SHELL" section in .test (it makes sense: the CB shouldn't return invalid code, thus "REGEXPECT" section shouldn't use invalid XML).

E.g.: in the .test:

#INVALID_XML
(curl localhost:${BROKER_PORT}/NGSI10/queryContext -s -S --header 'Content-Type: application/xml' -d @- | xmllint --format -) <

[an XML document]

EOF
echo "7: ++++++++++++++++++++"

will generate the following file for that fragment: `ngsi10.query_sequence.invalid.7`

Maybe some adaptation is needed in the xmlChecker.sh script (as the "invalid" token has to now taken into account in xmlChecker) to make both things work together.