Opened 13 years ago

Closed 13 years ago

#7 closed enhancement (fixed)

allow arbitrary elements to be added in various places

Reported by: prjemian Owned by: prjemian
Priority: minor Version:
Keywords: Cc:

Description

Some facilities have additional information to be described within the XML file. The present model requires that all elements are declared explicitly in the XML Schema. Can we relax this requirement yet still validate with an XML Schema?

Attachments (2)

xg009036_001.xml (11.9 KB) - added by prjemian 13 years ago.
example from ILL of additional (custom) elements
xg.xsl (1.7 KB) - added by prjemian 13 years ago.
XSLT stylesheet to display this data in a browser or format in Excel

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by prjemian

example from ILL of additional (custom) elements

Changed 13 years ago by prjemian

XSLT stylesheet to display this data in a browser or format in Excel

comment:1 Changed 13 years ago by prjemian

  • Status changed from new to assigned

This was discussed at the 2007 canSAS workshop and partly implemented in the standard, in the SASnote element.

It may be possible to implement in other places in the standard using the XML Schema any element declaration. Use of "any" is discouraged since it is antithetical to the theme of standrdization. In this case, it could be used to identify the popularity or usage of elements which are not declared in the existing canSAS standard.

There is also a namespace attribute that might be used to note the declared elements (those in the canSAS standard) and the custom ones.

It is suggested that where allowed, the <any namespace="##LOCAL" minOccurs="0" maxOccurs="unbounded" /> element be the last within its parent element. That is, all the canSAS elements come first.

comment:2 Changed 13 years ago by prjemian

Here's how it will be done in the cansas1d.xsd XML Schema

			<xsd:any minOccurs="0" maxOccurs="unbounded"
				processContents="skip" namespace="##other">
				<annotation>
					<documentation>
						<DT>
							/cs:SASroot/cs:SASentry/cs:SASsample/
							&lt;any&gt;
						</DT>
						<DD>
							[0..inf] Provision at this point for any
							element to be entered that is not part of
							the canSAS standard. Use a
							'''xmlns="some-simple-identification-string"'''
							to identify that this is a ''foreign
							element.''
						</DD>
					</documentation>
				</annotation>
			</xsd:any>

comment:3 Changed 13 years ago by prjemian

  • Resolution set to fixed
  • Status changed from assigned to closed

Provision for foreign elements added in several places by changeset [22]

Note: See TracTickets for help on using tickets.