.isDTDpresent()
Table of contents
- 1. Description of the method
- 2.
- 3. Example
Description of the method
Description: | .isDTDPresent() method returns true if a DTD is presented and false otherwise. |
Available for: | root element |
Parameters: | - |
Return type: | boolean |
Example
Context: | Message |
OCL: | self.isDTDPresent() |
Description: | The example rule checks if a DTD is given. |
The XML snippet below would pass this check.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE people_list SYSTEM "example.dtd"> <Message xmlns="http://www.XMLdation.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http::xmldation.com extensions.xsd "> <Header> |
The other snippet below however would not pass this check.
<?xml version="1.0" encoding="UTF-8"?> <Message xmlns="http://www.XMLdation.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Header> |