SlideShare a Scribd company logo
Validating XML - Avoiding the pain

        Arne Blankerts <arne@thephp.cc>, TobiasSchlitt <toby@php.net>

                                                       IPC 2009


                                                   2009-11-17




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   1 / 18
Outline




 1 Welcome


 2 Introduction


 3 Schema formats


 4 The end




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   2 / 18
Arne Blankerts




         Arne Blankerts <arne@thephp.cc>
         PHP since 1999 (10 years of PHP!)
         Co-Founder of thePHP.cc
         ballyhoo. werbeagentur.
         Open source addicted
                 Inventor and lead developer of fCMS site
                 system
                 Contributor and translator for the PHP manual




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   3 / 18
Tobias Schlitt



         Tobias Schlitt <toby@php.net>
         PHP since 2001
         Freelancing consultant
         Qualified IT Specialist
         Studying CS at TU Dortmund
         (finishing 2010)
         OSS addicted
                 PHP
                 eZ Components
                 PHPUnit




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   4 / 18
Outline




 1 Welcome


 2 Introduction
          Why the hell validate?
          Validation basics

 3 Schema formats


 4 The end




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   5 / 18
XML is everywhere




          On your HD
          On the web
          In your app




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   6 / 18
XML is everywhere




          On your HD
          On the web
          In your app




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   6 / 18
XML is everywhere




          On your HD
          On the web
          In your app




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   6 / 18
XML comes from everywhere




          From the web
          From your app
          From your users
          From 3rd parties




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   7 / 18
XML comes from everywhere




          From the web
          From your app
          From your users
          From 3rd parties




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   7 / 18
XML comes from everywhere




          From the web
          From your app
          From your users
          From 3rd parties




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   7 / 18
XML comes from everywhere




          From the web
          From your app
          From your users
          From 3rd parties




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   7 / 18
So why validate?



          Broken incoming data breaks your app
          Broken outgoing data breaks other apps
          You test code, why not test XML?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   8 / 18
So why validate?



          Broken incoming data breaks your app
          Broken outgoing data breaks other apps
          You test code, why not test XML?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   8 / 18
So why validate?



          Broken incoming data breaks your app
          Broken outgoing data breaks other apps
          You test code, why not test XML?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   8 / 18
So why validate?



          Broken incoming data breaks your app
          Broken outgoing data breaks other apps
          You test code, why not test XML?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   8 / 18
What is a XML schema?




          Defines the structure of data
          Possibly defines data types
          Used to validate correctness
          Helpful as documentation
          Similar to database schemas!




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   9 / 18
When to use it?




          On XML generation in your app
          Before your app consumes XML
          In your tests
          Give to your XML consumers




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   10 / 18
Outline



 1 Welcome


 2 Introduction


 3 Schema formats
          Overview
          DTD
          XML Schema

 4 The end




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   11 / 18
XML schema formats




              DTD
               XSD
    RELAX NG




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   12 / 18
XML schema formats




              DTD               Document Type Definition
                                Part of the XML specification
                                Allows definition of entities
                                No advanced type support
                                Does not support different types for same element name
               XSD
    RELAX NG




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   12 / 18
XML schema formats




              DTD
               XSD              XML Schema
                                W3C recommendation since May 2001
                                Advanced type support
                                Support for keys and key references
                                No support for entities
    RELAX NG




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   12 / 18
XML schema formats




              DTD
               XSD
    RELAX NG                    Regular Language for XML Next Generation
                                Defined by OASIS, ISO/IEC 19757
                                Generally more powerful than XSD
                                No support for entities
                                Not (yet?) as popular as XSD




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   12 / 18
DTD




 Let’s dig into the code. . .
         Schema definitions
         Entities




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   13 / 18
DTD




 Let’s dig into the code. . .
         Schema definitions
         Advanced types
         Key and key-ref




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   14 / 18
XSD goodies




          Qualified / unqualified
          <any> namespace handling
          Validation of external elements/attributes
          Abstract types and inheritance
          Nillable




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   15 / 18
XSD goodies




          Qualified / unqualified
          <any> namespace handling
                  ##any
                  ##other
                  ##local
          Validation of external elements/attributes
          Abstract types and inheritance
          Nillable




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   15 / 18
XSD goodies




          Qualified / unqualified
          <any> namespace handling
          Validation of external elements/attributes
                  strict
                  skip
                  lax
          Abstract types and inheritance
          Nillable




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   15 / 18
XSD goodies




          Qualified / unqualified
          <any> namespace handling
          Validation of external elements/attributes
          Abstract types and inheritance
          Nillable




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   15 / 18
XSD goodies




          Qualified / unqualified
          <any> namespace handling
          Validation of external elements/attributes
          Abstract types and inheritance
          Nillable




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   15 / 18
Outline




 1 Welcome


 2 Introduction


 3 Schema formats


 4 The end




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   16 / 18
Q/A




          Are there any questions left?
          Please give us some feedback!




Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   17 / 18
The end




          We hope you enjoyed the session!
          Slides and material:
                  Delivered by Software & Support
                  http://schlitt.info/opensource
                  On Slideshare (http://slideshare.net)
          Contact us:
                  Arne Blankerts <arne@thephp.cc>
                  Tobias Schlitt <toby@php.net>
          Give us feedback on http://joind.in/1043

Arne Blankerts, Tobias Schlitt (IPC 2009)   Validating XML - Avoiding the pain   2009-11-17   18 / 18

More Related Content

Similar to Validating XML - Avoiding the pain

A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
Alexandro Colorado
 
CV_RuudOverman
CV_RuudOvermanCV_RuudOverman
CV_RuudOverman
Ruud Overman
 
SplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense Center
SplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense CenterSplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense Center
SplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense Center
Splunk
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Fazli Kabashi
 
XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)
Beat Signer
 
Bp124
Bp124Bp124
Bp124
John Head
 
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
BookNet Canada
 
paper about xml
paper about xmlpaper about xml
XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7
Deniz Kılınç
 
Xml
XmlXml
Fatah Uddin (072831056)
Fatah Uddin (072831056)Fatah Uddin (072831056)
Fatah Uddin (072831056)
mashiur
 
introduction and basic of web development
introduction and basic of web developmentintroduction and basic of web development
introduction and basic of web development
amithvp002
 
Introduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoTIntroduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoT
Amrisha Prashar
 
Introduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoTIntroduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoT
Canonical
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
soumya
 
EXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALA
EXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALAEXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALA
EXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALA
Saikiran Panjala
 
Ample SDK - Open Source GUI Framework
Ample SDK - Open Source GUI FrameworkAmple SDK - Open Source GUI Framework
Ample SDK - Open Source GUI Framework
Béla Varga
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Bình Trọng Án
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Ông Thông
 
Verification Automation Using IPXACT
Verification Automation Using IPXACTVerification Automation Using IPXACT
Verification Automation Using IPXACT
DVClub
 

Similar to Validating XML - Avoiding the pain (20)

A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
 
CV_RuudOverman
CV_RuudOvermanCV_RuudOverman
CV_RuudOverman
 
SplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense Center
SplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense CenterSplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense Center
SplunkLive! Frankfurt 2018 - Customer Presentation: Bosch Cyber Defense Center
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)
 
Bp124
Bp124Bp124
Bp124
 
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
 
paper about xml
paper about xmlpaper about xml
paper about xml
 
XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7
 
Xml
XmlXml
Xml
 
Fatah Uddin (072831056)
Fatah Uddin (072831056)Fatah Uddin (072831056)
Fatah Uddin (072831056)
 
introduction and basic of web development
introduction and basic of web developmentintroduction and basic of web development
introduction and basic of web development
 
Introduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoTIntroduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoT
 
Introduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoTIntroduction to Ubuntu core, Ubuntu for IoT
Introduction to Ubuntu core, Ubuntu for IoT
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
EXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALA
EXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALAEXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALA
EXTENSIBLE MARKUP LANGUAGE BY SAIKIRAN PANJALA
 
Ample SDK - Open Source GUI Framework
Ample SDK - Open Source GUI FrameworkAmple SDK - Open Source GUI Framework
Ample SDK - Open Source GUI Framework
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
 
Verification Automation Using IPXACT
Verification Automation Using IPXACTVerification Automation Using IPXACT
Verification Automation Using IPXACT
 

Recently uploaded

Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

Validating XML - Avoiding the pain

  • 1. Validating XML - Avoiding the pain Arne Blankerts <arne@thephp.cc>, TobiasSchlitt <toby@php.net> IPC 2009 2009-11-17 Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 1 / 18
  • 2. Outline 1 Welcome 2 Introduction 3 Schema formats 4 The end Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 2 / 18
  • 3. Arne Blankerts Arne Blankerts <arne@thephp.cc> PHP since 1999 (10 years of PHP!) Co-Founder of thePHP.cc ballyhoo. werbeagentur. Open source addicted Inventor and lead developer of fCMS site system Contributor and translator for the PHP manual Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 3 / 18
  • 4. Tobias Schlitt Tobias Schlitt <toby@php.net> PHP since 2001 Freelancing consultant Qualified IT Specialist Studying CS at TU Dortmund (finishing 2010) OSS addicted PHP eZ Components PHPUnit Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 4 / 18
  • 5. Outline 1 Welcome 2 Introduction Why the hell validate? Validation basics 3 Schema formats 4 The end Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 5 / 18
  • 6. XML is everywhere On your HD On the web In your app Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 6 / 18
  • 7. XML is everywhere On your HD On the web In your app Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 6 / 18
  • 8. XML is everywhere On your HD On the web In your app Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 6 / 18
  • 9. XML comes from everywhere From the web From your app From your users From 3rd parties Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 7 / 18
  • 10. XML comes from everywhere From the web From your app From your users From 3rd parties Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 7 / 18
  • 11. XML comes from everywhere From the web From your app From your users From 3rd parties Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 7 / 18
  • 12. XML comes from everywhere From the web From your app From your users From 3rd parties Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 7 / 18
  • 13. So why validate? Broken incoming data breaks your app Broken outgoing data breaks other apps You test code, why not test XML? Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 8 / 18
  • 14. So why validate? Broken incoming data breaks your app Broken outgoing data breaks other apps You test code, why not test XML? Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 8 / 18
  • 15. So why validate? Broken incoming data breaks your app Broken outgoing data breaks other apps You test code, why not test XML? Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 8 / 18
  • 16. So why validate? Broken incoming data breaks your app Broken outgoing data breaks other apps You test code, why not test XML? Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 8 / 18
  • 17. What is a XML schema? Defines the structure of data Possibly defines data types Used to validate correctness Helpful as documentation Similar to database schemas! Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 9 / 18
  • 18. When to use it? On XML generation in your app Before your app consumes XML In your tests Give to your XML consumers Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 10 / 18
  • 19. Outline 1 Welcome 2 Introduction 3 Schema formats Overview DTD XML Schema 4 The end Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 11 / 18
  • 20. XML schema formats DTD XSD RELAX NG Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 12 / 18
  • 21. XML schema formats DTD Document Type Definition Part of the XML specification Allows definition of entities No advanced type support Does not support different types for same element name XSD RELAX NG Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 12 / 18
  • 22. XML schema formats DTD XSD XML Schema W3C recommendation since May 2001 Advanced type support Support for keys and key references No support for entities RELAX NG Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 12 / 18
  • 23. XML schema formats DTD XSD RELAX NG Regular Language for XML Next Generation Defined by OASIS, ISO/IEC 19757 Generally more powerful than XSD No support for entities Not (yet?) as popular as XSD Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 12 / 18
  • 24. DTD Let’s dig into the code. . . Schema definitions Entities Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 13 / 18
  • 25. DTD Let’s dig into the code. . . Schema definitions Advanced types Key and key-ref Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 14 / 18
  • 26. XSD goodies Qualified / unqualified <any> namespace handling Validation of external elements/attributes Abstract types and inheritance Nillable Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 15 / 18
  • 27. XSD goodies Qualified / unqualified <any> namespace handling ##any ##other ##local Validation of external elements/attributes Abstract types and inheritance Nillable Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 15 / 18
  • 28. XSD goodies Qualified / unqualified <any> namespace handling Validation of external elements/attributes strict skip lax Abstract types and inheritance Nillable Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 15 / 18
  • 29. XSD goodies Qualified / unqualified <any> namespace handling Validation of external elements/attributes Abstract types and inheritance Nillable Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 15 / 18
  • 30. XSD goodies Qualified / unqualified <any> namespace handling Validation of external elements/attributes Abstract types and inheritance Nillable Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 15 / 18
  • 31. Outline 1 Welcome 2 Introduction 3 Schema formats 4 The end Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 16 / 18
  • 32. Q/A Are there any questions left? Please give us some feedback! Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 17 / 18
  • 33. The end We hope you enjoyed the session! Slides and material: Delivered by Software & Support http://schlitt.info/opensource On Slideshare (http://slideshare.net) Contact us: Arne Blankerts <arne@thephp.cc> Tobias Schlitt <toby@php.net> Give us feedback on http://joind.in/1043 Arne Blankerts, Tobias Schlitt (IPC 2009) Validating XML - Avoiding the pain 2009-11-17 18 / 18