Please sign in to comment.
wxml/wcml: Add fx%extended_data and use for wcml
In order to implement validity constraints imposed by the CML schema and compchem convention without breaking applications that already use FoX_wcml we need a way to allow FoX_wcml to change behaviour depending on how it is used. This ability could be useful for other 'writer' modules. In FoX_wcml add an optional logical input argument to cmlStartCml which (1) adds two extra namespace declarations needed for the compchem convention and (2) uses this namespace to put prefixes on the UUID metadata and convention values. In future this could also turn on some limited run-time valididity checking. In order to keep track of if this is on or off add a new integer member to the xmlf_t. This is 0 by default and by stuffing some other number in it the useing module is expected to change its own behaviour. This member is accessed by a new function xmlf_GetExtendedData (which takes a single xmlf_t argument and returns an integer) and set by a new subroutine, xmlf_SetExtendedData (which takes two arguments, the xmlf_t type and and integer value to set). Finally, add a test to show that this actually does something and update the documentation.
- Loading branch information...
Showing with 66 additions and 3 deletions.
|@@ -0,0 +1,13 @@|
|+ use FoX_wcml|
|+ implicit none|
|+ character(len=*), parameter :: filename = 'test.xml'|
|+ type(xmlf_t) :: xf|
|+ call cmlBeginFile(xf, filename, unit=-1)|
|+ call cmlStartCml(xf, compchem=.true.)|
|+ call cmlFinishFile(xf)|
|+end program test|
|@@ -0,0 +1,3 @@|
|+<?xml version="1.0" encoding="UTF-8"?>|
|+<cml convention="convention:compchem" fileId="test.xml" xmlns="http://www.xml-cml.org/schema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fpx="http://www.uszla.me.uk/fpx" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:units="http://www.uszla.me.uk/FoX/units" xmlns:cmlUnits="http://www.xml-cml.org/units/units" xmlns:siUnits="http://www.xml-cml.org/units/siUnits" xmlns:atomicUnits="http://www.xml-cml.org/units/atomic" xmlns:convention="http://www.xml-cml.org/convention/" xmlns:compchem="http://www.xml-cml.org/dictionary/compchem/">|