SlideShare a Scribd company logo
Q5M1 - XML Dudy Fathan Ali S.Kom
XML Schema
Q5M1 - XML
Dudy Fathan Ali, S.Kom (DFA)
2015
CEP - CCIT
Fakultas Teknik Universitas Indonesia
Declaring Attributes in a Schema
Q5M1 - XML Dudy Fathan Ali S.Kom
Attributes in an XML schema are declared in the same way as
elements.
Declaring attributes in an XML schema facilitates the assimilation of
information for an XML document.
Attribute declarations can be defined in two ways:
Simple type definitions: Facilitates local validation of the
attribute information.
Global attribute declarations: Enables reuse of attributes.
Attribute
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
In XSD, an attribute for a user-defined element is declared
using the attribute element.
The syntax for declaring an attribute in XSD is:
<attribute name="attributename"
ref="attributename"
type="datatypename" use="value" value="value">
</attribute>
The attribute element contains attributes that are used to
further qualify and restrict the scope and usage of the user-
defined attribute.
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
The attribute element consists of the following attributes:
name
ref
type
use
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
The attribute element consists of the following attributes:
name
ref
type
use
Is used to specify the name of a user-defined attribute.
Must be used when the schema element is the parent
element of the attribute element.
Colon (:) should not be included in the value of the
name attribute.
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
The attribute element consists of the following attributes:
name
ref
type
use
Is used to refer to a user-defined attribute declared either
in the same or in any other XSD document.
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
The attribute element consists of the following attributes:
name
ref
type
use
Takes a value that specifies the data type of the user-
defined attribute.
<xsd:attribute name="PRODUCTID"
type="xsd:string">
OR
<xsd:attribute name="PRODID" type="myID">
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
The attribute element consists of the following attributes:
name
ref
type
use Specifies the way in which an attribute can be used in an
XML document.
Values that can be assigned to the use attribute are
optional, default, required, and fixed.
<xsd:attribute name="baseprice“ type="xsd:integer“ use="optional" />
<xsd:attribute name="baseprice“ type="xsd:integer“ default="25" />
<xsd:attribute name="baseprice“ type="xsd:integer“ use="required" />
<xsd:attribute name="baseprice“ type="xsd:integer" fixed="600“ />
Attribute Element
Q5M1 - XML Dudy Fathan Ali S.Kom
Global Attribute
Q5M1 - XML Dudy Fathan Ali S.Kom
Global attributes are declared outside all element declarations.
Global attributes facilitate attribute reusability.
Global attributes can be associated with simple and complex
data types.
Global attributes have the schema element as the parent
element.
<xsd:schema>
<xsd:attribute name="NAME" type="xsd:string"/>
</xsd:schema>
Global Attribute
Q5M1 - XML Dudy Fathan Ali S.Kom
A global attribute can be reused from anywhere in a schema
<xsd:element name="BOOK" type="BOOKTYPE"/>
<xsd:complexType name="BOOKTYPE">
……..
<xsd:attribute ref="NAME"/>
……..
</xsd:complexType>
<xsd:element name="AUTHOR" type="AUTHORTYPE"/>
<xsd:complexType name="AUTHORTYPE">
……..
<xsd:attribute ref="NAME"/>
……..
</xsd:complexType>
Global Attribute
Q5M1 - XML Dudy Fathan Ali S.Kom
XSD Restrictions
Q5M1 - XML Dudy Fathan Ali S.Kom
In order to restrict values that can be assigned to an attribute
or element:
Declare the attribute or element and associate it with a user-
defined simple data type.
Create a simple data type by using the XSD simpleType
element.
Use the XSD restriction element within the simpleType
element to restrict the values that can be assigned to the
elements or attributes that use the simple data type.
Restricting Values
Q5M1 - XML Dudy Fathan Ali S.Kom
Example Code
Restrictions on Values
Q5M1 - XML Dudy Fathan Ali S.Kom
Consider of this following code, The following example defines an element called "age"
with a restriction. The value of age cannot be lower than 0 or greater than 150:
Restrictions on Values
Q5M1 - XML Dudy Fathan Ali S.Kom
Consider of this following code, The following example defines an element called "gender"
with a restriction. The only acceptable value is Male OR Female:
Restrictions for Datatypes
Q5M1 - XML Dudy Fathan Ali S.Kom
Source : w3schools.com
Q5M1 - XML Dudy Fathan Ali S.Kom
Thank You!
Dudy Fathan Ali S.Kom
dudy.fathan@eng.ui.ac.id
Ad

More Related Content

What's hot (19)

03 namespace
03 namespace03 namespace
03 namespace
Baskarkncet
 
Xml basics
Xml basicsXml basics
Xml basics
Kumar
 
Xml basics for beginning
Xml basics for beginningXml basics for beginning
Xml basics for beginning
Ahmad Awsaf-uz-zaman
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
Pradeep Rapolu
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
Baskarkncet
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
Sudharsan S
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
Sudharsan S
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
Sudharsan S
 
XML
XMLXML
XML
Osama Qunoo
 
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
 
Xml schema
Xml schemaXml schema
Xml schema
Akshaya Akshaya
 
Basics of XML
Basics of XMLBasics of XML
Basics of XML
indiangarg
 
XML
XMLXML
XML
Prabu U
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Fazli Kabashi
 
Xml presentation
Xml presentationXml presentation
Xml presentation
Miguel Angel Teheran Garcia
 
Xml schema
Xml schemaXml schema
Xml schema
Harry Potter
 
00 introduction
00 introduction00 introduction
00 introduction
Baskarkncet
 
transforming xml using xsl and xslt
transforming xml using xsl and xslttransforming xml using xsl and xslt
transforming xml using xsl and xslt
Hemant Suthar
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
Umar Ali
 

Similar to XML Schema Part 2 (20)

XML SCHEMAS
XML SCHEMASXML SCHEMAS
XML SCHEMAS
SaraswathiRamalingam
 
Xsd examples
Xsd examplesXsd examples
Xsd examples
Bình Trọng Án
 
Xml part4
Xml part4Xml part4
Xml part4
NOHA AW
 
XML Schema
XML SchemaXML Schema
XML Schema
Kumar
 
XML Schema.pdf
XML Schema.pdfXML Schema.pdf
XML Schema.pdf
KGSCSEPSGCT
 
02 sm3 xml_xp_03
02 sm3 xml_xp_0302 sm3 xml_xp_03
02 sm3 xml_xp_03
Niit Care
 
Xml schema
Xml schemaXml schema
Xml schema
Dr.Saranya K.G
 
Service Oriented Architecture-Unit-1-XML Schema
Service Oriented Architecture-Unit-1-XML SchemaService Oriented Architecture-Unit-1-XML Schema
Service Oriented Architecture-Unit-1-XML Schema
Ramco Institute of Technology, Rajapalayam, Tamilnadu, India
 
EXtensible Markup Language
EXtensible Markup LanguageEXtensible Markup Language
EXtensible Markup Language
Prabhat gangwar
 
SCDJWS 1. xml schema
SCDJWS 1. xml schemaSCDJWS 1. xml schema
SCDJWS 1. xml schema
Francesco Ierna
 
Tp2
Tp2Tp2
Tp2
Bình Trọng Án
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
Swati Parmar
 
Xml1111
Xml1111Xml1111
Xml1111
Sudharsan S
 
Web Technologies Unit 2 Print.pdf
Web Technologies Unit 2 Print.pdfWeb Technologies Unit 2 Print.pdf
Web Technologies Unit 2 Print.pdf
AnonymousXhmybK
 
II UNIT PPT NOTES.pdf this is the data structures
II UNIT PPT NOTES.pdf this is the data structuresII UNIT PPT NOTES.pdf this is the data structures
II UNIT PPT NOTES.pdf this is the data structures
PriyankaRamavath3
 
Xml session
Xml sessionXml session
Xml session
Farag Zakaria
 
XML's validation - XML Schema
XML's validation - XML SchemaXML's validation - XML Schema
XML's validation - XML Schema
videde_group
 
distributed system concerned lab sessions
distributed system concerned lab sessionsdistributed system concerned lab sessions
distributed system concerned lab sessions
milkesa13
 
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
phanleson
 
XML Schema.pptx
XML Schema.pptxXML Schema.pptx
XML Schema.pptx
JohnsonDcunha1
 
Ad

More from Dudy Ali (20)

Understanding COM+
Understanding COM+Understanding COM+
Understanding COM+
Dudy Ali
 
Distributed Application Development (Introduction)
Distributed Application Development (Introduction)Distributed Application Development (Introduction)
Distributed Application Development (Introduction)
Dudy Ali
 
Java CRUD Mechanism with SQL Server Database
Java CRUD Mechanism with SQL Server DatabaseJava CRUD Mechanism with SQL Server Database
Java CRUD Mechanism with SQL Server Database
Dudy Ali
 
Network Socket Programming with JAVA
Network Socket Programming with JAVANetwork Socket Programming with JAVA
Network Socket Programming with JAVA
Dudy Ali
 
Review Materi ASP.NET
Review Materi ASP.NETReview Materi ASP.NET
Review Materi ASP.NET
Dudy Ali
 
Pengantar XML
Pengantar XMLPengantar XML
Pengantar XML
Dudy Ali
 
Pengantar XML DOM
Pengantar XML DOMPengantar XML DOM
Pengantar XML DOM
Dudy Ali
 
Pengantar ADO.NET
Pengantar ADO.NETPengantar ADO.NET
Pengantar ADO.NET
Dudy Ali
 
Database Connectivity with JDBC
Database Connectivity with JDBCDatabase Connectivity with JDBC
Database Connectivity with JDBC
Dudy Ali
 
Algorithm & Data Structure - Algoritma Pengurutan
Algorithm & Data Structure - Algoritma PengurutanAlgorithm & Data Structure - Algoritma Pengurutan
Algorithm & Data Structure - Algoritma Pengurutan
Dudy Ali
 
Algorithm & Data Structure - Pengantar
Algorithm & Data Structure - PengantarAlgorithm & Data Structure - Pengantar
Algorithm & Data Structure - Pengantar
Dudy Ali
 
Object Oriented Programming - Value Types & Reference Types
Object Oriented Programming - Value Types & Reference TypesObject Oriented Programming - Value Types & Reference Types
Object Oriented Programming - Value Types & Reference Types
Dudy Ali
 
Object Oriented Programming - Inheritance
Object Oriented Programming - InheritanceObject Oriented Programming - Inheritance
Object Oriented Programming - Inheritance
Dudy Ali
 
Object Oriented Programming - File Input & Output
Object Oriented Programming - File Input & OutputObject Oriented Programming - File Input & Output
Object Oriented Programming - File Input & Output
Dudy Ali
 
Object Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & DestructorsObject Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 
Object Oriented Programming - Abstraction & Encapsulation
Object Oriented Programming - Abstraction & EncapsulationObject Oriented Programming - Abstraction & Encapsulation
Object Oriented Programming - Abstraction & Encapsulation
Dudy Ali
 
Web Programming Syaria - Pengenalan Halaman Web
Web Programming Syaria - Pengenalan Halaman WebWeb Programming Syaria - Pengenalan Halaman Web
Web Programming Syaria - Pengenalan Halaman Web
Dudy Ali
 
Web Programming Syaria - PHP
Web Programming Syaria - PHPWeb Programming Syaria - PHP
Web Programming Syaria - PHP
Dudy Ali
 
Software Project Management - Project Management Knowledge
Software Project Management - Project Management KnowledgeSoftware Project Management - Project Management Knowledge
Software Project Management - Project Management Knowledge
Dudy Ali
 
Software Project Management - Proses Manajemen Proyek
Software Project Management - Proses Manajemen ProyekSoftware Project Management - Proses Manajemen Proyek
Software Project Management - Proses Manajemen Proyek
Dudy Ali
 
Understanding COM+
Understanding COM+Understanding COM+
Understanding COM+
Dudy Ali
 
Distributed Application Development (Introduction)
Distributed Application Development (Introduction)Distributed Application Development (Introduction)
Distributed Application Development (Introduction)
Dudy Ali
 
Java CRUD Mechanism with SQL Server Database
Java CRUD Mechanism with SQL Server DatabaseJava CRUD Mechanism with SQL Server Database
Java CRUD Mechanism with SQL Server Database
Dudy Ali
 
Network Socket Programming with JAVA
Network Socket Programming with JAVANetwork Socket Programming with JAVA
Network Socket Programming with JAVA
Dudy Ali
 
Review Materi ASP.NET
Review Materi ASP.NETReview Materi ASP.NET
Review Materi ASP.NET
Dudy Ali
 
Pengantar XML
Pengantar XMLPengantar XML
Pengantar XML
Dudy Ali
 
Pengantar XML DOM
Pengantar XML DOMPengantar XML DOM
Pengantar XML DOM
Dudy Ali
 
Pengantar ADO.NET
Pengantar ADO.NETPengantar ADO.NET
Pengantar ADO.NET
Dudy Ali
 
Database Connectivity with JDBC
Database Connectivity with JDBCDatabase Connectivity with JDBC
Database Connectivity with JDBC
Dudy Ali
 
Algorithm & Data Structure - Algoritma Pengurutan
Algorithm & Data Structure - Algoritma PengurutanAlgorithm & Data Structure - Algoritma Pengurutan
Algorithm & Data Structure - Algoritma Pengurutan
Dudy Ali
 
Algorithm & Data Structure - Pengantar
Algorithm & Data Structure - PengantarAlgorithm & Data Structure - Pengantar
Algorithm & Data Structure - Pengantar
Dudy Ali
 
Object Oriented Programming - Value Types & Reference Types
Object Oriented Programming - Value Types & Reference TypesObject Oriented Programming - Value Types & Reference Types
Object Oriented Programming - Value Types & Reference Types
Dudy Ali
 
Object Oriented Programming - Inheritance
Object Oriented Programming - InheritanceObject Oriented Programming - Inheritance
Object Oriented Programming - Inheritance
Dudy Ali
 
Object Oriented Programming - File Input & Output
Object Oriented Programming - File Input & OutputObject Oriented Programming - File Input & Output
Object Oriented Programming - File Input & Output
Dudy Ali
 
Object Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & DestructorsObject Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 
Object Oriented Programming - Abstraction & Encapsulation
Object Oriented Programming - Abstraction & EncapsulationObject Oriented Programming - Abstraction & Encapsulation
Object Oriented Programming - Abstraction & Encapsulation
Dudy Ali
 
Web Programming Syaria - Pengenalan Halaman Web
Web Programming Syaria - Pengenalan Halaman WebWeb Programming Syaria - Pengenalan Halaman Web
Web Programming Syaria - Pengenalan Halaman Web
Dudy Ali
 
Web Programming Syaria - PHP
Web Programming Syaria - PHPWeb Programming Syaria - PHP
Web Programming Syaria - PHP
Dudy Ali
 
Software Project Management - Project Management Knowledge
Software Project Management - Project Management KnowledgeSoftware Project Management - Project Management Knowledge
Software Project Management - Project Management Knowledge
Dudy Ali
 
Software Project Management - Proses Manajemen Proyek
Software Project Management - Proses Manajemen ProyekSoftware Project Management - Proses Manajemen Proyek
Software Project Management - Proses Manajemen Proyek
Dudy Ali
 
Ad

Recently uploaded (20)

Best 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat PlatformsBest 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat Platforms
Soulmaite
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc
 
React Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for SuccessReact Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for Success
Amelia Swank
 
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Preeti Jha
 
Building a research repository that works by Clare Cady
Building a research repository that works by Clare CadyBuilding a research repository that works by Clare Cady
Building a research repository that works by Clare Cady
UXPA Boston
 
Scientific Large Language Models in Multi-Modal Domains
Scientific Large Language Models in Multi-Modal DomainsScientific Large Language Models in Multi-Modal Domains
Scientific Large Language Models in Multi-Modal Domains
syedanidakhader1
 
SQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptxSQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptx
Scott Keck-Warren
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
AI and Meaningful Work by Pablo Fernández Vallejo
AI and Meaningful Work by Pablo Fernández VallejoAI and Meaningful Work by Pablo Fernández Vallejo
AI and Meaningful Work by Pablo Fernández Vallejo
UXPA Boston
 
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Vasileios Komianos
 
Secondary Storage for a microcontroller system
Secondary Storage for a microcontroller systemSecondary Storage for a microcontroller system
Secondary Storage for a microcontroller system
fizarcse
 
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdfComputer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
fizarcse
 
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdf
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdfGoogle DeepMind’s New AI Coding Agent AlphaEvolve.pdf
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdf
derrickjswork
 
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
UXPA Boston
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategy
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT StrategyRisk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategy
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategy
john823664
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Best 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat PlatformsBest 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat Platforms
Soulmaite
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc
 
React Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for SuccessReact Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for Success
Amelia Swank
 
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Middle East and Africa Cybersecurity Market Trends and Growth Analysis
Preeti Jha
 
Building a research repository that works by Clare Cady
Building a research repository that works by Clare CadyBuilding a research repository that works by Clare Cady
Building a research repository that works by Clare Cady
UXPA Boston
 
Scientific Large Language Models in Multi-Modal Domains
Scientific Large Language Models in Multi-Modal DomainsScientific Large Language Models in Multi-Modal Domains
Scientific Large Language Models in Multi-Modal Domains
syedanidakhader1
 
SQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptxSQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptx
Scott Keck-Warren
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
AI and Meaningful Work by Pablo Fernández Vallejo
AI and Meaningful Work by Pablo Fernández VallejoAI and Meaningful Work by Pablo Fernández Vallejo
AI and Meaningful Work by Pablo Fernández Vallejo
UXPA Boston
 
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Vasileios Komianos
 
Secondary Storage for a microcontroller system
Secondary Storage for a microcontroller systemSecondary Storage for a microcontroller system
Secondary Storage for a microcontroller system
fizarcse
 
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdfComputer Systems Quiz Presentation in Purple Bold Style (4).pdf
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
fizarcse
 
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdf
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdfGoogle DeepMind’s New AI Coding Agent AlphaEvolve.pdf
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdf
derrickjswork
 
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
UXPA Boston
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategy
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT StrategyRisk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategy
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategy
john823664
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 

XML Schema Part 2

  • 1. Q5M1 - XML Dudy Fathan Ali S.Kom XML Schema Q5M1 - XML Dudy Fathan Ali, S.Kom (DFA) 2015 CEP - CCIT Fakultas Teknik Universitas Indonesia
  • 2. Declaring Attributes in a Schema Q5M1 - XML Dudy Fathan Ali S.Kom Attributes in an XML schema are declared in the same way as elements. Declaring attributes in an XML schema facilitates the assimilation of information for an XML document. Attribute declarations can be defined in two ways: Simple type definitions: Facilitates local validation of the attribute information. Global attribute declarations: Enables reuse of attributes. Attribute
  • 3. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom In XSD, an attribute for a user-defined element is declared using the attribute element. The syntax for declaring an attribute in XSD is: <attribute name="attributename" ref="attributename" type="datatypename" use="value" value="value"> </attribute> The attribute element contains attributes that are used to further qualify and restrict the scope and usage of the user- defined attribute.
  • 4. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom The attribute element consists of the following attributes: name ref type use
  • 5. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom The attribute element consists of the following attributes: name ref type use Is used to specify the name of a user-defined attribute. Must be used when the schema element is the parent element of the attribute element. Colon (:) should not be included in the value of the name attribute.
  • 6. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom The attribute element consists of the following attributes: name ref type use Is used to refer to a user-defined attribute declared either in the same or in any other XSD document.
  • 7. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom The attribute element consists of the following attributes: name ref type use Takes a value that specifies the data type of the user- defined attribute. <xsd:attribute name="PRODUCTID" type="xsd:string"> OR <xsd:attribute name="PRODID" type="myID">
  • 8. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom The attribute element consists of the following attributes: name ref type use Specifies the way in which an attribute can be used in an XML document. Values that can be assigned to the use attribute are optional, default, required, and fixed. <xsd:attribute name="baseprice“ type="xsd:integer“ use="optional" /> <xsd:attribute name="baseprice“ type="xsd:integer“ default="25" /> <xsd:attribute name="baseprice“ type="xsd:integer“ use="required" /> <xsd:attribute name="baseprice“ type="xsd:integer" fixed="600“ />
  • 9. Attribute Element Q5M1 - XML Dudy Fathan Ali S.Kom
  • 10. Global Attribute Q5M1 - XML Dudy Fathan Ali S.Kom Global attributes are declared outside all element declarations. Global attributes facilitate attribute reusability. Global attributes can be associated with simple and complex data types. Global attributes have the schema element as the parent element. <xsd:schema> <xsd:attribute name="NAME" type="xsd:string"/> </xsd:schema>
  • 11. Global Attribute Q5M1 - XML Dudy Fathan Ali S.Kom A global attribute can be reused from anywhere in a schema <xsd:element name="BOOK" type="BOOKTYPE"/> <xsd:complexType name="BOOKTYPE"> …….. <xsd:attribute ref="NAME"/> …….. </xsd:complexType> <xsd:element name="AUTHOR" type="AUTHORTYPE"/> <xsd:complexType name="AUTHORTYPE"> …….. <xsd:attribute ref="NAME"/> …….. </xsd:complexType>
  • 12. Global Attribute Q5M1 - XML Dudy Fathan Ali S.Kom
  • 13. XSD Restrictions Q5M1 - XML Dudy Fathan Ali S.Kom In order to restrict values that can be assigned to an attribute or element: Declare the attribute or element and associate it with a user- defined simple data type. Create a simple data type by using the XSD simpleType element. Use the XSD restriction element within the simpleType element to restrict the values that can be assigned to the elements or attributes that use the simple data type.
  • 14. Restricting Values Q5M1 - XML Dudy Fathan Ali S.Kom Example Code
  • 15. Restrictions on Values Q5M1 - XML Dudy Fathan Ali S.Kom Consider of this following code, The following example defines an element called "age" with a restriction. The value of age cannot be lower than 0 or greater than 150:
  • 16. Restrictions on Values Q5M1 - XML Dudy Fathan Ali S.Kom Consider of this following code, The following example defines an element called "gender" with a restriction. The only acceptable value is Male OR Female:
  • 17. Restrictions for Datatypes Q5M1 - XML Dudy Fathan Ali S.Kom Source : w3schools.com
  • 18. Q5M1 - XML Dudy Fathan Ali S.Kom Thank You! Dudy Fathan Ali S.Kom [email protected]