ome-xml  5.2.0
Namespaces | Classes | Functions
ome::xml Namespace Reference

OME-XML Data Model. More...

Namespaces

 meta
 Metadata storage and retrieval.
 
 model
 Model objects.
 

Classes

class  OMEEntityResolver
 Entity resolver for the OME schemas. More...
 
class  OMETransformResolver
 Discover and query available OME-XML transforms. More...
 
class  OMETransformResolverImpl
 Private implementation details of OMETransformResolver. More...
 

Functions

ome::common::xml::dom::Document createDocument (const boost::filesystem::path &file, const ome::common::xml::dom::ParseParameters &params=ome::common::xml::dom::ParseParameters())
 Construct a Document from the content of a file. More...
 
ome::common::xml::dom::Document createDocument (const std::string &text, const ome::common::xml::dom::ParseParameters &params=ome::common::xml::dom::ParseParameters(), const std::string &id="membuf")
 Construct a Document from the content of a string. More...
 
ome::common::xml::dom::Document createDocument (std::istream &stream, const ome::common::xml::dom::ParseParameters &params=ome::common::xml::dom::ParseParameters(), const std::string &id="streambuf")
 Construct a Document from the content of an input stream. More...
 
void register_module_paths ()
 Register the OME-XML module paths with OME-Common. More...
 
std::string getModelVersion (ome::common::xml::dom::Document &document)
 Determine the model schema version used in an XML document. More...
 
template<typename Input , typename Output >
void transform (const std::string &target_schema, const Input &input, Output &output, ome::common::xml::EntityResolver &entity_resolver, OMETransformResolver &transform_resolver)
 Transform OME-XML to a different model schema version. More...
 
template<typename Input , typename Output >
void transform (const std::string &target_schema, const Input &input, Output &output, ome::common::xml::EntityResolver &entity_resolver)
 Transform OME-XML to a different model schema version. More...
 
template<class charT , class traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &os, const OMETransformResolver::Quality &quality)
 Output OMETransformResolver::Quality to output stream. More...
 
const std::string & model_version ()
 Get the current OME-XML model version. More...
 

Detailed Description

OME-XML Data Model.

Function Documentation

ome::common::xml::dom::Document ome::xml::createDocument ( const boost::filesystem::path &  file,
const ome::common::xml::dom::ParseParameters params = ome::common::xml::dom::ParseParameters() 
)

Construct a Document from the content of a file.

This is the same as ome::common::xml::dom::createDocument(const boost::filesystem::path&, EntityResolver&, const ParseParameters&) but uses OMEEntityResolver to resolve all OME schemas from the local catalog.

Parameters
filethe file to read.
paramsXML parser parameters.
Returns
the new Document.

References ome::common::xml::dom::createDocument().

Referenced by ome::xml::model::XMLAnnotation::asXMLElementInternal().

+ Here is the caller graph for this function:

ome::common::xml::dom::Document ome::xml::createDocument ( const std::string &  text,
const ome::common::xml::dom::ParseParameters params = ome::common::xml::dom::ParseParameters(),
const std::string &  id = "membuf" 
)

Construct a Document from the content of a string.

This is the same as ome::common::xml::dom::createDocument(const std::string&, EntityResolver&, const ParseParameters&, const std::string&) but uses OMEEntityResolver to resolve all OME schemas from the local catalog.

Parameters
textthe string to use.
paramsXML parser parameters.
iddocument filename (for error reporting only).
Returns
the new Document.

References ome::common::xml::dom::createDocument().

ome::common::xml::dom::Document ome::xml::createDocument ( std::istream &  stream,
const ome::common::xml::dom::ParseParameters params = ome::common::xml::dom::ParseParameters(),
const std::string &  id = "streambuf" 
)

Construct a Document from the content of an input stream.

This is the same as ome::common::xml::dom::createDocument(std::istream&, EntityResolver&, const ParseParameters&, const std::string&) but uses OMEEntityResolver to resolve all OME schemas from the local catalog.

Parameters
streamthe stream to read.
paramsXML parser parameters.
iddocument filename (for error reporting only).
Returns
the new Document.

References ome::common::xml::dom::createDocument().

std::string ome::xml::getModelVersion ( ome::common::xml::dom::Document document)
inline

Determine the model schema version used in an XML document.

Parameters
documentthe document to check. This may be any supported input type (file path, string, stream).
Returns
the schema version in use, or an empty string if the version could not be determined.

References ome::common::xml::dom::Document::getDocumentElement().

Referenced by transform().

+ Here is the caller graph for this function:

const std::string & ome::xml::model_version ( )

Get the current OME-XML model version.

Note that unlike the OME_XML_MODEL_VERSION macro, which is the version of the model which was built against, this gets the version of the model of the library linked against (which might differ).

Returns
the current OME-XML model version.
template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::xml::operator<< ( std::basic_ostream< charT, traits > &  os,
const OMETransformResolver::Quality quality 
)
inline

Output OMETransformResolver::Quality to output stream.

Parameters
osthe output stream.
qualitythe OMETransformResolver::Quality to output.
Returns
the output stream.

References ome::xml::OMETransformResolver::quality_name().

void ome::xml::register_module_paths ( )

Register the OME-XML module paths with OME-Common.

This function forces path registration.

Note
This is a hack to allow static linking to work on Windows; without this, the module object is omitted and the paths aren't automatically registered. This will no longer be required once it is built as a DLL. Its only purpose is to force object inclusion when static linking, and ensure that the registration happens independently of object static construction order to allow use prior to main() entry. You should not use this.

References register_module_paths(), and ome::common::register_module_paths().

Referenced by ome::xml::OMEEntityResolver::OMEEntityResolver(), and ome::xml::OMETransformResolver::OMETransformResolver().

+ Here is the caller graph for this function:

template<typename Input , typename Output >
void ome::xml::transform ( const std::string &  target_schema,
const Input &  input,
Output &  output,
ome::common::xml::EntityResolver entity_resolver,
OMETransformResolver transform_resolver 
)

Transform OME-XML to a different model schema version.

Parameters
target_schemathe schema version to transform the input to.
inputthe source XML. This may be any supported input type (file path, string, stream).
outputthe destination for the transformed XML. This may be any supported output type (file path, string, stream).
entity_resolverthe entity resolver to use for validation.
transform_resolverthe transform resolver to use for determining the transform sequence between schema versions.
Todo:
: Logging of transforms being applied.

References ome::common::xml::dom::createDocument(), getModelVersion(), ome::common::xsl::Transformer::setEntityResolver(), ome::common::xsl::Transformer::setUseValidation(), ome::common::xsl::Transformer::transform(), ome::xml::OMETransformResolver::transform_order(), and ome::common::xml::dom::writeDocument().

Referenced by ome::xml::OMETransformResolverImpl::fill_graph(), ome::xml::model::Shape::setTransform(), transform(), ome::xml::OMETransformResolver::transform_order(), and ome::xml::meta::MetadataStore::~MetadataStore().

+ Here is the caller graph for this function:

template<typename Input , typename Output >
void ome::xml::transform ( const std::string &  target_schema,
const Input &  input,
Output &  output,
ome::common::xml::EntityResolver entity_resolver 
)

Transform OME-XML to a different model schema version.

An OMETransformResolver will be created on the fly; use the function taking an OMETransformResolver as a parameter if applying multiple transforms to avoid the overhead of scanning the filesystem for available transforms multiple times. This function is intended only for convenience when applying a single transform.

Parameters
target_schemathe schema version to transform the input to.
inputthe source XML. This may be any supported input type (file path, string, stream).
outputthe destination for the transformed XML. This may be any supported output type (file path, string, stream).
entity_resolverthe entity resolver to use for validation.

References transform().