SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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

La actualidad más candente (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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Más de Randy Riness @ South Puget Sound Community College

Más 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
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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 Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

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