<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Modules Index</title>
</head>
<body bgcolor="#ffffff">
<table border="0" width="100%">
<tr>
<td align="left"><a href="../../../../index.html"><img src="../../../../images/canon.gif" border="0"></a></td>
<td align="right"><img src="../../../../images/canre.gif"></td>
</tr>
</table>
<div align="right">
<small><a href="../../../../index.html">XML Schema Home</a></small>
</div>
<h1>XML::Schema::Type::List</h1>
<ul>
This module implements the XML Schema list type.
</ul>
<h2>Table of Contents</h2>
<ul>
<table border="0" cellpadding="2" cellspacing="0">
<tr valign="top">
<td>
<li><b><a href="#section_Synopsis">Synopsis</a></b>
</td>
<td>
</td>
<td>
<td>
</tr>
</table>
</ul>
<hr width="100%" size="1" noshade="1"><a name="section_Synopsis"><h2>Synopsis</h2></a>
<ul><pre><p>use XML::Schema::Type;
# an object to represent the base type
my $float = XML::Schema::Type::float->new();
# create a list type of the base type
my $list = XML::Schema::Type::List->new( itemType => $float );
# instantiate a validated list
my $items = $list->instance('3.14 2.718');
# add constraints to list
$list->constrain( maxLength => 4 ); # max 3 items
$item = $list->instance('1.2 3.4 5.6'); # OK
$item = $list->instance('1.2 3.4 5.6 7.8'); # not OK - 4 items
$item = $list->instance('hello'); # not OK - not a float</b></pre></ul>
<div align="center">
<small><b>Perl XML::Schema Documentation</b></small>
</div>
</body>
</html>