|
element array | ||||||||||
| Jump: DOCUMENTATION | SOURCE | FRAMES NO FRAMES | ||||||||||
| Type Heirarchy |
|---|
{http://www.w3.org/2001/XMLSchema}string (by extension) {http://www.xml-cml.org/schema/cml2/core}array |
| Abstract | false (This can be used in an instance) |
|---|---|
| Nillable | false (Instance values cannot use xsi:nil) |
| Target Namespace | http://www.xml-cml.org/schema/cml2/core |
| Declared Namespaces | xmlns:val=http://www.w3.org/1999/XSL/TransformX xmlns:stm=http://www.xml-cml.org/schema/stmml xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xlink=http://www.w3.org/1999/xlink xmlns:cml=http://www.xml-cml.org/schema/cml2/core xmlns=http://www.xml-cml.org/schema/cml2/core |
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.
<stmml title="array example 1"> <array size="5" title="value" dataType="xsd:decimal"> 1.23 2.34 3.45 4.56 5.67</array> </stmml>
the size attribute is not mandatory but provides a useful validity check):
<stmml title="array example 2"> <array size="5" title="initials" dataType="xsd:string" delimiter="/">/A B//C/D-E/F/</array> </stmml>
Note that the second array-element is the empty string ''.
<stmml title="array example 3"> <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> </stmml>
|
element array | ||||||||||
| Jump: DOCUMENTATION | SOURCE | FRAMES NO FRAMES | ||||||||||
![]() |
||
| Stylus Studio XML Schema Library Home | ||
| Site Map | Privacy Policy | Terms of Use | Trademarks |