PEF XML is intended to be a format for exchanging data that is stored in, or mapped to, Epicentre. It has been developed with the intent of describing this mapping with a few, simple rules.
The purpose of this document is to give a step-by-step procedure to generate the XML. The result of following these rules should lead to a consistent XML that can be readily produced and interpreted.
In order to do the mapping, you must know how your data maps to Epicentre:
In order to help with this effort, the leaf_ent_att.txt file may be downloaded. This file is a four column list that contains the entity name, attribute name, underlying data type, and ndt (or instance reference) information. The first three columns are the information mentioned above, but the fourth column may be useful also.
In the simplest form, the header lines of the XML file are the following:
<?xml version="1.0"?>
<!DOCTYPE defineIDs [
<!ATTLIST uomReference uid ID #REQUIRED>
<!ATTLIST UnitOfMeasure uid ID #REQUIRED>
]>
<PEFExchange
xmlns="http://www.posc.org/pef"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.posc.org/pef
http://www.posc.org/pef/peftypes.xsd">
These lines do the following (You do not need to understand these):
The PEF Objects Block is the XML version of the PEF Objects, as defined in the Data Exchange specification. These objects were mapped into the XML to insure completeness of information, with respect to the exchange file. However, these are not normative, and are intended to be used only if they are of use to the exchange. The information contained in these is given by the Data Exchange Specification, and is not repeated here. The XML Schema that governs these objects may be viewed in the file daeents.xsd.
This block of information is optional and may be omitted.
It is mandatory that a block of information be given that defines the units of measure that appear in the file. The block should appear as follows:
<UomBlock>
<uomReference uid="xxx1" To="http://www.posc.org/pef/poscDict.xml#yyy1"/>
<uomReference uid="xxx2" To="http://www.posc.org/pef/poscDict.xml#yyy2"/>
...
</UomBlock>
where "xxx1", "xxx2", etc. represent the uom attribute value that is used to refer to this unit of measure within the file, and "yyy1", "yyy2", etc. represent the uid attribute value in the poscDict.xml file. For example, if you have a quantity value in you PEF exchange file:
<quantity uom="#ft">which is intended to represent an International Foot, you would have, in the UomBlock,
<uomReference uid="ft" To="http://www.posc.org/pef/poscDict.xml#ft">because the "ft" portion of the uomReference element will pick out the appropriate definition of the unit of measure.
Because of the restrictions of the URL referencing, the unit of measure symbol may differ from the symbol used for referencing. In particular, the slash (/) mark cannot be used. Thus, the unit of measure, ft/s, would be referenced using ftPs. The file, uommatch.txt contains this information. The first column gives the reference that is to be used, and the second column is the POSC Epicentre symbol for the unit of measure.
You may download the poscDict.xml file.
Begin with the tag, ExchangeData:
<ExchangeData>
Then, for each Epicentre instance to be recorded in the XML file, you must follow the pattern:
<ENTITY_NAME> !all uppercase
!then, for each attribute,
<attribute_name> !all lowercase
<datatype> !such as string, real, instance, etc.
... !whatever is needed for the datatype
</datatype> !close off every tag
</attribute_name>
... !other attributes in the same instance
</ENTITY_NAME>
The order of the Entities, and the order of the attributes within each entity is not important. At the end of the data, you must close the ExchangeData tag:
</ExchangeData>
</PEFExchange>
A sample is given in pefExample.xml.
The schema for the PEFExchange application is found in the file PEFxml.xsd. This file includes two other schemas, pefents.xsd and daeents.xsd, which define the schemas for all the Epicentre entities (the ExchangeData block) and all the DAE objects (the PEFObjects block). None of these three schemas are included in the schema referenced in the file header: peftypes.xsd. Why are we bypassing the main schemas?
A Schema has two main uses. One is to serve as a specification for XML files that are to use it. For this purpose, the full XML schema has been developed for a PEF exchange file for Epicentre 3.0. This full specification gives the overall structure of the file (the PEFxml.xsd file). It also gives the structure of the PEF Objects information (the daeents.xsd file). This structure was defined for informative purposes only in this specification. It also gives the list of all the entities and the attributes in Epicentre 3.0 (the pefents.xsd file).
This third file, pefents.xsd, is too large (1.56 Mbytes). The file is so large that many validators will not be able to validate the input xml file against this large schema file. Thus, it is not feasible to include the entire schema in the validation process.
In addition, the pefents.xsd file is particular to the 3.0 version of Epicentre. If it were included in the header for the validation, the xml file generated from version 2.2, or any other version of Epicentre, may not work. For these reasons, the validation is done only on the pef datatypes (which are the normative part of the recommendation).
The second use of a Schema is to specify the structure of an xml file. Even if the schema is not invoked to validate the file, it remains as a formal specification of the structure of the xml file. Thus, the schema becomes a specification document, in addition to a potential validation document.
use is to validate the structure and completeness of the XML file that references it.