[oXygen-user] DTD generation in Oxygen 3.0
George Cristian Bina
Tue Jan 20 02:12:10 CST 2004
Dear Annick Fron,
We are using TRANG behind the convert to action. The workaround for this is
to convert from XML to RNC, edit the RNC to replace datatypes with text and
then convert to DTD:
Step 1. Convert to RNC:
default namespace = ""
start =
element CATALOG {
element CD {
element TITLE { text },
element ARTIST { text },
element COUNTRY { xsd:NCName },
element COMPANY { text },
element PRICE { xsd:decimal },
element YEAR { xsd:integer }
}+
}
Spep 2. Replace xsd:decimal, xsd:integer and xsd:NCName with text:
default namespace = ""
start =
element CATALOG {
element CD {
element TITLE { text },
element ARTIST { text },
element COUNTRY { text },
element COMPANY { text },
element PRICE {text },
element YEAR { text }
}+
}
Step 3. Convert to DTD:
<?xml encoding="UTF-8"?>
<!ELEMENT CATALOG (CD)+>
<!ATTLIST CATALOG
xmlns CDATA #FIXED ''>
<!ELEMENT CD (TITLE,ARTIST,COUNTRY,COMPANY,PRICE,YEAR)>
<!ATTLIST CD
xmlns CDATA #FIXED ''>
<!ELEMENT TITLE (#PCDATA)>
<!ATTLIST TITLE
xmlns CDATA #FIXED ''>
<!ELEMENT ARTIST (#PCDATA)>
<!ATTLIST ARTIST
xmlns CDATA #FIXED ''>
<!ELEMENT COUNTRY (#PCDATA)>
<!ATTLIST COUNTRY
xmlns CDATA #FIXED ''>
<!ELEMENT COMPANY (#PCDATA)>
<!ATTLIST COMPANY
xmlns CDATA #FIXED ''>
<!ELEMENT PRICE (#PCDATA)>
<!ATTLIST PRICE
xmlns CDATA #FIXED ''>
<!ELEMENT YEAR (#PCDATA)>
<!ATTLIST YEAR
xmlns CDATA #FIXED ''>
We had in 2.0.4 an action called "Learn and save document structure" that
generated a very lax DTD from an XML document. It was removed because that
functionality was somehow overlaping with the Convert to and Associate
schema actions but I guess it will be good to reintroduce it in oXygen 3.1.
Best Regards,
George
-------------------------------------------------------------
George Cristian Bina mailto:
<oXygen/> XML Editor - http://www.oxygenxml.com/
----- Original Message -----
From: "Annick FRON" <>
To: <>
Sent: Monday, January 19, 2004 5:33 PM
Subject: [oXygen-user] DTD generation in Oxygen 3.0
> I have tried to generate DTD and Schema for the Cdcatalog example from
> w3schools (http://www.w3schools.com).
> I got the schema OK, but a Sax -1 exception for the DTD.
>
> "Approximating datatype content by #PCDATA"
>
> Annick Fron
> http://www.essi.fr/~fron
>
> _______________________________________________
> oXygen-user mailing list
>
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>
More information about the oXygen-user
mailing list