Docsity

XML Namespaces and DTD in Docsity.com, Slides of Fundamentals of E-Commerce

Toggle sidebar
bg1
TV Schedule DTD
By David Moisan. Copied from his Web: http://www.davidmoisan.org/
<!DOCTYPE TVSCHEDULE [
<!ELEMENT TVSCHEDULE (CHANNEL+)>
<!ELEMENT CHANNEL (BANNER,DAY+)>
<!ELEMENT BANNER (#PCDATA)>
<!ELEMENT DAY (DATE,(HOLIDAY|PROGRAMSLOT+)+)>
<!ELEMENT HOLIDAY (#PCDATA)>
<!ELEMENT DATE (#PCDATA)>
<!ELEMENT PROGRAMSLOT (TIME,TITLE,DESCRIPTION?)>
<!ELEMENT TIME (#PCDATA)>
<!ELEMENT TITLE (#PCDATA)><
<!ELEMENT DESCRIPTION (#PCDATA)>
<!ATTLIST TVSCHEDULE NAME CDATA #REQUIRED>
<!ATTLIST CHANNEL CHAN CDATA #REQUIRED>
<!ATTLIST PROGRAMSLOT VTR CDATA #IMPLIED>
<!ATTLIST TITLE RATING CDATA #IMPLIED>
<!ATTLIST TITLE LANGUAGE CDATA #IMPLIED> ]>
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download XML Namespaces and DTD in Docsity.com and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

TV Schedule DTD

By David Moisan. Copied from his Web: http://www.davidmoisan.org/

<!DOCTYPE TVSCHEDULE [

]>

Docsity.com

DTD – Summary

DTD

XML

• XML file is valid if file is conform with DTD

• This can be tested by so called: Validating XML Parser

• For most applications it is useful to test if an XML input file is valid

according the expected format/interpretation.

Validating XML Parser

Application

Docsity.com

Namespaces in XML

Docsity.com

Namespaces

• To help identify origin or meaning of an element or

attribute

• To allow two sets of elements to be combined even

if there are duplicate element names

Example:

<data xmlns:fruit="http://www.thirdm.com/fruit"

xmlns:corp="http://www.thirdm.com/corporations">

<fruit: apple qty="5" type="Granny Smith"/>

<corp: apple stockticker="AAPL" exchange="NASDAQ"/>

Docsity.com

SS

Another example …

**2.0** **urn:oasis:names:specification:ubl:xpath:Order-2.0:sbs-1.0- draft** **bpid:urn:oasis:names:draft:bpss:ubl-2-sbs-order-with-simple-response- draft** **AEG012345** **CON0095678** **false** …

IE

Docsity.com

SS

Default Namespace

• Used to identify the namespace for

elements without a prefix

Example:

<rdf:RDF

xmlns:rdf = ”http://www.w3.org/1999/02/22-rdf-syntax-ns#”

xmlns = ”http://www.w3.org/2000/01/rdf-schema#”>

</rdf:RDF>

Docsity.com

XML Schema

Docsity.com

Schema Root Element

and

targetNamespace

<xsd:schema

xmlns:xsd=“http://www.w3.org/2001/XMLSchema“

targetNamespace=“http://www.dbis.de“>

</xsd:schema>

Docsity.com