The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<!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-&gt;new();

# create a list type of the base type
my $list = XML::Schema::Type::List-&gt;new( itemType =&gt; $float );

# instantiate a validated list
my $items = $list-&gt;instance('3.14  2.718');

# add constraints to list
$list-&gt;constrain( maxLength =&gt; 4 );		# max 3 items

$item = $list-&gt;instance('1.2 3.4 5.6');	# OK
$item = $list-&gt;instance('1.2 3.4 5.6 7.8'); # not OK - 4 items
$item = $list-&gt;instance('hello');		# not OK - not a float</b></pre></ul>

  




<div align="center">
<small><b>Perl XML::Schema Documentation</b></small>
</div>
</body>
</html>