Commits

Toby Inkster committed aaa28d1

document some types

Comments (0)

Files changed (1)

 
 BEGIN {
 	$Types::XSD::AUTHORITY = 'cpan:TOBYINK';
-	$Types::XSD::VERSION   = '0.000_02';
+	$Types::XSD::VERSION   = '0.000_01';
 }
 
 use B qw(perlstring);
 		my $A = eval($cache{"$type;a"} ||= $type->inline_check('$a'));
 		my $B = eval($cache{"$type;b"} ||= $type->inline_check('$b'));
 		$A <=> $B;
-	}
+	}	
 }
 
 use Types::Standard;
 the type constraints are the same as the XML Schema data types, but
 capitalization often differs.)
 
+I've added some explainations of what some of the more interesting
+non-obvious types are:
+
 =over
 
 =item C<< AnyType >>
 
 =item C<< NormalizedString >>
 
+A string containing no line breaks, carriage returns or tabs.
+
 =item C<< Token >>
 
+Like C<NormalizedString>, but also no leading or trailing space, and no
+doubled spaces (i.e. not C<< /\s{2,}/ >>).
+
 =item C<< Language >>
 
+An RFC 3066 language code.
+
 =item C<< Name >>
 
+Something that could be a valid XML element or attribute name. These roughly
+correspond to Perl identifiers but may also contain colons, hyphens and stops.
+(Digits, hyphens and stops are not allowed as the first character.)
+
 =item C<< NmToken >>
 
+Slightly looser version of C<Name>; allows digits, hyphens and stops in the
+first character.
+
 =item C<< NmTokens >>
 
+Space-separated list of C<NmToken>.
+
 =item C<< NCName >>
 
+Slightly tighter vesion of C<Name>; disallows colons.
+
 =item C<< Id >>
 
+Effectively the same as C<NCName>.
+
 =item C<< IdRef >>
 
+Effectively the same as C<NCName>.
+
 =item C<< IdRefs >>
 
+Space-separated list of C<IdRef>.
+
 =item C<< Entity >>
 
+Effectively the same as C<NCName>.
+
 =item C<< Entities >>
 
+Space-separated list of C<Entity>.
+
 =item C<< Boolean >>
 
+Allows C<< "true" >>, C<< "false" >>, C<< "1" >> and C<< "0" >>
+(case-insensitively).
+
+Gotcha: The string C<< "false" >> evaluates to true in Perl. You probably
+want to use C<< Bool >> from L<Types::Standard> instead.
+
 =item C<< Base64Binary >>
 
+Strings which are valid Base64 data. Allows whitespace.
+
+Gotcha: If you parameterize this with C<length>, C<maxLength> or C<minLength>,
+it is the length of the I<decoded> string which will be checked.
+
 =item C<< HexBinary >>
 
+Strings which are valid hexadecimal data. Disallows whitespace; disallows
+leading C<< 0x >>.
+
+Gotcha: If you parameterize this with C<length>, C<maxLength> or C<minLength>,
+it is the length of the I<decoded> string which will be checked.
+
 =item C<< Float >>
 
 =item C<< Double >>
 
 =item C<< AnyURI >>
 
+Any absolute I<< or relative >> URI. Effectively, any string at all!
+
 =item C<< QName >>
 
+An XML QName; something that could be used as a valid element name in a
+namespaced XML document.
+
+Gotcha: while C<length>, C<maxLength> and C<minLength> are allowed facets for
+parameterization, they are silently ignored, as per the specification!
+
 =item C<< Notation >>
 
+Effectively the same as C<QName>. According to XML Schema, this is I<always>
+supposed to be parameterized with an enumeration. But we don't enforce that.
+
+Gotcha: while C<length>, C<maxLength> and C<minLength> are allowed facets for
+parameterization, they are silently ignored, as per the specification!
+
 =item C<< Decimal >>
 
 =item C<< Integer >>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.