DTD ?? - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

DTD ??

Description:

Title: DTD Author: Chen-hsiu Huang Last modified by: Chen-hsiu Huang Created Date: 2/7/2001 8:33:32 AM Document presentation format: – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 24
Provided by: Chenh151
Category:
Tags: dtd | adpcm

less

Transcript and Presenter's Notes

Title: DTD ??


1
DTD ??
  • ????????????????,?????????????????????????
    PowerPoint ?????????
  • ??????????????
  • ?????????
  • ???????? ??
  • ???????????
  • ??????????????
  • ??????????PowerPoint??????????????????????????
    ????????
  • XML Lab.
  • ???

2
?? DTD ?
  • ??????
  • Document Type Definition
  • ??????????
  • ?XML???????
  • DTD?????????
  • ??????????????
  • ?????????????????
  • Valid XML???????DTD??

3
DTD ??
  • ??DTD??
  • ??????,????????DTD
  • ??DTD??
  • ?????PROLOG????
  • ????????????
  • ??????????
  • ????(override)???????

4
DTD ??
  • XML spec??Backus Naur Form (BNF)??, ??????
  • XMLDecl 'lt?xml' VersionInfo EncodingDecl?
    SDDecl? S? '?gt'
  • SDDecl S 'standalone' Eq (("'" ('yes'
    'no') "'") ('"' ('yes' 'no') '"'))
  • doctypedecl lt!DOCTYPE S Name (S
    ExternalID)? S? ( (markupdecl PEReference
    S) S?)? gt
  • ExternalID 'SYSTEM' S SystemLiteral
    'PUBLIC' S PubidLiteral S SystemLiteral

5
?? DTD (1)
  • lt?xml version1.0?gt
  • lt!DOCTYPE EMAIL
  • lt!ELEMENT EMAIL (TO, FROM, CC, SUBJECT, BODY)gt
  • lt!ELEMENT TO (PCDATA)gt
  • lt!ELEMENT FROM (PCDATA)gt
  • lt!ELEMENT CC (PCDATA)gt
  • lt!ELEMENT SUBJECT (PCDATA)gt
  • lt!ELEMENT BODY (PCDATA)gt
  • gt
  • ltEMAILgt
  • ltTOgtchenhsiu_at_gens.dhs.orglt/TOgt
  • ltFROMgtb87506017_at_csie.ntu.edu.twlt/FROMgt
  • ltCCgtemacs_at_ms38.url.com.twlt/CCgt
  • ltSUBJECTgtHello XMLlt/SUBJECTgt
  • ltBODYgtblah, blahlt/BODYgt
  • lt/EMAILgt

6
?? DTD (2)
  • ?IE???XML??

7
?? DTD (3)
  • ???????,XML parser??DTD?????????(valid)
  • ???elements???doctypedecl??? ??
  • ??????????
  • ????????????, ???(override)?????????

8
?? DTD (1)
  • lt!DOCTYPE EMAIL (SYSTEMPUCLIB) email.dtdgt
  • ????
  • SYSTEM???URI??,??????????????????????
  • ?????????,??DTD????????????,?????PUCLIB???,???????
    ???????
  • ???????????????????,???????????

9
?? DTD (2)
  • ????DTD???
  • example.xmllt?xml version1.0 encodingBIG5
    standaloneyes?gtlt!DOCTYPE EMAIL SYSTEM
    email.dtdgt....
  • email.dtdlt?xml version1.0 encodingISO-8859-1
    ?gtlt!ELEMENT EMAIL (TO, FROM, CC, SUBJECT,
    BODY)gt
  • lt!ELEMENT TO (PCDATA)gt
  • lt!ELEMENT FROM (PCDATA)gt
  • lt!ELEMENT CC (PCDATA)gt
  • lt!ELEMENT SUBJECT (PCDATA)gt
  • lt!ELEMENT BODY (PCDATA)gt

10
????
  • Grammar
  • elementdecl 'lt!ELEMENT' S Name S contentspec
    S? 'gt
  • contentspec 'EMPTY' 'ANY' Mixed
    children
  • Mixed '(' S? 'PCDATA' (S? '' S? Name) S?
    ')' '(' S? 'PCDATA' S? ')
  • children (choice seq) ('?' '' '')?

11
??????(1)
  • EMPTY
  • ???????????????ex ltBR/gt
  • ANY
  • ?????DTD?????????????
  • ???(Mixed)
  • ???????????,? ??, ex lt!ELEMENT EXAMPLE
    (PCDATAxyz)gt

12
??????(2)
  • PCDATA ????????,????,??XML parser?????
  • CDATA?????????,?????,????????????, ex
  • lt!CDATAltTESTgtLaLaLalt/TESTgtgt

13
??????(3)
  • ????

() ?????? (A,B)
, ?????? (A,B,C)
?(???) (AB)
? ?????? (A?,B)
????? (A,B)
????? (A,B,C)
14
????
  • Grammar
  • AttlistDecl 'lt!ATTLIST' S Name AttDef S?
    'gt'
  • AttDef S Name S AttType S DefaultDecl
  • AttType StringType TokenizedType
    EnumeratedType
  • TokenizedType 'ID' 'IDREF' 'IDREFS'
    'ENTITY' 'ENTITIES' 'NMTOKEN' 'NMTOKENS'
  • DefaultDecl 'REQUIRED' 'IMPLIED'
    (('FIXED' S)? AttValue)

15
????
  • ??????????????????,?? ltfont colorredgtTESTlt/fo
    ntgt??????TEST?????
  • ???????????,?????????????
  • ????????DTD?????,???????????????,????????

16
??(?)
  • ...
  • lt!ELEMENT EMAIL (TO, FROM, CC, BCC, SUBJECT,
    BODY)gt
  • lt!ATTLIST EMAIL LANGUAGE (WesternGreekChinese)
    ChineseENCRYPTED CDATA IMPLIEDPRIORITY
    (NORMALLOWHIGH) NORMALgt
  • ...
  • lt!ELEMENT BCC (PCDATA)gt
  • lt!ATTLIST BCC HIDDEN CDATA FIXED TRUEgt
  • ...

17
????
  • lt!ENTITY EntityName EntityDefinitiongt
  • ?????DTD????,??????????
  • ?? lt!ENTITY SIGNATURE ChenHsiugt
    ??SIGNATURE??????DTD?,????????????????,??????????
    ChenHsiu
  • ltBODYgt
  • Hello, This is SIGNATURE!
  • lt/BODYgt

18
????
  • lt!ENTITY HIDDEN CDATA FIXED TRUEgt
  • ???????????,????????????
  • ?????DTD????,???DTD??????
  • ?????????DTD??????????
  • lt!ATTLIST BCC HIDDEN HIDDENgt

19
INCLUDE IGNORE
  • lt!IGNOREDTD sectiongt
  • lt!INCLUDEDTD sectiongt
  • IGNORE??INCLUDE??????????DTD??????????
  • ???????????????,??????????
  • lt!IGNORElt!ELEMENT BCC(PCDATA)gt
  • lt!ATTLIST BCC HIDDEN CDATA
  • FIXED TRUEgtgt
  • lt!INCLUDElt!ELEMENT SUBJECT (PCDATA)gtgt

20
INCLUDE IGNORE
  • lt!IGNOREDTD sectiongt
  • lt!INCLUDEDTD sectiongt
  • IGNORE??INCLUDE??????????DTD??????????
  • ???????????????,??????????
  • lt!IGNORElt!ELEMENT BCC(PCDATA)gt
  • lt!ATTLIST BCC HIDDEN CDATA
  • FIXED TRUEgtgt
  • lt!INCLUDElt!ELEMENT SUBJECT (PCDATA)gtgt

21
????
  • ????(PI)??????????????????
  • PI?????????????,????????XML???????
  • lt?AVI CODECVIEDO1 COLORS256?gt
  • lt?WAV COMPRESSORADPCM RESOLUTION16?gt

22
???????
  • ??????(well-formed)????????DTD
  • ??????????,???????????. parser?????????DTD,???????
    ????DTD
  • ???XML??????????,????RMD
  • NONE????DTD
  • INTERNAL?????DTD
  • ALL?????????????DTD

23
??
  • XML???????????????????,?DTD?????????????
  • ??????
  • ????????
  • ??????
  • ??????
Write a Comment
User Comments (0)
About PowerShow.com