90 likes | 231 Views
Physical Structure(entities). SNU IDB Lab. Contents. Concepts Figures of Document Entity Defining an entity Grammar in Declaring Entity Examples of EntityDeclaration URL format. Concepts. XML specification Include a facility for physically isolating and storing any part of a document
E N D
Physical Structure(entities) SNU IDB Lab.
Contents Concepts Figures of Document Entity Defining an entity Grammar in Declaring Entity Examples of EntityDeclaration URL format
Concepts • XML specification • Include a facility for physically isolating and storing any part of a document • Each unit of information is called an entity • Document entity • the data file considered to represent the entire document • referred to the name of the file containing it
Figures of Document Entity document entity (no entities) document entity (main content) document entity (framework file) A A B C D
Defining an entity • Entity must be defined before the first reference to them in the data stream • Declared in the DTD(Document Type Definition) • Using an entity declaration(GEDecl or PEDecl) • <Example> • <!DOCTYPE MyBook [ • <!ENTITY …..> ]>
Grammar in Declaring Entity GEDecl : EntityDecl PEDecl : GEDecl <!ENTITY> S Name S EntityDef > S : PEDecl <!ENTITY> S % S Name S PEDef > S : EntityValue EntityDef ExternalID NDataDecl EntityValue : PEDefl ExternalID
Examples of EntityDeclaration &li; > & ' " for ‘<‘ for ‘>’ for ‘&’ for ‘ ’ ’ for ‘ ” ’; • Internal text entities • <!ENTITY XML “eXtensible Markup Language”> • <!ENTITY DemoEntity ‘The rule is 6” long.’> • Built-in entities • <!ENTITY sample “Use " and ‘as delimiters.”>
Examples of EntityDeclaration(2) • Parameter entities • <!ENTITY %AnEntity “(Parma|list)”> • External text entities • <!ENTITY myent SYSTEM “/EMTS/MYENT.XML”> • <!ENTITY myent PUBLIC “-//MyCorp//ENTITY Syperscript Chars//EN”….> • Binary entities • <!ENTITY Jsphoto SYSTEM “/ENTS/Jsphoto.tif” NDATA “TIFF”>
<!ENTITY ent9 SYSTEM “../entities/entity9.xml”> /xml/docs/document.xml/ entities/entity9.xml xml xml entity9.xml document.xml entity9.xml document.xml entities docs entities URL format <!ENTITY ent9 SYSTEM “entities/entity9.xml”>/xml/document.xml/entities/entity9.xml