I have started a job where I was given some XML files and a DTD. They work fine but I noticed in the DTD they were reusing an element like this.

DTD:

```
<!ELEMENT image EMPTY>
    <!ATTLIST image 
        source CDATA #REQUIRED
        signature (true|false|1|0) "false" 
    >

```

and in the xml the image element appears in two place but only one of the places requires the 'signature' attribute, in the other case it is irrelevant.

XML:

```
<root>
  <element-with-optional-signature-image>
     <image source="1.jpg" singature="true" />
     <image source="2.jpg" />
  </element-with-optional-signature-image>
  <other>
     <image source="3.jpg" />
  </other>
</root>

```

I've never seen a DTD written like this before and just wondering if it common or a really bad way of doing this? I would've created two different elements `element-image` and `other-image`.

EDIT --

Is the above just as accepted as say a DTD like this:

```
<!ELEMENT element-image EMPTY>
    <!ATTLIST element-image 
        source CDATA #REQUIRED
        signature (true|false|1|0) "false" 
    >

<!ELEMENT other-image EMPTY>
    <!ATTLIST image 
        source CDATA #REQUIRED
    >

```

with XML like this:

```
<root>
  <element-with-optional-signature-image>
     <element-image source="1.jpg" singature="true" />
     <element-image source="2.jpg" />
  </element-with-optional-signature-image>
  <other>
     <other-image source="3.jpg" />
  </other>
</root>

```