XML Schema Generation - No PKs and FKs

Hi,

I am trying to generate the XML output which is XSD file from the ER studio XML schema generation option. I have selected the PK and FK when exporting the XML from ER studio(refer the image 1)  but in the output XSD file it does not have PKs and FKs. Also, when I drag and drop the entity under the element, it does not show the any PK or FK and considering PKs/FKs as regular attributes(refer the image 2).

image 1:

image 2:

Is there any option in ER studio to generate the XML file with the PKs and FKs.

Thanks,

AB

Parents
  • Hi AB,

    If you uncheck the PK|FK in Entity Options in the 3rd page, these attributes are not included when you drag & drop your entity to the schema.

    https://docwiki.embarcadero.com/ERStudioDA/en/Generating_a_Customized_XML_Schema#Page_3

    In your second screenshot, if you haven't checked the PK option, you wouldn't have the EmployeeIdentifier attribute in your sequence. DItto for the 4 FK.

    Regarding your need, I'd use a MetaWizard Export bridge: W3C XML Schema Definition (XSD) 1.0 Forward Engineering

    Regards,

      W.

  • Hi,

    I am sure that I have selected the PK and FK in the page 3 for XML generation but still I got see the PK/FK. Also, I dragged and drop the entity to the element tabe, do we need to drop somewhere else as well?

  • Hi,

    From the documentation:

    • Include PK attributes: If selected, specifies to include the Primary Key (PK) indices as attributes. For example, the following entity declaration incudes EmployeeID, which is the primary key for the Employee entity.

      <xs:element name="Employee nillable="true">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="EmployeeID" type="empid"/>
      <xs:element name="FirstName" type="xs:string"/>
      <xs:element name="LastName" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      </xs:element>

    If the option is not checked it generates:

    • <xs:element name="Employee nillable="true">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="FirstName" type="xs:string"/>
      <xs:element name="LastName" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      </xs:element>

    So, I am also sure that you have selected the PK and FK in the page 3 for XML generation otherwise you wouldn't see the 3 attributes in your second screenshot.

    There's no option to generate <xs:key ...> <xs:keyref ...> with the XML Schema Generation Wizard.

    Regards,

      W.

  • Hi Willian,

    Thanks for the response.

    Does that mean the ER studio can not generate the relationships in the XML output? 

  • Hi,

    ER/Studio Data Architect can generate the relationships in the XML output but not using the XML Schema Generation Wizard.

    Like I said in my first reply, I'd use a MetaWizard Export bridge: W3C XML Schema Definition (XSD) 1.0 Forward Engineering to get the relationships in the generated schema:

    Regards,

      W.

Reply
  • Hi,

    ER/Studio Data Architect can generate the relationships in the XML output but not using the XML Schema Generation Wizard.

    Like I said in my first reply, I'd use a MetaWizard Export bridge: W3C XML Schema Definition (XSD) 1.0 Forward Engineering to get the relationships in the generated schema:

    Regards,

      W.

Children
No Data