From 2979d5ccf2ef4109ab830a505e5565709deb10b0 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Thu, 8 Feb 2018 15:30:40 -0900 Subject: [PATCH] Add a local copy of xml.xsd. The version 2.1.1 internationalization changes introduced the need for adding the xml.xsd file to support `xml:lang` attributes on internationalized text strings. However, the schema import pointed at a network location of the schema file, which prevents validation when offline. Adding xml.xsd to the schema dir and referencing the local copy allows offline validation to succeed and prevents injection attacks on the remote schema file. Need to verify that this is the right version of xml.xsd. --- xsd/eml-resource.xsd | 112 +++++++++++++++++++++---------------------- xsd/eml-text.xsd | 20 ++++---- xsd/eml.xsd | 24 +++++----- xsd/xml.xsd | 13 +++++ 4 files changed, 91 insertions(+), 78 deletions(-) create mode 100644 xsd/xml.xsd diff --git a/xsd/eml-resource.xsd b/xsd/eml-resource.xsd index cc312257..f44aea60 100644 --- a/xsd/eml-resource.xsd +++ b/xsd/eml-resource.xsd @@ -5,8 +5,8 @@ - - + + '$RCSfile: eml-resource.xsd,v $' @@ -440,7 +440,7 @@ EML document. For example, if the same person is the creator, metadataProvider, and contact for a dataset, their name and address can be provided once as part of the "creator" element, and then - their "id" can be used in the "references" element of + their "id" can be used in the "references" element of metadataProvider and contact. This reduces the likelihood of error by reducing redundancy, and allows one to specify that two pieces of information are identical. To be a valid EML @@ -478,7 +478,7 @@ Place Keywords Keywords pertaining to a spatial location - Keywords naming geographic locations associated + Keywords naming geographic locations associated with the data set. @@ -488,7 +488,7 @@ Stratum Keywords Keywords pertaining to a vertical stratum - Keywords naming vertical strata associated + Keywords naming vertical strata associated with the data set (e.g., soil horizons). @@ -498,7 +498,7 @@ Temporal Keywords Keywords pertaining to temporal data - Keywords listing time periods associated + Keywords listing time periods associated with the data set. @@ -508,7 +508,7 @@ Thematic Keywords Keywords pertaining to thematic subject - Keywords naming thematics subjects associated + Keywords naming thematics subjects associated with the data set. @@ -518,7 +518,7 @@ Taxonomic Keywords Keywords pertaining to taxon information - Keywords listing taxonomic terms associated + Keywords listing taxonomic terms associated with the data set. Note that lists of species names or other taxon lists should be presented in the taxonomicCoverage element. @@ -613,19 +613,19 @@
Distribution information for accessing the - resource by one of three methods: online, offline or inline. Generally, - the Type at the resource level is intended to be informational, although + resource by one of three methods: online, offline or inline. Generally, + the Type at the resource level is intended to be informational, although elements are included to describe a complex connection protocol. For more information, see the sub-elements. Also - compare to + compare to phys:PhysicalDistributionType . - - + +
@@ -639,7 +639,7 @@ distribution/online Online distribution information This element contains information for accessing the - resource online, represented either as a URL a connection, or + resource online, represented either as a URL a connection, or a connectionDefinition which may be referenced in other parts of the EML document. See the Type definition for more information.
@@ -650,8 +650,8 @@ Offline distribution data are available offline - This element is for data which are distributed offline, - generally by request. See the Type + This element is for data which are distributed offline, + generally by request. See the Type definition for more information. @@ -661,7 +661,7 @@ Inline distribution data distributed inline in the metadata. - The data are distributed inline, with the metadata. See the Type + The data are distributed inline, with the metadata. See the Type definition for more information. @@ -678,10 +678,10 @@ Connection Definition Definition of the connection protocol. - Definition of the connection protocol. + Definition of the connection protocol. The definition has a "scheme" which identifies the - protocol by name, with a detailed description - and its required parameters. A connectionDefinition + protocol by name, with a detailed description + and its required parameters. A connectionDefinition lists all of the parameters needed for the connection and possible default values for each. A definition provided in this element may be used in other parts of the EML document. @@ -849,8 +849,8 @@ inline type --> metadata by providing it inside of the "inline" element. For many text formats, the data can be simply included directly in the element. However, certain character sequences are invalid in - an XML document (e.g., <), so care will need to be taken to - either 1) wrap the data in a CDATA section if needed, or + an XML document (e.g., <), so care will need to be taken to + either 1) wrap the data in a CDATA section if needed, or 2) encode the data using a text encoding algorithm such as base64, and then include that in a CDATA section. The latter will be necessary for binary formats. @@ -964,17 +964,17 @@ inline type -->
Distribution information for accessing the resource online, represented either as a URL or as the series of - named parameters needed to connect. The URL field can contain + named parameters needed to connect. The URL field can contain a simple web address or an entire query string. The connection - element allows the components of a complex protocol to - be described individually. The connectionDefinition element - can also be appear outside of the connection elements, - so that it can be defined once and referenced by several connections. + element allows the components of a complex protocol to + be described individually. The connectionDefinition element + can also be appear outside of the connection elements, + so that it can be defined once and referenced by several connections. - Also see the + Also see the - phys:PhysicalOnlineType, + phys:PhysicalOnlineType, which may be more appropriate for describing the online connections to a specific entity described by this metadata document. @@ -989,9 +989,9 @@ inline type --> Description of online information Brief description of the the content of online - This element can hold a brief description of the content - of the online element's online|offline|inline child. This description element could - supply content for an html anchor tag. + This element can hold a brief description of the content + of the online element's online|offline|inline child. This description element could + supply content for an html anchor tag. @@ -1002,11 +1002,11 @@ inline type --> URL A URL or this resource. - A URL (Uniform Resource Locator) from which this additional - information can be obtained, or from which the resource can be downloaded - directly. In the resource module, the distribution URL is generally meant for - informational purposes, and the "function" attribute should be set to "information". - However, if the URL returns the data stream itself, then the "function" attribute + A URL (Uniform Resource Locator) from which this additional + information can be obtained, or from which the resource can be downloaded + directly. In the resource module, the distribution URL is generally meant for + informational purposes, and the "function" attribute should be set to "information". + However, if the URL returns the data stream itself, then the "function" attribute should be set to "download". See the Type Definition for more information. @@ -1016,9 +1016,9 @@ inline type --> Connection A connection to a data service - A description of the information needed to make an application - connection to a data service. The connection contains a connectionDefinition - and optional parameters for overriding defaults. See the Type Definition for + A description of the information needed to make an application + connection to a data service. The connection contains a connectionDefinition + and optional parameters for overriding defaults. See the Type Definition for more information. @@ -1029,7 +1029,7 @@ inline type --> Connection Definition The definition of a connection that will be used in another location in the EML - document + document The definition of a type of connection @@ -1040,11 +1040,11 @@ The definition of a type of connection connection element). This connectionDefinition may be used by multiple connections (e.g., to download different files from the same database), but each connection must provide or - reference a valid connection definition. - + reference a valid connection definition. + The definition has a "scheme" which identifies the - protocol by name, with a detailed description - and its required parameters. A connectionDefinition + protocol by name, with a detailed description + and its required parameters. A connectionDefinition lists all of the parameters needed for the connection and possible default values for each. @@ -1053,7 +1053,7 @@ The definition of a type of connection - @@ -1069,8 +1069,8 @@ URL Type --> provides further information about downloading the object but does not directly return the data stream, then the "function" attribute should be set to "information". - If accessing the URL would directly return the data stream, - then the "function" attribute should be set to "download". + If accessing the URL would directly return the data stream, + then the "function" attribute should be set to "download". If the "function" attribute is omitted, then "download" is implied for the URL function. In more complex cases where a non-standard connection @@ -1112,7 +1112,7 @@ connectionType --> can be omitted. All information about how to use the parameters to establish a session and extract data is present in the connectionDefinition, possibly implicitly - by naming a connection schemeName that is well-known. + by naming a connection schemeName that is well-known. See descriptions of the child element types for further information. @@ -1188,12 +1188,12 @@ connectionType --> Non Empty String Type Non Empty String Type - This type specifies a content pattern for all elements - that are required by EML to ensure that there is actual content (i.e., + This type specifies a content pattern for all elements + that are required by EML to ensure that there is actual content (i.e., not just whitespace). The pattern described can be interpreted as "at least one non-whitespace character, followed by any number of whitespace plus not-whitespace characters. " - Leading and/or trailing whitespace is allowed, and whitespace + Leading and/or trailing whitespace is allowed, and whitespace may include carriage returns and newlines. @@ -1202,13 +1202,13 @@ connectionType --> - + i18n Non Empty String Type i18n Non Empty String Type - This type specifies a content pattern for all elements + This type specifies a content pattern for all elements that require language translations. The xml:lang attribute can be used to define the default language for element content. Additional translations should be included as child 'value' @@ -1222,7 +1222,7 @@ connectionType --> i18n Value i18n Value - Allows multiple language translations + Allows multiple language translations to appear as children of a mixed-content parent element. The xml:lang attribute is optional and will override any xml:lang attribute that has been specified in the ancestor elements. The content is subject to the same @@ -1239,5 +1239,5 @@ connectionType --> - + diff --git a/xsd/eml-text.xsd b/xsd/eml-text.xsd index 38263f53..690632cc 100644 --- a/xsd/eml-text.xsd +++ b/xsd/eml-text.xsd @@ -8,8 +8,8 @@ targetNamespace="eml://ecoinformatics.org/text-2.2.0"> - + @@ -87,7 +87,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -264,14 +264,14 @@ the url attribute contains the location of the work for a link. This markup is a subset of DocBook. url="http://dublincore.org/documents/usageguide/" - + - + @@ -326,7 +326,7 @@ - + @@ -400,7 +400,7 @@ - + @@ -446,7 +446,7 @@ - + @@ -465,7 +465,7 @@ Specifies the language xml:lang="en-US" - + diff --git a/xsd/eml.xsd b/xsd/eml.xsd index 8aacb1d9..5b7ff0e5 100644 --- a/xsd/eml.xsd +++ b/xsd/eml.xsd @@ -1,16 +1,16 @@ - @@ -19,7 +19,7 @@ - + '$RCSfile: eml.xsd,v $' Copyright: 1997-2002 Regents of the University of California, University of New Mexico, and Arizona State University Sponsors: National Center diff --git a/xsd/xml.xsd b/xsd/xml.xsd new file mode 100644 index 00000000..c6e9c462 --- /dev/null +++ b/xsd/xml.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + + +