[osis-core] delimeters for identifiers in an osisID

Todd Tillinghast osis-core@bibletechnologieswg.org
Fri, 16 Aug 2002 01:51:45 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Forgot to attach the files.
> The heart of the problem is that we are not provided a containsToken
> function where we can say */*[containsToken(@osisID="Matt.1.1")] and
the
> function would return ONLY elements with an osisID attribute that
> contain the white space delimited TOKEN "Matt.1.1", that is ((the
first
> token OR preceded by a space) AND (the last token OR followed by a
> space)) that EXACTLY matchs "Matt.1.1".
> 
> Since we are only given a contains function we are left with a
problem.
> Harry's suggestion that we add extra spaces and/or rely on the ones
that
> are already present rather [ and ] is an intriguing one!
> 
> I have done a little research related to using spaces rather than [
and
> ] to bound individual identifiers in an osisID.
> 
> I have created three test cases with related schema the only
difference
> between the schema being the pattern statement.  (To simplify the
> pattern I have only allowed the numerals 1-9 in the normal structure.)
> 
> Test case 1 demonstrates that an "extra" space can be placed before
the
> first element and after the last element and still be valid when the
> pattern of the "primitive" identifiers does not make any mention of
such
> spaces.  However, it also demonstrates that an encoder can just as
> easily omit the NECESSARY space before the first identifier and after
> the last identifier with not error.
> <xs:pattern
>
value="((([1-9]){1,}((\.([1-9]){1,}){0,})?):)?([1-9]*((\.([1-9]){1,}){0,
> })?)"/>
> 
> For this test case consider the results of the following:
> //*[contains(@osisID, "1")]
> //*[contains(@osisID, " 1 ")]
> //*[contains(@osisID, " 1.1 ")]
> //*[contains(@osisID, "1.1")]
> //*[contains(@osisID, "1.2")]
> //*[contains(@osisID, "1.3")]
> //*[contains(@osisID, "1.4")]
> //*[contains(@osisID, " 1.5 ")]
> //*[contains(@osisID, " 1.6 ")]
> //*[contains(@osisID, " 1.7 ")]
> //*[contains(@osisID, "4.5")]
> //*[contains(@osisID, " 4.5 ")]
> 
> Test case 2 demonstrates that if a space is added to the pattern for
> "primitive" identifiers that NO MATTER WHAT you do when there is more
> than one primitive identifier in an osisID, the whole pattern is not
> valid.  This is because the valuator first parses the white space
> between the individual tokens recognizing the three spaces between
> individual identifiers as a SINGLE white space and then finding that
the
> individual identifier does not have a leading space and is thus
invalid.
> (Interestingly, I did not get the same problem when there was only a
> single identifier.  I consider this a bug in XMLSpy.  In any case the
> XMLSpy behavior is correct for the multiple case.)
> <xs:pattern
>
value="[\s]((([1-9]){1,}((\.([1-9]){1,}){0,})?):)?([1-9]*((\.([1-9]){1,}
> ){0,})?)[\s]"/>
> (I know that \s is any white space but for the test it makes no
> difference because I only used space in the test document file.)
> 
> Test case 1 and 2 taken together demonstrate that it is NOT POSSIBLE
to
> create a schema that enforces the requirement that individual
> identifiers be preceded by at least one space and followed by at least
> one space.  Of course we could not enforce the requirement, but I
think
> that would make the requirement meaningless because if the presence of
> the necessary spaces cannot be guaranteed then ALL reliable uses of
OSIS
> document will have to assume that the spaces were not correctly
placed.
> 
> Test case 3 demonstrates the use of [ and ].
> <xs:pattern
>
value="[\[]((([1-9]){1,}((\.([1-9]){1,}){0,})?):)?([1-9]*((\.([1-9]){1,}
> ){0,})?)[\]]"/>
> Consider the following test expressions:
> //*[contains(@osisID, "[1]")]
> //*[contains(@osisID, "[1.1]")]
> //*[contains(@osisID, "[1.2]")]
> //*[contains(@osisID, "[1.3]")]
> //*[contains(@osisID, "[1.4]")]
> //*[contains(@osisID, "[1.5]")]
> //*[contains(@osisID, "[1.6]")]
> //*[contains(@osisID, "[1.7]")]
> //*[contains(@osisID, "[4.5]")]
> 
> For the necessity of a delimiter of some kind see reply to Harry's
post.
> 
> Todd


------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/xml;
	name="osisIDTest1.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="osisIDTest1.xml"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<x xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xsi:noNamespaceSchemaLocation=3D"osisIDtest1.xsd" osisID=3D" 1.2:1 1 ">
	<y osisID=3D" 1.1 1.1:1.1 4.5:1.1.2 "/>
	<y osisID=3D" 1.2 1.1:1.2 4.5:1.1.3 "/>
	<y osisID=3D" 1.3 1.1:1.3 4.5:1.1.4 "/>
	<y osisID=3D"1.5"/>
	<y osisID=3D" 1.6 "/>
	<y osisID=3D" 1.7"/>
	<y osisID=3D" 1.8 4.5:1.1.9 "/>
	<y osisID=3D" 4.5 4.5:1.2.83 "/>
</x>

------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/xml;
	name="osisIDTest2.xsd"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="osisIDTest2.xsd"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" =
elementFormDefault=3D"qualified" attributeFormDefault=3D"unqualified">
	<xs:simpleType name=3D"multiple">
		<xs:list itemType=3D"single"/>
	</xs:simpleType>
	<xs:simpleType name=3D"single">
		<xs:restriction base=3D"xs:string">
			<xs:pattern =
value=3D"[\s]((([1-9]){1,}((\.([1-9]){1,}){0,})?):)?([1-9]*((\.([1-9]){1,=
}){0,})?)[\s]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name=3D"x">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref=3D"y" minOccurs=3D"0" maxOccurs=3D"unbounded"/>
			</xs:sequence>
			<xs:attribute name=3D"osisID" type=3D"multiple" use=3D"required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name=3D"y">
		<xs:complexType>
			<xs:attribute name=3D"osisID" type=3D"multiple" use=3D"required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>

------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/xml;
	name="osisIDTest1.xsd"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="osisIDTest1.xsd"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" =
elementFormDefault=3D"qualified" attributeFormDefault=3D"unqualified">
	<xs:simpleType name=3D"multiple">
		<xs:list itemType=3D"single"/>
	</xs:simpleType>
	<xs:simpleType name=3D"single">
		<xs:restriction base=3D"xs:string">
			<xs:pattern =
value=3D"((([1-9]){1,}((\.([1-9]){1,}){0,})?):)?([1-9]*((\.([1-9]){1,}){0=
,})?)"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name=3D"x">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref=3D"y" minOccurs=3D"0" maxOccurs=3D"unbounded"/>
			</xs:sequence>
			<xs:attribute name=3D"osisID" type=3D"multiple" use=3D"required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name=3D"y">
		<xs:complexType>
			<xs:attribute name=3D"osisID" type=3D"multiple" use=3D"required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>

------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/xml;
	name="osisIDTest3.xsd"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="osisIDTest3.xsd"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" =
elementFormDefault=3D"qualified" attributeFormDefault=3D"unqualified">
	<xs:simpleType name=3D"multiple">
		<xs:list itemType=3D"single"/>
	</xs:simpleType>
	<xs:simpleType name=3D"single">
		<xs:restriction base=3D"xs:string">
			<xs:pattern =
value=3D"[\[]((([1-9]){1,}((\.([1-9]){1,}){0,})?):)?([1-9]*((\.([1-9]){1,=
}){0,})?)[\]]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name=3D"x">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref=3D"y" minOccurs=3D"0" maxOccurs=3D"unbounded"/>
			</xs:sequence>
			<xs:attribute name=3D"osisID" type=3D"multiple" use=3D"required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name=3D"y">
		<xs:complexType>
			<xs:attribute name=3D"osisID" type=3D"multiple" use=3D"required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>

------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/xml;
	name="osisIDTest3.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="osisIDTest3.xml"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<x xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xsi:noNamespaceSchemaLocation=3D"osisIDtest3.xsd" osisID=3D"[1.2:1] =
[1]">
	<y osisID=3D"[1.1] [1.1:1.1] [4.5:1.1.2]"/>
	<y osisID=3D"[1.2] [1.1:1.2] [4.5:1.1.3]"/>
	<y osisID=3D"[1.3] [1.1:1.3] [4.5:1.1.4]"/>
	<y osisID=3D"[1.5]"/>
	<y osisID=3D"[1.6]"/>
	<y osisID=3D"[1.7]"/>
	<y osisID=3D"[1.8] [4.5:1.1.9]"/>
	<y osisID=3D"[4.5] [4.5:1.2.83]"/>
</x>

------=_NextPart_000_0051_01C244C7.7ACE3430
Content-Type: text/xml;
	name="osisIDTest2.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="osisIDTest2.xml"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<x xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xsi:noNamespaceSchemaLocation=3D"osisIDtest3.xsd" osisID=3D" 1.2:1   1 =
">
	<y osisID=3D" 1.1   1.1:1.1   4.5:1.1.2 "/>
	<y osisID=3D" 1.2   1.1:1.2   4.5:1.1.3 "/>
	<y osisID=3D" 1.3   1.1:1.3   4.5:1.1.4 "/>
	<y osisID=3D" 1.5 "/>
	<y osisID=3D" 1.6 "/>
	<y osisID=3D" 1.7 "/>
	<y osisID=3D" 1.8   4.5:1.1.9 "/>
	<y osisID=3D" 4.5   4.5:1.2.83 "/>
</x>

------=_NextPart_000_0051_01C244C7.7ACE3430--