Connecting Tech Pros Worldwide Forums | Help | Site Map

required elements in a DTD

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#1: Dec 3 '08
Hi,

I want to define that of a group of elements at least one is required. my current method was working in PHP 4 but now I've got a problem with PHP 5 DOMDocument::validate().
DTD snippet
Expand|Select|Wrap|Line Numbers
  1. <!ELEMENT datei         (file | (file?, xsl, xml?, par?))>
(<datei> may have up to 4 child elements of what either <file> or <xsl> must be present)

in PHP 5 I get the warning:
Expand|Select|Wrap|Line Numbers
  1. Warning: DOMDocument::load() [domdocument.load]: 
  2. Content model of datei is not determinist: (file | (file? , xsl , xml? , par?)) 
  3. in /Users/Alexander/Sites/kbl5/system/xml/main.struktur.xml, line: 18 
  4. in /Users/Alexander/Sites/kbl5/test.php on line 3
is there any way I can define this DTD part differently?

thanks

PS: file codes see http://bytes.com/answers/xml/857093-...validating-dtd



codegecko's Avatar
Moderator
 
Join Date: May 2007
Location: United Kingdom
Posts: 395
#2: Dec 3 '08

re: required elements in a DTD


Moved to PHP as this is not an HTML question.

codegecko
Moderator in ASP, HTML/CSS
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#3: Dec 3 '08

re: required elements in a DTD


I know that the base problem lies within PHP, but I thought I could get help on the DTD matter in the HTML forum. maybe I didn't make that clear enough.

Dormi
Reply