AutoYaST: Automatic Linux Installation and Configuration with YaST2 | ||
---|---|---|
<<< Previous | Chapter 2. The Control File | Next >>> |
The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. A DTD can be declared inline in the XML document, or as an external reference.
XML provides an application independent way of sharing data. With a DTD, the application can use a standard DTD to verify that data that the user supplies is valid. A "Valid" XML document is a "Well Formed" XML document which conforms to the rules of a Document Type Definition (DTD).
In AutoYaST, a DTD should is available to allow users to validate the control files before the installation process is initiated. The DTD can be also used with XML editors while editing the control file to avoid later errors.
A drive resource containing a device property and a partitions property represented as a nested resource.
A partitions resource containing multiple instances of the partition property represented as a nested resource.
A partition resource containing a size property and a mount property.
Below is the XML for an example node view profile for the above tree which includes a DTD which validates it.
Example 2-5. Example DTD
<?xml version="1.0"?> <!DOCTYPE profile [ <!ELEMENT profile (install)> <!ELEMENT install (partitioning)> <!ELEMENT partitioning (drive+)> <!ELEMENT drive (device,partitions)> <!ELEMENT device (#PCDATA)> <!ELEMENT partitions (partition*)> <!ELEMENT partition (size,mount)> <!ELEMENT size (#PCDATA)> <!ELEMENT mount (#PCDATA)> ]> <profile> ..... <install> <partitioning config:type="list"> <drive> <device> /dev/hda </device> <partitions> <partition> <size>1000mb</size> <mount>/</mount> </partition> <partition> <size>250mb</size> <mount>/tmp</mount> </partition> </partitions> </drive> </partitioning> </install> ..... </profile> |
<<< Previous | Home | Next >>> |
Structure | Up | Creating A Control File |