untitled

(ff) #1

1.7 Namespaces 29


These declarations are attributes that can be added to any element, but
they are most commonly added to the root element. Once the prefixes have
been declared, one can use the prefixes for elements and for attributes. For
example, the following document mixes CML, BioML and SBML terminol-
ogy:


<bioml:organism
xmlns:cml="http://www.xml-cml.org/schema/cml2/core"
xmlns:cmlr="http://www.xml-cml.org/schema/cml2/react"
xmlns:bioml="http://xml.coverpages.org/bioMLDTD-19990324.txt"
xmlns:sbml="http://www.sbml.org/sbml/level2"



Homo sapiens
















...


There are several ambiguities in the document above. As we have already
noted, CML and SBML both usereaction. The meanings are the same, but
they are specified differently. For example, CML usesreactantListfor
what SBML callslistOfReactants. A more subtle ambiguity is the use of
speciesby both SBML and BioML. Here the the meanings are different. In
SBML a species is a chemical species. In BioML it is an organism species.
One can use any prefix to designate a namespace within an XML element.
For example, one could have usedxyzinstead ofbiomlin the document
above. However, it is better to use prefixes that clearly abbreviate the name-

Free download pdf