Expand my Community achievements bar.

SOLVED

Difficulty Binding Children and SubChildren

Avatar

Level 2

So I've got a Neighborhood.  In this neighborhood I have multiple Houses, each of which has Owners and the owners have Children.

I've got the following schema:

                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                      

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Neighborhood">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="House" minOccurs="1" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Address" type="xs:string"/>
            <xs:element name="Color" type="xs:string"/>
            <xs:element name="Owner" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
           
                  <xs:element name="FName" type="xs:string"/>
                  <xs:element name="LName" type="xs:string"/>
                  <xs:element name="child" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                    <xs:sequence>
                      <xs:element name="CFName" type="xs:string"/>
                      <xs:element name="CLName" type="xs:string"/>
                    </xs:sequence>
                    </xs:complexType>
                  </xs:element>
   
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>
</xs:schema>

When I fill out my form, unfortunately I only get the following and I do not know why.

  <?xml version="1.0" encoding="UTF-8" ?>
<Neighborhood>
       <House>
           <Address><br>123 Main</Address>
                <Color>Blue</Color>
        </House>
      <House>
           <Address>16 S St</Address>
           <Color><br>Red</Color>
      </House>
</Neighborhood>

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

If you entered address and color data only, the results are accurate for your schema.

Is this what you're after?

<?xml version="1.0" encoding="UTF-8"?>

          <House>

                    <Address>String</Address>

                    <Color>String</Color>

                    <Owner>

             <FName>String</FName>

             <LName>String</LName>

             <child>

                  <CFName>String</CFName>

                  <CLName>String</CLName>

              </child>

              <child>

                  <CFName>String</CFName>

                  <CLName>String</CLName>

                              </child>

                    </Owner>

          </House>

</Neighborhood>

If so, try this...

<?xml version="1.0" encoding="ISO-8859-1"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="Neighborhood">

                    <xs:complexType>

                              <xs:sequence>

                                        <xs:element name="House" minOccurs="1" maxOccurs="unbounded">

                                                  <xs:complexType>

                                                            <xs:sequence>

                                                                      <xs:element name="Address" type="xs:string"/>

                                                                      <xs:element name="Color" type="xs:string"/>

                                                                      <xs:element name="Owner">

                                                                                <xs:complexType>

                                                                                          <xs:sequence>

                                                                                                    <xs:element name="FName" type="xs:string"/>

                                                                                                    <xs:element name="LName" type="xs:string"/>

                                                                                                    <xs:element name="child" maxOccurs="unbounded">

                                                                                                              <xs:complexType>

                                                                                                                        <xs:sequence>

                                                                                                                                  <xs:element name="CFName" type="xs:string"/>

                                                                                                                                  <xs:element name="CLName" type="xs:string"/>

                                                                                                                        </xs:sequence>

                                                                                                              </xs:complexType>

                                                                                                    </xs:element>

                                                                                          </xs:sequence>

                                                                                </xs:complexType>

                                                                      </xs:element>

                                                            </xs:sequence>

                                                  </xs:complexType>

                                        </xs:element>

                              </xs:sequence>

                    </xs:complexType>

          </xs:element>

</xs:schema>

Steve

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

If you entered address and color data only, the results are accurate for your schema.

Is this what you're after?

<?xml version="1.0" encoding="UTF-8"?>

          <House>

                    <Address>String</Address>

                    <Color>String</Color>

                    <Owner>

             <FName>String</FName>

             <LName>String</LName>

             <child>

                  <CFName>String</CFName>

                  <CLName>String</CLName>

              </child>

              <child>

                  <CFName>String</CFName>

                  <CLName>String</CLName>

                              </child>

                    </Owner>

          </House>

</Neighborhood>

If so, try this...

<?xml version="1.0" encoding="ISO-8859-1"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="Neighborhood">

                    <xs:complexType>

                              <xs:sequence>

                                        <xs:element name="House" minOccurs="1" maxOccurs="unbounded">

                                                  <xs:complexType>

                                                            <xs:sequence>

                                                                      <xs:element name="Address" type="xs:string"/>

                                                                      <xs:element name="Color" type="xs:string"/>

                                                                      <xs:element name="Owner">

                                                                                <xs:complexType>

                                                                                          <xs:sequence>

                                                                                                    <xs:element name="FName" type="xs:string"/>

                                                                                                    <xs:element name="LName" type="xs:string"/>

                                                                                                    <xs:element name="child" maxOccurs="unbounded">

                                                                                                              <xs:complexType>

                                                                                                                        <xs:sequence>

                                                                                                                                  <xs:element name="CFName" type="xs:string"/>

                                                                                                                                  <xs:element name="CLName" type="xs:string"/>

                                                                                                                        </xs:sequence>

                                                                                                              </xs:complexType>

                                                                                                    </xs:element>

                                                                                          </xs:sequence>

                                                                                </xs:complexType>

                                                                      </xs:element>

                                                            </xs:sequence>

                                                  </xs:complexType>

                                        </xs:element>

                              </xs:sequence>

                    </xs:complexType>

          </xs:element>

</xs:schema>

Steve

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----