When using keys and keyrefs like this
<xs:key name="PKStates">
<xs:selector xpath="state"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="FKTransitionStatesFrom" refer="PKStates">
<xs:selector xpath="transition"/>
<xs:field xpath="@fromState"/>
</xs:keyref>
<xs:keyref name="FKTransitionStatesTo" refer="PKStates">
<xs:selector xpath="transition"/>
<xs:field xpath="@toState"/>
</xs:keyref>
I get a bunch of errors:
No resource type specified (at 'xpath' with value '@id'). fsm.xsd /test/res/xml line 30 Android AAPT Problem
No resource type specified (at 'xpath' with value '@fromState'). fsm.xsd /test/res/xml line 42 Android AAPT Problem
No resource type specified (at 'xpath' with value '@toState'). fsm.xsd /test/res/xml line 46 Android AAPT Problem
The XSD syntax is valid, XML files get validated OK. But these errors, being within the res folder of an android project prevents the java code to compile successfully.
It turns out that prefixing xpath with .// (e.g. <xs:field xpath=".//@id"/>
) does eliminate the error. Still the former syntax should be accepted as well, since it is correctly formed according to the BNF declaration of the field type (www.w3.org/TR/2009/WD-xmlschema11-1-20091203/#c-fields-xpaths)
[Updated on: Mon, 22 April 2013 13:13]
Report message to a moderator