/[volute]/trunk/projects/dm/vo-dml/xsd/vo-dml.sch.xml
ViewVC logotype

Diff of /trunk/projects/dm/vo-dml/xsd/vo-dml.sch.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2492 by gerard.lemson, Sun Mar 2 16:00:19 2014 UTC revision 2493 by gerard.lemson, Wed Mar 26 16:44:01 2014 UTC
# Line 11  Line 11 
11    
12  <!-- Check that a model import exists for a utyperef with prefix not equal to utype of the model. -->  <!-- Check that a model import exists for a utyperef with prefix not equal to utype of the model. -->
13  <sch:pattern name="RemoteModelImport">  <sch:pattern name="RemoteModelImport">
14    <sch:rule context="utype[substring-before(text(),':') != '' and substring-before(text(),':') != /vo-dml:model/name]">    <sch:rule context="utype[substring-before(text(),':') != '' and substring-before(text(),':') != /vo-dml:model/vodml-id]">
15      <sch:let name="prefix" value="substring-before(text(),':')"/>      <sch:let name="prefix" value="substring-before(text(),':')"/>
16      <sch:assert test="/vo-dml:model/import/name = $prefix">      <sch:assert test="/vo-dml:model/import/vodml-id = $prefix">
17  ERROR:  There is no imported model corresponding to model prefix '<sch:value-of select="$prefix"/>' in this model.  ERROR:  There is no imported model corresponding to model prefix '<sch:value-of select="$prefix"/>' in this model.
18      </sch:assert>      </sch:assert>
19    </sch:rule>    </sch:rule>
# Line 85  Line 85 
85                  <xsl:variable name="prefix" select="substring-before($utype,':')"/>                  <xsl:variable name="prefix" select="substring-before($utype,':')"/>
86      <xsl:variable name="targetUtype" select="substring-after($utype,concat($prefix,':'))"/>      <xsl:variable name="targetUtype" select="substring-after($utype,concat($prefix,':'))"/>
87          <xsl:choose>          <xsl:choose>
88              <xsl:when test="$prefix = $model/name">              <xsl:when test="$prefix = $model/vodml-id">
89                  <xsl:value-of select="$model//*[vodml-id = $targetUtype]/name()"/>                  <xsl:value-of select="$model//*[vodml-id = $targetUtype]/name()"/>
90              </xsl:when>              </xsl:when>
91              <xsl:otherwise>              <xsl:otherwise>
92                  <xsl:variable name="import" select="$model/import[name = $prefix]/url"/>                  <xsl:variable name="import" select="$model/import[vodml-id = $prefix]/url"/>
93                  <xsl:choose>                  <xsl:choose>
94                  <xsl:when test="$import">                  <xsl:when test="$import">
95                    <xsl:variable name="doc" select="document($import)"/>                    <xsl:variable name="doc" select="document($import)"/>

Legend:
Removed from v.2492  
changed lines
  Added in v.2493

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26