Example: Simple DTD Creation

Previous Next

Here is an example of a simple DTD creation:

INVOKE     XML.CreateDTD

WITH

SELECT    id, family_name, first_name

FROM    PERSON

You do not have to specify a condition to make sure you retrieve only one record. This results in:

<!ELEMENT PERSON ((Person|QUERY)*)>

<!ELEMENT Person ((INSERT|UPDATE|DELETE)?)>

<!ELEMENT INSERT (EMPTY)>

<!ELEMENT UPDATE (EMPTY)>

<!ELEMENT DELETE (EMPTY)>

<!ELEMENT QUERY (EMPTY)>

<!ATTLIST QUERY PERSON_ID CDATA #IMPLIED>

<!ATTLIST UPDATE PERSON_ID CDATA #IMPLIED>

<!ATTLIST Person PERSON_ID CDATA #REQUIRED>

<!ATTLIST QUERY FAMILY_NAME CDATA #IMPLIED>

<!ATTLIST UPDATE FAMILY_NAME CDATA #IMPLIED>

<!ATTLIST Person FAMILY_NAME CDATA #REQUIRED>

<!ATTLIST QUERY FIRST_NAME CDATA #IMPLIED>

<!ATTLIST UPDATE FIRST_NAME CDATA #IMPLIED>

<!ATTLIST Person FIRST_NAME CDATA #REQUIRED>