J
JU
Hello,
I am pretty new in XML and I'm studying the DTD definition. I cannot
solve a problem, or better, I cannot define what I want in my DTD file.
What I would like to do is that something like
<el>text <child/> text</el>
is accepted but not
<el>text <child/> text<child/></el>
I know that <!ELEMENT el (#PCDATA|child)*> declares the element el as a
mixed content of PCDATA and child but what I want to define is that the
element child occurs exactly once and not more. Instead of PCDATA can
occur either before, after or never. I tried with
(#PCDATA,child+,#PCDATA) but it's not working. Do you know if what I
want is possible? Thanks a lot in advance, and sorry if it's a silly
question. bye!
I am pretty new in XML and I'm studying the DTD definition. I cannot
solve a problem, or better, I cannot define what I want in my DTD file.
What I would like to do is that something like
<el>text <child/> text</el>
is accepted but not
<el>text <child/> text<child/></el>
I know that <!ELEMENT el (#PCDATA|child)*> declares the element el as a
mixed content of PCDATA and child but what I want to define is that the
element child occurs exactly once and not more. Instead of PCDATA can
occur either before, after or never. I tried with
(#PCDATA,child+,#PCDATA) but it's not working. Do you know if what I
want is possible? Thanks a lot in advance, and sorry if it's a silly
question. bye!