element array

element {http://www.xml-cml.org/schema/stmml}array

Type Heirarchy
{http://www.w3.org/2001/XMLSchema}string (by extension)
 {http://www.xml-cml.org/schema/stmml}array
Abstractfalse (This can be used in an instance)
Nillablefalse (Instance values cannot use xsi:nil)
Target Namespacehttp://www.xml-cml.org/schema/stmml
Declared Namespacesxmlns:sch=http://www.ascc.net/xml/schematron
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns=http://www.xml-cml.org/schema/stmml


Source

<xsd:element name="array" id="el.array">
    <
xsd:annotation>
        <
xsd:documentation>
            <
div class="summary">A homogenous 1-dimensional array of similar objects.</div>
            <
div class="description">
                <
p>
                    <
tt>array</tt>
manages a homogenous 1-dimensional array of similar objects. These
can be encoded as strings (i.e. XSD-like datatypes) and are concatenated as
string content. The size of the array should always be >= 1.
                
</p>
                <
p>The default delimiter is whitespace. The
                    
<tt>normalize-space()</tt>
function of
XSLT could be used to normalize all whitespace to single spaces and this would not affect
the value of the array elements. To extract the elements
                    
<tt>java.lang.StringTokenizer</tt>
could be used. If the elements themselves contain whitespace then a different delimiter
must be used and is identified through the
                    
<tt>delimiter</tt>
attribute. This method is
mandatory if it is required to represent empty strings. If a delimiter is used it MUST
start and end the array - leading and trailing whitespace is ignored. Thus
                    
<tt>size+1</tt>
occurrences of the delimiter character are required. If non-normalized whitespace is to be
encoded (e.g. newlines, tabs, etc) you are recommended to translate it character-wise
to XML character entities.
                
</p>
                <
p>
Note that normal Schema validation tools cannot validate the elements
of
                    
<b>array</b>
(they are defined as
                    
<tt>string</tt>
) However if the string is
split, a temporary schema
can be constructed from the type and used for validation. Also the type
can be contained in a dictionary and software could decide to retrieve this
and use it for validation.
                
</p>
                <
p>When the elements of the
                    
<tt>array</tt>
are not simple scalars
(e.g.
                    
<a href="el.scalar">scalar</a>
s with a value and an error, the
                    
<tt>scalar</tt>
s should be used as the elements. Although this is
verbose, it is simple to understand. If there is a demand for
more compact representations, it will be possible to define the
syntax in a later version.
                
</p>
            </
div>
            <
div class="example">
                <
pre>
<array size="5" title="value"
dataType="xsd:decimal"> 1.23 2.34 3.45 4.56 5.67</array>
                
</pre>
                <
p>the
                    
<tt>size</tt>
attribute is not mandatory but provides a useful validity
check):
                
</p>
            </
div>
            <
div class="example">
                <
pre>
<array size="5" title="initials" dataType="xsd:string"
delimiter="/">/A B//C/D-E/F/</array>
                
</pre>
                <
p>Note that the second array-element is the empty string ''.</p>
            </
div>
            <
div class="example">
                <
pre>
<array title="mass" size="4"
units="unit:g"
errorBasis="observedStandardDeviation"
minValues="10 11 10 9"
maxValues="12 14 12 11"
errorValues="1 2 1 1"
dataType="xsd:float">11 12.5 10.9 10.2
</array>
                
</pre>
            </
div>
        </
xsd:documentation>
    </
xsd:annotation>
    <
xsd:complexType>
        <
xsd:simpleContent>
            <
xsd:extension base="xsd:string">
                <
xsd:attributeGroup ref="tit_id_conv_dictGroup"/>
                <
xsd:attribute name="dataType" type="dataTypeType" use="required">
                    <
xsd:annotation>
                        <
xsd:documentation>
                            <
div class="summary">The mandatory data type.</div>
                            <
div class="summary">All elements of the array must have the same dataType</div>
                        </
xsd:documentation>
                    </
xsd:annotation>
                </
xsd:attribute>
                <
xsd:attribute name="errorValues" type="floatArrayType">
                    <
xsd:annotation>
                        <
xsd:documentation>
                            <
div class="summary">an optional array of error values for numeric arrays</div>
                        </
xsd:documentation>
                    </
xsd:annotation>
                </
xsd:attribute>
                <
xsd:attributeGroup ref="errorBasis"/>
                <
xsd:attribute name="minValues" type="floatArrayType">
                    <
xsd:annotation>
                        <
xsd:documentation>
                            <
div class="summary">an optional array of minimum values for numeric arrays</div>
                        </
xsd:documentation>
                    </
xsd:annotation>
                </
xsd:attribute>
                <
xsd:attribute name="maxValues" type="floatArrayType">
                    <
xsd:annotation>
                        <
xsd:documentation>
                            <
div class="summary">an optional array of maximum values for numeric arrays</div>
                        </
xsd:documentation>
                    </
xsd:annotation>
                </
xsd:attribute>
                <
xsd:attributeGroup ref="units"/>
                <
xsd:attributeGroup ref="delimiter"/>
                <
xsd:attributeGroup ref="size"/>
                <
xsd:attributeGroup ref="ref"/>
            </
xsd:extension>
        </
xsd:simpleContent>
    </
xsd:complexType>
</
xsd:element>


Documentation

A homogenous 1-dimensional array of similar objects.

array manages a homogenous 1-dimensional array of similar objects. These can be encoded as strings (i.e. XSD-like datatypes) and are concatenated as string content. The size of the array should always be >= 1.

The default delimiter is whitespace. The normalize-space() function of XSLT could be used to normalize all whitespace to single spaces and this would not affect the value of the array elements. To extract the elements java.lang.StringTokenizer could be used. If the elements themselves contain whitespace then a different delimiter must be used and is identified through the delimiter attribute. This method is mandatory if it is required to represent empty strings. If a delimiter is used it MUST start and end the array - leading and trailing whitespace is ignored. Thus size+1 occurrences of the delimiter character are required. If non-normalized whitespace is to be encoded (e.g. newlines, tabs, etc) you are recommended to translate it character-wise to XML character entities.

Note that normal Schema validation tools cannot validate the elements of array (they are defined as string) However if the string is split, a temporary schema can be constructed from the type and used for validation. Also the type can be contained in a dictionary and software could decide to retrieve this and use it for validation.

When the elements of the array are not simple scalars (e.g. scalars with a value and an error, the scalars should be used as the elements. Although this is verbose, it is simple to understand. If there is a demand for more compact representations, it will be possible to define the syntax in a later version.

<array size="5" title="value"
  dataType="xsd:decimal">  1.23 2.34 3.45 4.56 5.67</array>

the size attribute is not mandatory but provides a useful validity check):

<array size="5" title="initials" dataType="xsd:string"
  delimiter="/">/A B//C/D-E/F/</array>

Note that the second array-element is the empty string ''.

<array title="mass" size="4"
  units="unit:g"
  errorBasis="observedStandardDeviation"
  minValues="10 11 10 9"
  maxValues="12 14 12 11"
  errorValues="1 2 1 1"
  dataType="xsd:float">11 12.5 10.9 10.2
</array>


element array


Stylus Studio XML Schema Library Home
Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio®, a product from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2006 All Rights Reserved.