An element that contains only #PCDATA isn't generated:
test.dtd:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT kap (ofc)>
<!ELEMENT ofc (#PCDATA)>
Generate:
$ xsdata generate test.dtd
Result:
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class Kap:
class Meta:
name = "kap"
ofc: Optional[str] = field(
default=None,
metadata={
"type": "Element",
"required": True,
}
)
This doesn't seem correct, since ofc should become a class.
Note that if I remove kap from the DTD so that there's only ofc, I get this:
from dataclasses import dataclass, field
@dataclass
class Ofc:
class Meta:
name = "ofc"
value: str = field(
default="",
metadata={
"required": True,
}
)
That is the expected class. I'm not sure why the Ofc class is missing from the first test file.
Using repo head.
An element that contains only #PCDATA isn't generated:
test.dtd
:Generate:
Result:
This doesn't seem correct, since
ofc
should become a class.Note that if I remove
kap
from the DTD so that there's onlyofc
, I get this:That is the expected class. I'm not sure why the
Ofc
class is missing from the first test file.