Highlighted

Schema conversion to DTD - duplicate elements

New Here ,
Sep 18, 2015

Copy link to clipboard

Copied

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:element name="imageType" minOccurs="0" maxOccurs="unbounded">

     ...

     <xs:element name="description" type="xs:string" minOccurs="0">

          <xs:annotation>

               <xs:documentation>String for describing this file to users</xs:documentation>

          </xs:annotation>

     </xs:element>

       ...

</xs:element>


<xs:element name="description" type="ipxact:stringExpression" minOccurs="1">

     <xs:annotation>

          <xs:documentation>Full description string, typically for documentation</xs:documentation>

     </xs:annotation>

</xs:element>

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?

TOPICS
Structured

Views

468

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Schema conversion to DTD - duplicate elements

New Here ,
Sep 18, 2015

Copy link to clipboard

Copied

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:element name="imageType" minOccurs="0" maxOccurs="unbounded">

     ...

     <xs:element name="description" type="xs:string" minOccurs="0">

          <xs:annotation>

               <xs:documentation>String for describing this file to users</xs:documentation>

          </xs:annotation>

     </xs:element>

       ...

</xs:element>


<xs:element name="description" type="ipxact:stringExpression" minOccurs="1">

     <xs:annotation>

          <xs:documentation>Full description string, typically for documentation</xs:documentation>

     </xs:annotation>

</xs:element>

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?

TOPICS
Structured

Views

469

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 18, 2015 0
Adobe Community Professional ,
Sep 18, 2015

Copy link to clipboard

Copied

Brant,

  I would use slightly different schemas with FM and elsewhere. In particular, I would:

  1. 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.
  2. When opening XML documents in FM, use XSLT to append the appropriate suffix to each element that had "duplicate" definitions.
  3. 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.

--Lynne

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2015 0