SlideShare une entreprise Scribd logo
1  sur  11
Document Type Definitions – Elements & Attributes XML
How many times can an element occur? How many times must an element occur? Cardinality
A student must have a first name A student may or may not have a last name A student may have one or more majors, or none (undeclared) 	<!ELEMENT student (first, last?, major*)> Note: Cardinality indicator doesn’t affect the element declaration (i.e. major) Cardinality: Example
Elements tend to be used to describe a logical unit of information Attributes are typically used to store data about characteristics (properties) May have a Movie element with attributes for Title, Rental Price, Rental Days No specific rules about how to use elements and attributes Attributes and DTD’s
Attributes allow more limits on data Can have a list of acceptable values Can have a default value Some ability to specify a data type Concise, about a single name/value pair Attributes have limits Can’t store long strings of text Can’t nest values Whitespace can’t be ignored Attributes and Elements
Declaration: <!ATTLISTElementNameAttrNameAttrType Default> Specify the Element the attribute belongs to Specify the Name of the attribute Specify the Type of data the attribute stores Specify characteristics of the values (Default or attribute value) List either the default value or other characteristic of value – required, optional Specifying Attributes
CDATA – unparsed character data Enumerated – series/list of string values Entity/Entities – reference entity definition(s) ID – unique identifier for the element IDREF – refer to the ID of another element IDREFS – list of ID’s of other elements separated by whitespace NMTOKEN/NMTOKENS – value(s) of attribute can be anything that follows rules for XML name Sample Attribute Data Types
Specifies that attribute value must be found in a particular list Each value in list must be valid XML name Limits on spaces, characters Use | (pipe) to separate members of list If specifying list letter grades for a student: <!ATTLIST student grade (A | B | C | D | F | V | W | I) #IMPLIED> Enumerated Attributes Element Attribute Enumerated List
An ID specifies that the element must have a unique value within the document Allows reliable way to refer to a specific element No spaces allowed in value Typically replace space with underscore Attribute list can include only one ID IDREF, IDREFS allows an element to be associated with another or multiple other elements A student element must have a student ID: <!ATTLIST student studentID ID #REQUIRED> ID, IDREF, IDREFS
Attributes can refer to entities “Entity” refers to substituting a reference for a text value &amp; refers to the & character Unparsed Entity is a reference that isn’t parsed Can reuse references for long values, or hard to manage characters (i.e. tab, line feed) Entity must be declared in the DTD <!ENTITY classTitle “XML”> When classTitle found in document, replaced with XML Entities and Attributes
Can specify how the value will appear in the document Must always specify a value declaration DEFAULT sets a value for an attribute if a value isn’t provided Include default value in double quotes FIXED sets a value that must occur; if an attribute has a different value, a validation error occurs REQUIRED specifies that the attribute (and value) must exist IMPLIED means the attribute is optional Attribute Value Declarations

Contenu connexe

Tendances

Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
Slideshare
 

Tendances (20)

Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
C Language presentation
C Language presentationC Language presentation
C Language presentation
 
Entity relationship diagram for dummies
Entity relationship diagram for dummiesEntity relationship diagram for dummies
Entity relationship diagram for dummies
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
Er diagram
Er diagramEr diagram
Er diagram
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
Erd
ErdErd
Erd
 
E R Diagram
E R DiagramE R Diagram
E R Diagram
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
E r diagram
E r diagramE r diagram
E r diagram
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Entity relationship diagram (erd)
Entity relationship  diagram (erd)Entity relationship  diagram (erd)
Entity relationship diagram (erd)
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
XML Bible
XML BibleXML Bible
XML Bible
 

En vedette (7)

Character Analysis ryan
Character Analysis ryanCharacter Analysis ryan
Character Analysis ryan
 
Sept 27
Sept 27Sept 27
Sept 27
 
DPA Conference - Innternational Reform Drug Policy Conference, LA, USA 2011
DPA Conference - Innternational Reform Drug Policy Conference, LA, USA 2011DPA Conference - Innternational Reform Drug Policy Conference, LA, USA 2011
DPA Conference - Innternational Reform Drug Policy Conference, LA, USA 2011
 
Students' feedback on Access Summit 2013
Students' feedback on Access Summit 2013Students' feedback on Access Summit 2013
Students' feedback on Access Summit 2013
 
2013 jul aug
2013 jul aug2013 jul aug
2013 jul aug
 
Social Media 101
Social Media 101Social Media 101
Social Media 101
 
A marketing for amateurs - home design
A marketing for amateurs -  home designA marketing for amateurs -  home design
A marketing for amateurs - home design
 

Similaire à Document type definitions part 2

Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definition
yht4ever
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
koolkampus
 
2 dtd - validating xml documents
2   dtd - validating xml documents2   dtd - validating xml documents
2 dtd - validating xml documents
gauravashq
 
Jungahan web presentation
Jungahan web presentationJungahan web presentation
Jungahan web presentation
garden8an
 
Module 2 dbms.pptx
Module 2 dbms.pptxModule 2 dbms.pptx
Module 2 dbms.pptx
VijishK
 
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
phanleson
 

Similaire à Document type definitions part 2 (20)

Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definition
 
Unit 2-Data Modeling.pdf
Unit 2-Data Modeling.pdfUnit 2-Data Modeling.pdf
Unit 2-Data Modeling.pdf
 
Well Formed XML
Well Formed XMLWell Formed XML
Well Formed XML
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
2 dtd - validating xml documents
2   dtd - validating xml documents2   dtd - validating xml documents
2 dtd - validating xml documents
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
 
DTD
DTDDTD
DTD
 
Xml and Co.
Xml and Co.Xml and Co.
Xml and Co.
 
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptxdata base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
 
Web Technologies Unit 2 Print.pdf
Web Technologies Unit 2 Print.pdfWeb Technologies Unit 2 Print.pdf
Web Technologies Unit 2 Print.pdf
 
Jungahan web presentation
Jungahan web presentationJungahan web presentation
Jungahan web presentation
 
2-DTD.ppt
2-DTD.ppt2-DTD.ppt
2-DTD.ppt
 
Xml
XmlXml
Xml
 
Module 2 dbms.pptx
Module 2 dbms.pptxModule 2 dbms.pptx
Module 2 dbms.pptx
 
Encoded Archival Description (EAD)
Encoded Archival Description (EAD) Encoded Archival Description (EAD)
Encoded Archival Description (EAD)
 
Archivists' Toolkit Training-Resources, Digital Objects, and Reports
Archivists' Toolkit Training-Resources, Digital Objects, and ReportsArchivists' Toolkit Training-Resources, Digital Objects, and Reports
Archivists' Toolkit Training-Resources, Digital Objects, and Reports
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
DBMS CS 4-5
 
MDST 3703 F10 Studio 4
MDST 3703 F10 Studio 4MDST 3703 F10 Studio 4
MDST 3703 F10 Studio 4
 
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
 

Plus de Randy Riness @ South Puget Sound Community College

Plus de Randy Riness @ South Puget Sound Community College (20)

Stored procedures
Stored proceduresStored procedures
Stored procedures
 
3 sql overview
3 sql overview3 sql overview
3 sql overview
 
Normalization
NormalizationNormalization
Normalization
 
CIS160 final review
CIS160 final reviewCIS160 final review
CIS160 final review
 
SQL Constraints
SQL ConstraintsSQL Constraints
SQL Constraints
 
CIS 245 Final Review
CIS 245 Final ReviewCIS 245 Final Review
CIS 245 Final Review
 
CIS145 Final Review
CIS145 Final ReviewCIS145 Final Review
CIS145 Final Review
 
Cis166 Final Review C#
Cis166 Final Review C#Cis166 Final Review C#
Cis166 Final Review C#
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
CIS245 sql
CIS245 sqlCIS245 sql
CIS245 sql
 
Cis245 Midterm Review
Cis245 Midterm ReviewCis245 Midterm Review
Cis245 Midterm Review
 
CSS
CSSCSS
CSS
 
XPath
XPathXPath
XPath
 
XSLT Overview
XSLT OverviewXSLT Overview
XSLT Overview
 
Views
ViewsViews
Views
 
CIS282 Midterm review
CIS282 Midterm reviewCIS282 Midterm review
CIS282 Midterm review
 
Schemas 2 - Restricting Values
Schemas 2 - Restricting ValuesSchemas 2 - Restricting Values
Schemas 2 - Restricting Values
 
CIS 145 test 1 review
CIS 145 test 1 reviewCIS 145 test 1 review
CIS 145 test 1 review
 
XML schemas
XML schemasXML schemas
XML schemas
 
DOM specifics
DOM specificsDOM specifics
DOM specifics
 

Dernier

Dernier (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Document type definitions part 2

  • 1. Document Type Definitions – Elements & Attributes XML
  • 2. How many times can an element occur? How many times must an element occur? Cardinality
  • 3. A student must have a first name A student may or may not have a last name A student may have one or more majors, or none (undeclared) <!ELEMENT student (first, last?, major*)> Note: Cardinality indicator doesn’t affect the element declaration (i.e. major) Cardinality: Example
  • 4. Elements tend to be used to describe a logical unit of information Attributes are typically used to store data about characteristics (properties) May have a Movie element with attributes for Title, Rental Price, Rental Days No specific rules about how to use elements and attributes Attributes and DTD’s
  • 5. Attributes allow more limits on data Can have a list of acceptable values Can have a default value Some ability to specify a data type Concise, about a single name/value pair Attributes have limits Can’t store long strings of text Can’t nest values Whitespace can’t be ignored Attributes and Elements
  • 6. Declaration: <!ATTLISTElementNameAttrNameAttrType Default> Specify the Element the attribute belongs to Specify the Name of the attribute Specify the Type of data the attribute stores Specify characteristics of the values (Default or attribute value) List either the default value or other characteristic of value – required, optional Specifying Attributes
  • 7. CDATA – unparsed character data Enumerated – series/list of string values Entity/Entities – reference entity definition(s) ID – unique identifier for the element IDREF – refer to the ID of another element IDREFS – list of ID’s of other elements separated by whitespace NMTOKEN/NMTOKENS – value(s) of attribute can be anything that follows rules for XML name Sample Attribute Data Types
  • 8. Specifies that attribute value must be found in a particular list Each value in list must be valid XML name Limits on spaces, characters Use | (pipe) to separate members of list If specifying list letter grades for a student: <!ATTLIST student grade (A | B | C | D | F | V | W | I) #IMPLIED> Enumerated Attributes Element Attribute Enumerated List
  • 9. An ID specifies that the element must have a unique value within the document Allows reliable way to refer to a specific element No spaces allowed in value Typically replace space with underscore Attribute list can include only one ID IDREF, IDREFS allows an element to be associated with another or multiple other elements A student element must have a student ID: <!ATTLIST student studentID ID #REQUIRED> ID, IDREF, IDREFS
  • 10. Attributes can refer to entities “Entity” refers to substituting a reference for a text value &amp; refers to the & character Unparsed Entity is a reference that isn’t parsed Can reuse references for long values, or hard to manage characters (i.e. tab, line feed) Entity must be declared in the DTD <!ENTITY classTitle “XML”> When classTitle found in document, replaced with XML Entities and Attributes
  • 11. Can specify how the value will appear in the document Must always specify a value declaration DEFAULT sets a value for an attribute if a value isn’t provided Include default value in double quotes FIXED sets a value that must occur; if an attribute has a different value, a validation error occurs REQUIRED specifies that the attribute (and value) must exist IMPLIED means the attribute is optional Attribute Value Declarations