← Prev in month ← Prev in thread
Next in thread → Next in month →

use of XSD datatypes

From
Franck Delahaye <>
Date
2001-06-27T13:00:07+00:00
ID
000801c087a0$aa8f2980$2f01a8c0@Delahaye
Thread
use of XSD datatypes
Hello,

below is how I've written part of a grammar to create an "fm.version" type
for the version attribute.
____________________________________________________________________________
_
<grammar xmlns="http://relaxng.org/ns/structure/0.9"
	xmlns:rng="http://relaxng.org/ns/structure/0.9"
	datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

...

<define name="fm.version">
 <data type="string">
  <param
name="pattern">[0-9]+[\s\t]*\.[\s\t]*[0-9]+[\s\t]*\.[\s\t]*[0-9]+[\s\t]*</pa
ram>
 </data>
</define>

...

<define name="entity.attrib">
   <attribute name="version" >
   <ref name="fm.version"/>
  </attribute>
</define>

...

</grammar>
____________________________________________________________________________
__

This seems to work with jing (with the needed .jar).

Now I assume that somebody on the net has written an XSD simpleType for
software releases, which
is OK for me.
So, I'd like to reuse this "standard" type.
How should I write my grammar to let it work ?
I've tried this below but jing tells me that the type "std-soft-version"
from library "version-type" is not recognized.
I don't know if I'm wrong, or if it is due to a limitation of jing...or
both.
_____________________________________________________________

version-type.xsd contains:

<xsd:simpleType name="std-soft-version"
xmlns:xsd="http://www.w3.org/2001/XMLSchema-datatypes">
<xsd:restriction base="xsd:string">
 <xsd:pattern
value="[0-9]+[\s\t]*\.[\s\t]*[0-9]+[\s\t]*\.[\s\t]*[0-9]+[\s\t]*"/>
</xsd:restriction>
</xsd:simpleType>

the grammar contains:

<define name="fm.version" datatypeLibrary="version-type.xsd">
 <data type="std-soft-version"/>
</define>
______________________________________________________________


regards,

Franck.
← Prev in month ← Prev in thread
Next in thread → Next in month →