locked
VS2008 SP1 XML Schema Tool question - where do I post? RRS feed

  • Question

  • I have a vendor-supplied set of DTD files and although VS2008 XML Schema Generator can generate a xsd, it is INCORRECT because it completely fails to convert Parameter Entity usage to a definition that will validate, here's the target expanded XML:

    <QUANTITY qualifier="SHIPUNIT">

      <VALUE>11</VALUE>

      <NUMOFDEC>0</NUMOFDEC>

      <SIGN>+</SIGN>

      <UOM>UNITS</UOM>

    </QUANTITY>

    Here's the DTD snippet:

    <!-- QUANTITY -->

    <!ENTITY % SEG_QUANTITY_QUALIFIERS "(ACCEPTED | ACTDUR | ATTBTYPE |

    %SEG_QUANTITY_QUALIFIERS_EXTENSION;)">

    <!ELEMENT QUANTITY (VALUE, NUMOFDEC, SIGN, UOM)>

    <!ATTLIST QUANTITY

    qualifier %SEG_QUANTITY_QUALIFIERS; #REQUIRED

    >

    <!ENTITY % QUANTITY.ACCEPTED "QUANTITY">

    <!ENTITY % QUANTITY.ACTDUR "QUANTITY">

    <!ENTITY % QUANTITY.ATTBTYPE "QUANTITY">

    which is referenced in:

    <!ELEMENT ATTRIBUTE (ATTBNAME*, (%QUANTITY.ATTBTYPE;)*, ATTBVALUE* )>

    <!ATTLIST ATTRIBUTE

    returndata CDATA #IMPLIED

    >
    and returns the XSD as the folowing, where the "QUANTITY" should be a reference but there ought to be something to do with the "ATTBTYPE" qualifier and the elements...  As the QUANTITY Parameter Entity is used multiple times in a single ELEMENT, with different qualifier names of course, the XSD is "bad" because "QUANTITY" becomes the element name repeatedly at sibling-level...:

    <xs:element name="ATTRIBUTE">

      <xs:complexType>

        <xs:sequence>

          <xs:element minOccurs="0" maxOccurs="unbounded" ref="ATTBNAME" />

          <xs:element minOccurs="0" maxOccurs="unbounded" ref="QUANTITY" />

          <xs:element minOccurs="0" maxOccurs="unbounded" ref="ATTBVALUE" />

        </xs:sequence>

        <xs:attribute name="returndata" type="xs:string" />

      </xs:complexType>

    </xs:element>

    This looks like a bug, or I need to modify the DTD so VS will recognize the Parameter references correctly...  Help is needed either way...

    Wednesday, October 22, 2008 5:03 PM

Answers

All replies