1 / 14

XML Validation II Advanced DTDs

XML Validation II Advanced DTDs. Robin Burke ECT 360. Outline. Parameter entities Parameterized DTDs Modularized DTDs Break Namespaces XML Schemas Elements Attributes. Entities. Internal general entities macros External general entities "include" mechanism Parameter entities

ccosper
Download Presentation

XML Validation II Advanced DTDs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML Validation IIAdvanced DTDs Robin Burke ECT 360

  2. Outline • Parameter entities • Parameterized DTDs • Modularized DTDs • Break • Namespaces • XML Schemas • Elements • Attributes

  3. Entities • Internal general entities • macros • External general entities • "include" mechanism • Parameter entities • for DTD organization

  4. Internal general entities • Declaration <!ENTITY disclaimer "This is a work of fiction. Any resemblance to persons living or dead is unintentional."> • Use &disclaimer;

  5. External general entities • Declaration <!ENTITY standardContract SYSTEM "stdContract.xml"> • Use <comment>... transaction subject to the following contract terms: &standardContract;</comment>

  6. General entities • Process model • The entity string is replaced by the contents • And then parsed by the XML parser • Resulting document tree • same as if the text were part of the original document

  7. Parameter entities • Similar macro function • Inside the DTD • Uses • Organizing common element / attribute models • Documenting data types • Simulating namespaces • Making DTDs modular

  8. Conditional sections • To control the inclusion of DTD sections • This will be processed • <![INCLUDE[ ... ]]> • This will be omitted • <!IGNORE[ .. ]]> • Doesn't seem that useful BUT • combined with entities • we can modularize our DTD

  9. Modular DTD • Same DTD can be used for multiple document types • A few parameters are redefined and the DTD is different

  10. Example

  11. Parameter entities • Powerful facility for DTD organization and application • Real-world applications • parameterize DTDs • use modular DTDs

  12. Example • DTDs • Document • Problem • how to import the namespaces?

  13. Solution • Fully-qualified names everywhere • yuk! • Parameterized DTD • with namespace defined in an entity

  14. Next week • Document Engineering • on-line reading • Quiz #1 • DTDs

More Related