Sign In/My Account | View Cart  
advertisement

Article:
 Normalizing XML, Part 2
Subject: possible typo?
Date: 2003-01-27 11:05:18
From: Joe Hubert

The Housing2.xsd schema includes this snippet within the HousingUnitList element:
<key name="UnitIDKey">
<selector xpath="Unit" />
<field xpath="@unitID" />
</key>


Should the xpath be "HousingUnit" instead of "Unit"?


No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • possible typo?
    2003-01-27 12:30:14 Will Provost

    That's correct. In fact, in double-checking this I discovered that there are also some missing namespace prefixes; the result was that the instance document was being incorrectly passed because the field xpath was resolving to an empty set.


    The correct lines for the keys and keyref are as follows:


    <key name="RealtorKey">
    <selector xpath="h:Realtor" />
    <field xpath="h:contact/h:name" />
    </key>
    </element>
    </sequence>
    </complexType>
    <key name="UnitIDKey">
    <selector xpath="h:HousingUnit" />
    <field xpath="@unitID" />
    </key>
    <keyref name="HousingUnitToRealtor" refer="h:RealtorKey">
    <selector xpath="h:HousingUnit" />
    <field xpath="h:realtor" />
    </keyref>
    </element>

    </schema>


    Good catch! Thanks.



Sponsored By: