Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

A row with a row - XSD

Avatar

Level 3

Hi everyone,

I have two tables, each has one row, table A cannot exist without table B, meaning if Table A has one objective, then there must at least be one KPI (KPI is contained within Table B).

Now I need to create an xsd that complies to this structure, to have a Row within a row. These tables should grow according to the data that is in the xml.

Below is what I've written, but I want the outputType to belong in objective and be a table/row.

<

xsd:complexType name="objective">

     <xsd:sequence>

          <xsd:element minOccurs="0" maxOccurs="unbounded" name="objectives">

               <xsd:complexType>

                    <xsd:sequence>

                       <xsd:element name="O1" type="xsd:string" />

                       <xsd:element name="O1Weight1" type="xsd:integer" />

                    </xsd:sequence>

               </xsd:complexType>

          </xsd:element>

     </xsd:sequence>

</xsd:complexType>

<

xsd:complexType name="outputType">

     <xsd:sequence>

     <xsd:element minOccurs="0" maxOccurs="unbounded" name="kpi">

     <xsd:complexType>

     <xsd:sequence>

          <xsd:element name="O1K1Weight1" type="xsd:string" />

          <xsd:element name="K1" type="xsd:string" />

          <xsd:element name="O1K1Target1" type="xsd:string" />

          <xsd:element name="O1K1Source1" type="xsd:string" />

          <xsd:element name="O1K1ActualScore" type="xsd:string" />

          <xsd:element name="O1K1Notes" type="xsd:string" />

     </xsd:sequence>

     </xsd:complexType>

     </xsd:element>

     </xsd:sequence>

</xsd:complexType>

</xsd:complexType>

</xsd:complexType>

</xsd:complexType>

4 Replies

Avatar

Level 4

I didn't think ComplexType nodes have a name attribute.  Normally you do:

To make things easier, why not just make 2 tables?  then have table A grow normally and then for each tableA.row, create however many KPIs you need in tableB.row.

Avatar

Level 3

Yes I have two tables already, the challenge is to have Table B belong to Table A in an XSD & both tables should grow automatically depending on the xml data

Avatar

Level 4

here's how I am understanding your issue:

Now I kind of doubt that would work, but you'd need to specify the tables individidually (so not nested):

I omitted types and namespaces, but hopefully that gives you an idea.

Avatar

Level 3

Let me try and  see if that will work, thanks.