- <template name="Vocab:prefix">
- <param name="unprefixed" select="''"/>
- <variable name="namespace" select="//rdf:RDF//owl:Ontology/shacl:declare/shacl:namespace[starts-with($unprefixed, string()) and string(preceding-sibling::shacl:prefix)!=''][1]"/>
- <choose>
- <when test="not($namespace)">
- <value-of select="$unprefixed"/>
- </when>
- <otherwise>
- <value-of select="$namespace/preceding-sibling::shacl:prefix"/>
- <text>:</text>
- <value-of select="substring-after($unprefixed, $namespace)"/>
- </otherwise>
- </choose>
- </template>