I'm investigating utilizing structured FrameMaker with an existing schema which is causing issues due to what appears to be limitations of DTDs vs schemas.
The schema that I'm using has a number of cases where it uses elements with the same name others at different levels of hierarchy. For example it has the following to 'description' elements, one as a common type defined at the top level of the schema and another as a sub-element within another element in the schema:
<xs:documentation>Full description string, typically for documentation</xs:documentation>
When I attempt to open an XML file which uses this schema, I get a lot of errors similar to the following due to these duplicate elements:
'Error at line 508, char 22, Message: Element 'description' has already been declared'
If I import the schema and convert it to a DTD, there are in fact two description elements defined, with different attributes. From my research it appears that this is something supported in schemas that has no equivalent in DTDs. If the two elements were identical this wouldn't be an issue as I could remove the duplicate copy in the DTD, but since they can have different types or constraints it is causing issues for properly validating the XML.
It looks like even if you don't specify a DTD for a structured application Frame will internally convert the file's schema into a DTD anyway when opening the file. Unfortunately this is an industry standard schema and I don't have any control over it, so I can't tweak the schema to change any of these duplicate names.
Is there any way to properly handle such a schema in Structured Framemaker?
I would use slightly different schemas with FM and elsewhere. In particular, I would:
Use XSLT to create a variant of the original schema in which every element type has a single definition. I'd probably just append a numeric suffix to each "duplicate", making sure the result didn't conflict with existing names.
When opening XML documents in FM, use XSLT to append the appropriate suffix to each element that had "duplicate" definitions.
When saving FM documents as XML, either use FM read/write rules or XSLT to remove the suffixes so that the result conforms to the original schema.