
Hello, i have created a XML format for a VR application and i have a problem to make the DTD of this format. I have checked the forum and seen that we have to change xsd:NCName to text, but i have another error: this is a part of the format which produces the error: <Vertices> 3 float 3 float <!-- ...3 float--> <Vertex> 3 float <Data Name="string" Constant="float" Vector="3 float"/> <!-- ...Data--> </Vertex> </Vertices> this is the RNC after the conversion: default namespace = "" start = element Vertices { (text | element Vertex { (text | element Data { attribute Constant { text }, attribute Name { text }, attribute Vector { text } })+ })+ } When i want to convert it to DTD : error: 12.25 sorry, cannot handle this kind of "oneOrMore" But actually i don't want (text or Vertex) in my element Vertices so i change to : default namespace = "" start = element Vertices { text, element Vertex { text, element Data { attribute Constant { text }, attribute Name { text }, attribute Vector { text } } } } and now i get this error : 7.17: cannot handle this kinf of group. Any idea ? because the format is valid and well-formed Thank you Xavier

Hi Xavier, The only way you mixed content can be specified in a DTD is like: <!ELEMENT element (#PCDATA|child1|child2|child3)*> In words that will be zero or more #text or child1 or child2 or child3 (and so on).
default namespace = ""
start = element Vertices { (text | element Vertex { (text | element Data { attribute Constant { text }, attribute Name { text }, attribute Vector { text } })+ })+ }
The problem with this is that the model is one or more instead of zero or more. If you change the + to * then the conversion should work.
default namespace = ""
start = element Vertices { text, element Vertex { text, element Data { attribute Constant { text }, attribute Name { text }, attribute Vector { text } } } }
In this case you have a sequence model, a text node followed by an element in both cases. This is not supported by DTDs, so changing , (group) to | (choice) will make the conversion work. default namespace = "" start = element Vertices { text | element Vertex { text | element Data { attribute Constant { text }, attribute Name { text }, attribute Vector { text } } } } will give you: <?xml encoding="UTF-8"?> <!ELEMENT Vertices (#PCDATA|Vertex)*> <!ATTLIST Vertices xmlns CDATA #FIXED ''> <!ELEMENT Vertex (#PCDATA|Data)*> <!ATTLIST Vertex xmlns CDATA #FIXED ''> <!ELEMENT Data EMPTY> <!ATTLIST Data xmlns CDATA #FIXED '' Constant CDATA #REQUIRED Name CDATA #REQUIRED Vector CDATA #REQUIRED> Best Regards, George ------------------------------------------------------------- George Cristian Bina mailto:george@oxygenxml.com <oXygen/> XML Editor - http://www.oxygenxml.com/
participants (2)
-
George Cristian Bina
-
LARRODE Xavier (DR&T)