Maintaining XML Data Integrity in Programs [chapter]

Patrick Michel, Arnd Poetzsch-Heffter
2010 Lecture Notes in Computer Science  
Datatype Approach Implementation of the Approach Tool Demo Conclusion 2 Scenario loosely coupled distributed systems collaborate (workflows) exchange XML data data is schema-constrained applications have to keep the data valid (invariant) applications are written in languages like Java or C# 3 B C A Simple Example Schema typical integrity constraints: range constraints value comparisons contain aggregates like sum, count, etc. contain references (e.g. an item could reference a type) 4 start =
more » ... ement bin { attribute capacity { xs:integer [. > 0] [ sum(//size) <= . ] }, element item * { attribute size { xs:integer [. > 0] } } } Integrity Constraints structural and base types are not enough e.g. tax declaration forms value consistence, value relations integrity constraints are inherent to datatypes failures are fatal constraints have to be invariant modifications have to be correct 5 //capacity > 0 sum(//size) <= /bin/capacity sum(//salary[//employee/level]/amount) <= //budget XML Support Validating ✓, Reading ✓ (even gets easier), Modifying ? 6 generic specific XML Relax NG XML Schema Programming Support pure DOM SAX JAXB XJ XDuce Schematron DSD Structure Integrity ? Maintaining Data Integrity consider a Java method addItem implemented using e.g. DOM or XJ modifies data constrained by bin-schema (Relax NG) does it violate any integrity constraints? (e.g. XPath) combinations of complex languages hard to know in advance if invariants are violated expensive to check if invariants are violated hard to recover from a detected error verification is next to impossible 7 Abstract Datatype Approach XML datatype with integrity constraints
doi:10.1007/978-3-642-11266-9_50 fatcat:rm2lnzaefzfpbgxgaumua5d2zm