public class DataFixture extends Object
| Modifier and Type | Field and Description |
|---|---|
protected File |
dataFile
Files containing tested subject.
|
protected org.apache.xerces.xs.XSModel |
model
An XSModel object representing a GML application schema.
|
protected String |
observation_type_category |
protected String |
observation_type_complex |
protected String |
observation_type_count |
protected String |
observation_type_geometry |
protected String |
observation_type_measurement |
protected String |
observation_type_swe_array |
protected String |
observation_type_swe_simple |
protected String |
observation_type_temporal |
protected String |
observation_type_truth |
protected Document |
originalSubject |
protected String |
Resource_GML_Path |
protected String |
Resource_SWE_Path |
protected Document |
testSubject |
protected URI |
testSubjectUri |
| Constructor and Description |
|---|
DataFixture() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
CheckObservationTypeCategory(String href)
Check Observation Type Category in schematron document
resultTypeConsistent.sch
|
List<String> |
CheckObservationTypeCount(String href)
Check Observation Type Count in schematron document
resultTypeConsistent.sch
|
List<String> |
CheckObservationTypeMeasurement(String href)
Check Observation Type Measurement in schematron document
resultTypeConsistent.sch
|
List<String> |
CheckObservationTypeTruth(String href)
Check Observation Type Truth in schematron document
resultTypeConsistent.sch
|
String |
CheckXPath2(String xpath)
Check XPath2.0
|
net.sf.saxon.s9api.XdmValue |
CheckXPath2Modified(String xpath2,
File xmlFile)
Check XPath2.0 modified version
|
Validator |
CreateValidator(URL xsdPath)
Create Validator for checking XML file against XML Schema file
|
Validator |
CreateValidatorFromXSD(URL xsdPath)
Create validator from xsd file
|
static net.sf.saxon.s9api.XdmValue |
evaluateXPath2Modified(File xmlFile,
String expr,
Map<String,String> nsBindings)
Evaluates an XPath 2.0 expression using the Saxon s9api interfaces
modified version
|
String |
generateXPathExpression(List<QName> elemNames,
Map<String,String> namespaceBindings)
Generates an XPath expression to find all instances of the given elements
in the data being validated.
|
File |
GetFileViaResourcePath(String resourcePath) |
List<String> |
GetResultTypeHref() |
void |
obtainTestSubject(org.testng.ITestContext testContext) |
String |
SchemaElement(String candidateNode,
String nodeName,
File schemaFile)
Return
"true" if candidate element node satisfy all three of
the following conditions: Condition 1: The name of the candidate node
matches the specified nodeName or matches the name of an
element in a substitution group headed by an element named
nodeName. |
void |
setDataFile(File dataFile)
Sets the data file.
|
void |
setSchemaModel(org.apache.xerces.xs.XSModel xsModel)
Sets the schema model (for unit testing purposes).
|
protected File dataFile
protected Document originalSubject
protected Document testSubject
protected URI testSubjectUri
protected String Resource_GML_Path
protected String Resource_SWE_Path
protected org.apache.xerces.xs.XSModel model
protected final String observation_type_measurement
protected final String observation_type_category
protected final String observation_type_count
protected final String observation_type_truth
protected final String observation_type_complex
protected final String observation_type_geometry
protected final String observation_type_temporal
protected final String observation_type_swe_simple
protected final String observation_type_swe_array
public void obtainTestSubject(org.testng.ITestContext testContext)
public void setDataFile(File dataFile)
dataFile - A File containing the data to be validated.public void setSchemaModel(org.apache.xerces.xs.XSModel xsModel)
xsModel - An XSModel object representing a GML application schema.public String generateXPathExpression(List<QName> elemNames, Map<String,String> namespaceBindings)
elemNames - A list of qualified names corresponding to element
declarations.namespaceBindings - A collection of namespace bindings required to evaluate the
XPath expression, where each entry maps a namespace URI (key)
to a prefix (value).public Validator CreateValidator(URL xsdPath) throws XMLStreamException, SAXException, IOException
xsdPath - URL path of the XSD fileXMLStreamException - XMLStreamExceptionIOException - IOExceptionSAXException - SAX Errorpublic static net.sf.saxon.s9api.XdmValue evaluateXPath2Modified(File xmlFile, String expr, Map<String,String> nsBindings) throws net.sf.saxon.s9api.SaxonApiException
xmlFile - The XML file.expr - The XPath expression to be evaluated.nsBindings - A collection of namespace bindings required to evaluate the
XPath expression, where each entry maps a namespace URI (key)
to a prefix (value); this may be null if not needed.net.sf.saxon.s9api.SaxonApiException - SaxonApiExceptionpublic net.sf.saxon.s9api.XdmValue CheckXPath2Modified(String xpath2, File xmlFile)
xpath2 - String denoting an xpath syntaxxmlFile - the File xmlpublic String SchemaElement(String candidateNode, String nodeName, File schemaFile) throws net.sf.saxon.s9api.SaxonApiException
"true" if candidate element node satisfy all three of
the following conditions: Condition 1: The name of the candidate node
matches the specified nodeName or matches the name of an
element in a substitution group headed by an element named
nodeName. Condition 2: derives-from(AT, ET) is true, where
AT is the type annotation of the candidate node and ET is the schema type
declared for element nodeName in the in-scope element
declarations. Condition 3: If the element declaration for
nodeName in the in-scope element declarations is not
nillable, then the nilled property of the candidateNode is
falsecandidateNode - the candidate node for testingnodeName - name of node for comparingschemaFile - the location of schema used for testingnet.sf.saxon.s9api.SaxonApiException - SaxonApiExceptionpublic Validator CreateValidatorFromXSD(URL xsdPath) throws SAXException, IOException, URISyntaxException
xsdPath - A URL that denotes the location of a XML schema.SAXException - SAXExceptionURISyntaxException - URISyntaxExceptionIOException - IOExceptionpublic String CheckXPath2(String xpath)
xpath - String denoting an xpath syntaxpublic List<String> CheckObservationTypeMeasurement(String href)
href - the value of om:type/xlink:href to make the contextpublic List<String> CheckObservationTypeCategory(String href)
href - the value of om:type/xlink:href to make the contextpublic List<String> CheckObservationTypeCount(String href)
href - the value of om:type/xlink:href to make the contextpublic List<String> CheckObservationTypeTruth(String href)
href - the value of om:type/xlink:href to make the contextCopyright © 2021 Open Geospatial Consortium. All rights reserved.