Schematron validating multiple elements

MrD

Assume I have an XML document defining:

<people>

  <person>
    <city>London</city>
  </person>
  <person>
    <city>Paris</city>
  </person>

</people>

I want a schematron that check that each person lives in London.

I tried:

<sch:rule context="people">
            <sch:assert test="person/city = 'London'">Everybody must live in London!</sch:assert>
 </sch:rule>

However, this will return true so long as there exists one person that lives in London. Is there a way I can tell schematron to apply a test to each element matching the XPathcondition person/city ?

Tomalak

How about "no one may live outside London":

<sch:rule context="people">
    <sch:assert test="not(person[city != 'London'])">Everybody must live in London!</sch:assert>
</sch:rule>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Error message issue with validating multiple fields of a bean

From Dev

CakePHP - Validating multiple fields with same rule

From Dev

Validating multiple instances of same partial view

From Dev

work around for validating XML child elements

From Dev

Validating multiple forms on the same page

From Dev

Cakephp validating file upload "multiple"

From Dev

Validating XML with Schematron

From Dev

Recursively validating HTML input elements

From Dev

What is a good pattern for validating multiple complex conditions?

From Dev

Validating multiple checkboxes laravel 5.2

From Dev

Validating multiple files in array

From Dev

Validating Elements of 2D Array

From Dev

Require not null collection elements in when validating model in aspnet core

From Dev

C# Validating Multiple TextBoxes

From Dev

Validating specific set of form elements

From Dev

Validating DocBook 5 documents against both RELAXNG and Schematron?

From Dev

validating multiple inputs at the same time

From Dev

Jquery validating a specific form on a page with multiple forms

From Dev

Validating multiple instances of same partial view

From Dev

Cakephp validating file upload "multiple"

From Dev

Javascript validating multiple fields

From Dev

JSON not validating. Multiple Objects

From Dev

Validating multiple files in array

From Dev

Condition for multiple variable (validating IP addresses)

From Dev

Why is my XSD not validating some elements?

From Dev

Accessing and Validating Multiple select boxes in a table with Jquery

From Dev

Same DOM element is inserting after the input elements while validating form

From Dev

Validating multiple asyncronous methods in GWT

From Dev

Validating multiple inputs with a shorter code in PHP

Related Related

  1. 1

    Error message issue with validating multiple fields of a bean

  2. 2

    CakePHP - Validating multiple fields with same rule

  3. 3

    Validating multiple instances of same partial view

  4. 4

    work around for validating XML child elements

  5. 5

    Validating multiple forms on the same page

  6. 6

    Cakephp validating file upload "multiple"

  7. 7

    Validating XML with Schematron

  8. 8

    Recursively validating HTML input elements

  9. 9

    What is a good pattern for validating multiple complex conditions?

  10. 10

    Validating multiple checkboxes laravel 5.2

  11. 11

    Validating multiple files in array

  12. 12

    Validating Elements of 2D Array

  13. 13

    Require not null collection elements in when validating model in aspnet core

  14. 14

    C# Validating Multiple TextBoxes

  15. 15

    Validating specific set of form elements

  16. 16

    Validating DocBook 5 documents against both RELAXNG and Schematron?

  17. 17

    validating multiple inputs at the same time

  18. 18

    Jquery validating a specific form on a page with multiple forms

  19. 19

    Validating multiple instances of same partial view

  20. 20

    Cakephp validating file upload "multiple"

  21. 21

    Javascript validating multiple fields

  22. 22

    JSON not validating. Multiple Objects

  23. 23

    Validating multiple files in array

  24. 24

    Condition for multiple variable (validating IP addresses)

  25. 25

    Why is my XSD not validating some elements?

  26. 26

    Accessing and Validating Multiple select boxes in a table with Jquery

  27. 27

    Same DOM element is inserting after the input elements while validating form

  28. 28

    Validating multiple asyncronous methods in GWT

  29. 29

    Validating multiple inputs with a shorter code in PHP

HotTag

Archive