<?xml version="1.0" encoding="UTF-8" standalone = "no"?>
<!DOCTYPE WellLogML SYSTEM "http://www.posc.org/dtds/WellLogML.1.0.dtd">
<!-- Copyright (c) 1999 POSC -->
<WellLogML
xmlns="http://www.posc.org/dtds/WellLogML.1.0"
xmlns:log="http://www.posc.org/dtds/WellLogML.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.posc.org/dtds/WellLogML.1.0
http://www.posc.org/dtds/WellLogML.1.0.xsd">
…
<WellInformation>
<MeasurementDetails>
<primaryIndex type="DEPTH"/>
<startIndex>11940.5000</startIndex>
<endIndex>12040.0000</endIndex>
<evenSampling index_curve="DEPT">
<stepIncrement>0.5000</stepIncrement>
</evenSampling>
<indexUnits>F </indexUnits>
<uomNamingSystem type="LIS"></uomNamingSystem>
</MeasurementDetails>
<WellInfo>
<operatorName>2</operatorName>
<wellName type="LOCALFIELD">
<wellId>SAMPLE #1</wellId>
</wellName>
<WellLocation>
<GeopoliticalLocation>
<countryName></countryName>
<stateOrProvinceName>TEXAS</stateOrProvinceName>
<countyName>HARRIS</countyName>
</GeopoliticalLocation>
</WellLocation>
<WellLocation>
<LegalDescription>
<textLocationDescription>SAMPLE FIELD SAMPLE FIELD</textLocationDescription>
</LegalDescription>
</WellLocation>
<serviceCompanyName apiOrganizationCode="2331"></serviceCompanyName>
</WellInfo>
</WellInformation>
…
</WellLogML>
Listing 1- XML document fragment of a well log document from POSC shown in Figure 1
<?xml version="1.0" ?>
<!-- Copyright (c) 1999 POSC -->
<xsd:schema
xmlns="http://www.posc.org/dtds/WellLogML.1.0"
targetNamespace="http://www.posc.org/dtds/WellLogML.1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
<xsd:annotation>
<xsd:documentation>WellLogML schema expressed in XML Schema</xsd:documentation>
</xsd:annotation>
<xsd:element name="WellLogML">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentInformation" type="DocumentInformationType"/>
<xsd:element name="WellInformation" type="WellInformationType"/>
…
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
…
<xsd:complexType name="WellInformationType">
<xsd:sequence>
<xsd:element name="MeasurementDetails" type="MeasurementDetailsType"/>
<xsd:element name="WellInfo" type="WellInfoType"/>
<xsd:element name="comment" type="commentType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
…
<xsd:complexType name="wellNameType">
<xsd:sequence>
<xsd:element name="wellId" type="xsd:string"/>
<xsd:element name="comment" type="commentType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="type" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="API"/>
<xsd:enumeration value="UWI"/>
<xsd:enumeration value="WWN"/>
<xsd:enumeration value="IRIS21"/>
<xsd:enumeration value="NPD"/>
<xsd:enumeration value="DTI"/>
<xsd:enumeration value="LOCALFIELD"/>
<xsd:enumeration value="SHORTNAME"/>
<xsd:enumeration value="PROJECTNAME"/>
<xsd:enumeration value="UNKNOWN"/>
<xsd:enumeration value="OTHER"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
…
</xsd:schema>
Listing 2 - Fragment from the POSC Well Log XML schema
/**
* @name class wellNameType
*
* following is the generated class representation for the element
* wellName
*/
class wellNameType {
private:
///single instance of the element wellId
std::string d_wellId;
///zero or one instances of the element comment
std::vector<std::string > d_comment;
///attribute type
std::string d_type;
void domarshal(std::ostream& out, const std::string& indent="") const;
void doprint(std::ostream& out, const std::string& indent="") const;
public:
wellNameType() : d_wellId("") {}
~wellNameType() {}
const std::string& getWellId() const { return this->d_wellId; }
void setWellId(const std::string& value) { this->d_wellId=value; }
const std::string& getComment() const throw(std::out_of_range) {
return d_comment.at(0);
}
bool isCommentDefined() const { return d_comment.size()>0; }
void setComment(const std::string& value) {
if(this->d_comment.size()==1) this->d_comment[0]=value;
else this->d_comment.push_back(value);
}
const std::string& getType() const { return this->d_type; }
void setType(const std::string& value) {
this->d_type=value;
}
void marshal(std::ostream& out, const std::string& indent="", const std::string& tag_name="", bool export_root_attributes=false)
const;
void print(std::ostream& out, const std::string& tag_name="", const std::string& indent="") const;
friend ostream& operator<<(std::ostream& out, const wellNameType& obj) {
obj.print(out);
return out;
}
};
Listing 3 - Automatically generated C++ class wellNameType for the POSC Well Log
schema
class WellLogML {
private:
///external schema locations
std::string schemaLocations;
///single instance of the element WellInformation
WellInformationType d_WellInformation;
void domarshal(std::ostream& out, const std::string& indent="") const;
void doprint(std::ostream& out, const std::string& indent="") const;
public:
WellLogML() { this->schemaLocations="";}
~WellLogML() {}
const WellInformationType& getWellInformation() const { return this->d_WellInformation; }
WellInformationType& getWellInformation() { return this->d_WellInformation; }
void setWellInformation(const WellInformationType& value) { this->d_WellInformation=value; }
void unmarshal(const char *xml_document) throw(std::runtime_error);
void setExternalSchemaLocation(const char* locations) {this->schemaLocations=locations;}
void marshal(std::ostream& out, const std::string& indent="", const std::string& tag_name="", bool export_root_attributes=true)
const;
void print(std::ostream& out, const std::string& tag_name="", const std::string& indent="") const;
friend ostream& operator<<(std::ostream& out, const WellLogML& obj) {
obj.print(out);
return out;
}
};
Listing 4 - Automaticallty generated C++ class WellLogML
cmnt 1D/3D single phase; sand facies; constant porosity
cmnt I/O control
cmnt visualize opendx
logdepth 3
listxml
end
cmnt geometry part
depositype hydrostatic
meshstatus compacted
include mesh1col.linux.dat
end
cmnt rock properties
modelpor athy
cmnt thermal data: grad tsup heatflow
thermdata 25.0 0.0 41.84
facies sand
2.65e3 0.5 0.5 6.536 -15.6 1 5.0 800.0
facies sand
2.65e3 0.5 0.5 6.536 -15.6 1 5.0 800.0
facies sand
2.65e3 0.5 0.5 6.536 -15.6 1 5.0 800.0
facies sand
2.65e3 0.5 0.5 6.536 -15.6 1 5.0 800.0
facies shale
2.68e3 0.63 0.58 6.536 -19.4 1 2.0 800.0
end
cmnt fluid data
model single
denw 1000. 0.0 0.0
end
cmnt multiphase data
end
cmnt lithosphere data
end
cmnt thermal solver
tempcalc geother
cmnt numerical options
limitvar 10. 10.
relaxation zcoords 0.5
solvdispl trapezo 5
tolcompac 1.e-5
nitcompac 50
toldecomp 1.e-3
nitdecomp 50
flowiter limited
nitnewton 10
tolrnewton 1.0e-3
end
Listing 5. A proprietary flat file defining inputs for our fluid simulator
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.swamp.com/bsm"
xmlns="http://www.swamp.com/bsm"
elementFormDefault="qualified">
<xsd:include schemaLocation="bsmtypes.xsd"/>
<xsd:element name="bsmio-fluid">
<xsd:annotation>
<xsd:documentation></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="fluid-model" type="fluid-model-type"/>
<xsd:element name="pressure-reference" type="positive-float-type" minOccurs="0"/>
<xsd:element name="temperature-reference" type="positive-float-type" minOccurs="0"/>
<xsd:group ref="water-density-group" minOccurs="0"/>
<xsd:group ref="oil-density-group" minOccurs="0"/>
<xsd:element name="sea-water-density" type="nonzero-positive-float-type" minOccurs="0"/>
<xsd:group ref="water-viscosity-group" minOccurs="0"/>
<xsd:group ref="oil-viscosity-group" minOccurs="0"/>
<xsd:group ref="residual-saturation-group" minOccurs="0"/>
<xsd:group ref="relative-water-permeability-group" minOccurs="0"/>
<xsd:group ref="relative-oil-permeability-group" minOccurs="0"/>
<xsd:group ref="oil-water-capillary-pressure-group" minOccurs="0"/>
<xsd:element name="water-thermal-conductivity" type="nonzero-positive-float-type" minOccurs="0"/>
<xsd:element name="oil-thermal-conductivity" type="nonzero-positive-float-type" minOccurs="0"/>
<xsd:element name="water-specific-heat" type="nonzero-positive-float-type" minOccurs="0"/>
<xsd:element name="oil-specific-heat" type="nonzero-positive-float-type" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:group name="water-density-group">
<xsd:sequence>
<xsd:element name="water-density-reference" type="nonzero-positive-float-type" minOccurs="0"/>
<xsd:element name="water-pressure-coef" type="xsd:double" minOccurs="0"/>
<xsd:element name="water-temperature-coef" type="xsd:double" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="oil-density-group">
<xsd:sequence>
<xsd:element name="oil-density-reference" type="nonzero-positive-float-type" minOccurs="0"/>
<xsd:element name="oil-pressure-coef" type="xsd:double" minOccurs="0"/>
<xsd:element name="oil-temperature-coef" type="xsd:double" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="water-viscosity-group">
<xsd:sequence>
<xsd:element name="avw" type="xsd:double" minOccurs="0"/>
<xsd:element name="c1vw" type="xsd:double" minOccurs="0"/>
<xsd:element name="c2vw" type="xsd:double" minOccurs="0"/>
<xsd:element name="c3vw" type="xsd:double" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="oil-viscosity-group">
<xsd:sequence>
<xsd:element name="avo" type="xsd:double" minOccurs="0"/>
<xsd:element name="bvo" type="xsd:double" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="residual-saturation-group">
<xsd:sequence>
<xsd:element name="critical-water-saturation" type="small-float-type" minOccurs="0"/>
<xsd:element name="residual-oil-saturation" type="small-float-type" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="relative-water-permeability-group">
<xsd:sequence>
<xsd:element name="krw0" type="small-float-type" minOccurs="0"/>
<xsd:element name="krw-exponent" type="ufloat-type" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="relative-oil-permeability-group">
<xsd:sequence>
<xsd:element name="kro0" type="small-float-type" minOccurs="0"/>
<xsd:element name="kro-exponent" type="ufloat-type" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="oil-water-capillary-pressure-group">
<xsd:sequence>
<xsd:element name="pcowm" type="ufloat-type" minOccurs="0"/>
<xsd:element name="pcowr" type="ufloat-type" minOccurs="0"/>
<xsd:element name="pco-exponent" type="ufloat-type" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
</xsd:schema>
Listing 6 - XML Schema for fluid properties of basin modeling shown in Figure 3.
#ifndef __BSMIOSIMULATIONINPUTDATA_H__
#define __BSMIOSIMULATIONINPUTDATA_H__
#include <string>
#include <vector>
#include <stdexcept>
#include <iostream>
#include "basStringToNumber.h"
#include "bsmioFluid.h"
#include "bsmioLithosphere.h"
#include "bsmioMesh.h"
#include "bsmioNumeric.h"
#include "bsmioProjectCoordinateDef.h"
#include "bsmioRock.h"
#include "bsmioUnits.h"
#include "thermalData.h"
#include "ageFilePair.h"
#include "ageValuePair.h"
#include "dataFormOption.h"
#include "functionCoefs.h"
using namespace bsmio;
namespace bsmio {
class bsmioSimulationInputData {
private:
std::string schemaLocations;
std::vector<std::string > d_comment;
unsigned int d_logDepth;
std::vector<std::string > d_visualizer;
std::vector<std::string > d_listxml;
bsmioUnits d_bsmioUnits;
std::vector<bsmioProjectCoordinateDef> d_bsmioProjectCoordinateDef;
std::vector<std::string > d_outputVariable;
std::vector<bsmioMesh> d_bsmioMesh;
std::vector<std::string > d_meshFile;
bsmioRock d_bsmioRock;
std::vector<dataFormOption> d_paleoBathymetry;
std::vector<bsmioFluid> d_bsmioFluid;
std::vector<thermalData> d_thermalData;
std::vector<bsmioLithosphere> d_bsmioLithosphere;
std::vector<bsmioNumeric> d_bsmioNumeric;
public:
bsmioSimulationInputData() : d_logDepth(0) {
this->schemaLocations="";
}
~bsmioSimulationInputData() {}
const std::vector<std::string >& getComment() const { return this->d_comment; }
const std::string& getComment(size_t i) const throw(std::out_of_range) {
return d_comment.at(i);
}
size_t getCommentCount() const { return d_comment.size(); }
bool isCommentDefined() const { return d_comment.size()>0; }
void pushbackComment(const std::string& value) {
this->d_comment.push_back(value);
}
unsigned int getLogDepth() const { return this->d_logDepth; }
void setLogDepth(unsigned int value) { this->d_logDepth=value; }
void setLogDepth(const char* value) {
this->d_logDepth=(unsigned int)(basStringToNumber::toi(value));
}
const std::string& getVisualizer() const throw(std::out_of_range) {
return d_visualizer.at(0);
}
bool isVisualizerDefined() const { return d_visualizer.size()>0; }
void setVisualizer(const std::string& value) {
if(this->d_visualizer.size()==1) this->d_visualizer[0]=value;
else this->d_visualizer.push_back(value);
}
const std::string& getListxml() const throw(std::out_of_range) {
return d_listxml.at(0);
}
bool isListxmlDefined() const { return d_listxml.size()>0; }
void setListxml(const std::string& value) {
if(this->d_listxml.size()==1) this->d_listxml[0]=value;
else this->d_listxml.push_back(value);
}
const bsmioUnits& getBsmioUnits() const { return this->d_bsmioUnits; }
bsmioUnits& getBsmioUnits() { return this->d_bsmioUnits; }
void setBsmioUnits(const bsmioUnits& value) { this->d_bsmioUnits=value; }
const bsmioProjectCoordinateDef& getBsmioProjectCoordinateDef() const throw(std::out_of_range) {
return d_bsmioProjectCoordinateDef.at(0);
}
bsmioProjectCoordinateDef& getBsmioProjectCoordinateDef() throw(std::out_of_range) {
return d_bsmioProjectCoordinateDef.at(0);
}
bool isBsmioProjectCoordinateDefDefined() const { return d_bsmioProjectCoordinateDef.size()>0; }
void setBsmioProjectCoordinateDef(const bsmioProjectCoordinateDef& value) {
if(this->d_bsmioProjectCoordinateDef.size()==1)
this->d_bsmioProjectCoordinateDef[0]=value;
else this->d_bsmioProjectCoordinateDef.push_back(value);
}
const std::vector<std::string >& getOutputVariable() const {
return this->d_outputVariable;
}
const std::string& getOutputVariable(size_t i) const throw(std::out_of_range) {
return d_outputVariable.at(i);
}
size_t getOutputVariableCount() const { return d_outputVariable.size(); }
bool isOutputVariableDefined() const { return d_outputVariable.size()>0; }
void pushbackOutputVariable(const std::string& value) {
this->d_outputVariable.push_back(value); }
const bsmioMesh& getBsmioMesh() const throw(std::out_of_range) {
return d_bsmioMesh.at(0);
}
bsmioMesh& getBsmioMesh() throw(std::out_of_range) {
return d_bsmioMesh.at(0);
}
bool isBsmioMeshDefined() const { return d_bsmioMesh.size()>0; }
void setBsmioMesh(const bsmioMesh& value) {
if(this->d_bsmioMesh.size()==1) this->d_bsmioMesh[0]=value;
else this->d_bsmioMesh.push_back(value);
}
const std::string& getMeshFile() const throw(std::out_of_range) {
return d_meshFile.at(0);
}
bool isMeshFileDefined() const { return d_meshFile.size()>0; }
void setMeshFile(const std::string& value) {
if(this->d_meshFile.size()==1) this->d_meshFile[0]=value;
else this->d_meshFile.push_back(value);
}
const bsmioRock& getBsmioRock() const { return this->d_bsmioRock; }
bsmioRock& getBsmioRock() { return this->d_bsmioRock; }
void setBsmioRock(const bsmioRock& value) { this->d_bsmioRock=value; }
const dataFormOption& getPaleoBathymetry() const throw(std::out_of_range) {
return d_paleoBathymetry.at(0);
}
dataFormOption& getPaleoBathymetry() throw(std::out_of_range) {
return d_paleoBathymetry.at(0);
}
bool isPaleoBathymetryDefined() const { return d_paleoBathymetry.size()>0; }
void setPaleoBathymetry(const dataFormOption& value) {
if(this->d_paleoBathymetry.size()==1) this->d_paleoBathymetry[0]=value;
else this->d_paleoBathymetry.push_back(value);
}
const bsmioFluid& getBsmioFluid() const throw(std::out_of_range) {
return d_bsmioFluid.at(0);
}
bsmioFluid& getBsmioFluid() throw(std::out_of_range) {
return d_bsmioFluid.at(0);
}
bool isBsmioFluidDefined() const { return d_bsmioFluid.size()>0; }
void setBsmioFluid(const bsmioFluid& value) {
if(this->d_bsmioFluid.size()==1) this->d_bsmioFluid[0]=value;
else this->d_bsmioFluid.push_back(value);
}
const thermalData& getThermalData() const throw(std::out_of_range) {
return d_thermalData.at(0);
}
thermalData& getThermalData() throw(std::out_of_range) {
return d_thermalData.at(0);
}
bool isThermalDataDefined() const { return d_thermalData.size()>0; }
void setThermalData(const thermalData& value) {
if(this->d_thermalData.size()==1) this->d_thermalData[0]=value;
else this->d_thermalData.push_back(value);
}
const bsmioLithosphere& getBsmioLithosphere() const throw(std::out_of_range) {
return d_bsmioLithosphere.at(0);
}
bsmioLithosphere& getBsmioLithosphere() throw(std::out_of_range) {
return d_bsmioLithosphere.at(0);
}
bool isBsmioLithosphereDefined() const { return d_bsmioLithosphere.size()>0; }
void setBsmioLithosphere(const bsmioLithosphere& value) {
if(this->d_bsmioLithosphere.size()==1) this->d_bsmioLithosphere[0]=value;
else this->d_bsmioLithosphere.push_back(value);
}
const bsmioNumeric& getBsmioNumeric() const throw(std::out_of_range) {
return d_bsmioNumeric.at(0);
}
bsmioNumeric& getBsmioNumeric() throw(std::out_of_range) {
return d_bsmioNumeric.at(0);
}
bool isBsmioNumericDefined() const { return d_bsmioNumeric.size()>0; }
void setBsmioNumeric(const bsmioNumeric& value) {
if(this->d_bsmioNumeric.size()==1) this->d_bsmioNumeric[0]=value;
else this->d_bsmioNumeric.push_back(value);
}
void unmarshal(const char *xml_document) throw(std::runtime_error);
void setExternalSchemaLocation(const char* locations) {
this->schemaLocations=locations;}
void marshal(ostream& out, const std::string& indent="", const std::string& tag_name="", bool export_root_attributes=true) const;
void print(ostream& out, const std::string& tag_name="", const std::string& indent="") const;
friend ostream& operator<<(ostream& out, const bsmioSimulationInputData& obj) {
obj.print(out);
return out;
}
};
}
#endif //end of __bsmioSimulationInputData_H__
Listing 7 - Class generated for basin modeling input data
<!--<simulation-output xmlns="http://www.swamp.com/bsm"
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
xsd:schemaLocation="http://www.swamp.com/bsm bsm_simulation_output.xsd">-->
<?xml-stylesheet href="bsm_simulation_output.xsl" type="text/xsl"?>
<simulation-output>
<comment> RESULTS FILE FOR XML </comment>
<result>
<time>2.5</time>
<output-mesh>
<type>tetrahedra</type>
<number-of-nodes>8</number-of-nodes>
<number-of-elements>6</number-of-elements>
<position id='1' x='0.00000000e+00' y='0.00000000e+00' z='-1.31409706e+00'/>
<position id='2' x='1.00000000e+01' y='0.00000000e+00' z='-1.31409706e+00'/>
<position id='3' x='0.00000000e+00' y='1.00000000e+01' z='-1.31409706e+00'/>
<position id='4' x='1.00000000e+01' y='1.00000000e+01' z='-1.31409706e+00'/>
<position id='5' x='1.00000000e+01' y='0.00000000e+00' z='-1.00000000e+00'/>
<position id='6' x='0.00000000e+00' y='0.00000000e+00' z='-1.00000000e+00'/>
<position id='7' x='1.00000000e+01' y='1.00000000e+01' z='-1.00000000e+00'/>
<position id='8' x='0.00000000e+00' y='1.00000000e+01' z='-1.00000000e+00'/>
<element id='1'><node-ids>4 1 0 3</node-ids></element>
<element id='2'><node-ids>4 0 5 3</node-ids></element>
<element id='3'><node-ids>4 5 6 3</node-ids></element>
<element id='4'><node-ids>7 0 2 3</node-ids></element>
<element id='5'><node-ids>7 5 0 3</node-ids></element>
<element id='6'><node-ids>7 6 5 3</node-ids></element>
</output-mesh>
<output-data>
<name>pressure</name>
<dependence>node</dependence>
<value id='1'>3.14210616e+01</value>
<value id='2'>3.14210616e+01</value>
<value id='3'>3.14210616e+01</value>
<value id='4'>3.14210616e+01</value>
<value id='5'>0.00000000e+00</value>
<value id='6'>0.00000000e+00</value>
<value id='7'>0.00000000e+00</value>
<value id='8'>0.00000000e+00</value>
</output-data>
<output-data>
<name>temperature</name>
<dependence>node</dependence>
<value id='1'>7.85258292e+00</value>
<value id='2'>7.85258292e+00</value>
<value id='3'>7.85258292e+00</value>
<value id='4'>7.85258292e+00</value>
<value id='5'>0.00000000e+00</value>
<value id='6'>0.00000000e+00</value>
<value id='7'>0.00000000e+00</value>
<value id='8'>0.00000000e+00</value>
</output-data>
<output-data>
<name>sload</name>
<dependence>node</dependence>
<value id='1'>5.92279094e+01</value>
<value id='2'>5.92279094e+01</value>
<value id='3'>5.92279094e+01</value>
<value id='4'>5.92279094e+01</value>
<value id='5'>0.00000000e+00</value>
<value id='6'>0.00000000e+00</value>
<value id='7'>0.00000000e+00</value>
<value id='8'>0.00000000e+00</value>
</output-data>
<output-data>
<name>cell-porosity</name>
<dependence>cell</dependence>
<value id='1'>4.45479767e-01</value>
<value id='2'>4.63653178e-01</value>
<value id='3'>4.81826589e-01</value>
<value id='4'>4.45479767e-01</value>
<value id='5'>4.63653178e-01</value>
<value id='6'>4.81826589e-01</value>
</output-data>
<output-data>
<name>facies</name>
<dependence>cell</dependence>
<value id='1'>1</value>
<value id='2'>1</value>
<value id='3'>1</value>
<value id='4'>1</value>
<value id='5'>1</value>
<value id='6'>1</value>
</output-data>
<output-data>
<name>elementid</name>
<dependence>cell</dependence>
<value id='1'>1</value>
<value id='2'>2</value>
<value id='3'>3</value>
<value id='4'>4</value>
<value id='5'>5</value>
<value id='6'>6</value>
</output-data>
</result>
</simulation-output>
Listing 8 - Partial result output of basin modeling
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:key name="variable-names" match="value" use="@id"/>
<xsl:template match="/">
<xsl:for-each select="simulation-output/result">
<xsl:apply-templates select="time"/>
<xsl:text>
</xsl:text>
<xsl:if test="count(output-data/dependence['node']) > 0">
<xsl:text>node </xsl:text>
</xsl:if>
<xsl:for-each select="output-data">
<xsl:if test="dependence='node'">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
<xsl:variable name="node-count" select="count(output-mesh/position)"/>
<xsl:text>
</xsl:text>
<xsl:call-template name="print-values">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count"><xsl:value-of select="$node-count"/></xsl:with-param>
<xsl:with-param name="dependence-value">node</xsl:with-param>
</xsl:call-template>
<xsl:text>
</xsl:text>
<xsl:if test="count(output-data/dependence['node']) > 0">
<xsl:text>cell </xsl:text>
</xsl:if>
<xsl:for-each select="output-data">
<xsl:if test="dependence='cell'">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:variable name="cell-count" select="count(output-mesh/element)"/>
<xsl:call-template name="print-values">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count"><xsl:value-of select="$cell-count"/></xsl:with-param>
<xsl:with-param name="dependence-value">cell</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<xsl:template match="time">
Time <xsl:value-of select="."/> My:
</xsl:template>
<xsl:template match="output-data">
<xsl:value-of select="name"/><xsl:value-of select="' '"/>
</xsl:template>
<!-template to print value of variables for the selected index i
Parameters:
i
- index of the variable
count
- total number of values for variables
dependence-value - data dependence either 'cell' or 'node'
-->
<xsl:template name="print-values">
<xsl:param name="i"/>
<xsl:param name="count"/>
<xsl:param name="dependence-value"/>
<xsl:if test="$i <= $count">
<!--print cell index -->
<xsl:value-of select="$i"/><xsl:text> </xsl:text>
<!-- print value of each variable for this index -->
<xsl:for-each select="output-data">
<xsl:if test="dependence=$dependence-value">
<xsl:value-of select="value[position()=$i]"/><xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
</xsl:text>
<!-- recursively calling print-values and increment index count by one -->
<xsl:call-template name="print-values">
<xsl:with-param name="i"><xsl:value-of select="$i+1"/></xsl:with-param>
<xsl:with-param name="count"><xsl:value-of select="$count"/></xsl:with-param>
<xsl:with-param name="dependence-value"><xsl:value-of select="$dependence-value"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Listing 9 XSL stylesheet to transform simulation result document
Time 2.5 My:
node
1
2
3
4
5
6
7
8
pressure
3.14210616e+01
3.14210616e+01
3.14210616e+01
3.14210616e+01
0.00000000e+00
0.00000000e+00
0.00000000e+00
0.00000000e+00
cell cell-porosity
1 4.45479767e-01
2 4.63653178e-01
3 4.81826589e-01
4 4.45479767e-01
5 4.63653178e-01
6 4.81826589e-01
temperature
7.85258292e+00
7.85258292e+00
7.85258292e+00
7.85258292e+00
0.00000000e+00
0.00000000e+00
0.00000000e+00
0.00000000e+00
sload
5.92279094e+01
5.92279094e+01
5.92279094e+01
5.92279094e+01
0.00000000e+00
0.00000000e+00
0.00000000e+00
0.00000000e+00
facies elementid
1
1
1
2
1
3
1
4
1
5
1
6
Listing 10- XSLT partially transformed result of XML document in Listing 7
© Copyright 2026 Paperzz