The DB Schema and DB XML files
The DB XML Schema
When you load a non-XML database (non-XML DB) into StyleVision, an XML Schema with a structure based on that of the DB is generated by StyleVision and displayed in the Schema Tree window. (In the case of XML DBs, an existing schema (either stored in the DB or at a file location) is specified as the schema to be used in the SPS.) This section on schemas, therefore, refers only to non-XML DBs.
The XML Schema is created with a document element called DB. The DB element contains child elements which correspond to the top-level tables in the DB. These top-level table elements are also created as entries in the Global Elements list in the Schema Tree Window. The top-level elements in the screenshot below are: Address, Altova, Department, Office, and Person; they correspond to tables in the DB.
Each top-level table element may have an unlimited number of rows (see screenshot below). Each row corresponds to a record in the DB. In the schema tree the rows are represented by a single Row element. Each Row element has attributes which correspond to the fields of the table. One of these attributes is generated by StyleVision for every row of every table: AltovaRowStatus, which holds the current status of the row: added, updated, and/or deleted. The remaining attributes are the fields of the respective DB table.
Note: The structure of the generated XML Schema is as outlined above. Whatever tables are selected during the connection step are included in the structure. The construction of a DB Filter does not affect the structure of the XML Schema.
New DB Schema Structure
The structure of the XML Schema generated from DBs starting with the 2005 version of StyleVision is different than the structure generated in previous versions of StyleVision. The new structure enables the editing of databases in the Authentic View of Altova products—a feature which was not available with earlier versions. As a result, any SPS generated with earlier versions of StyleVision will generate an error when opened in versions of StyleVision starting from the 2005 version. To be able to use the DB editing and reporting features of StyleVision, you should recreate the SPS in the current version of StyleVision. |
DB XML data files
After a connection to the XML DB has been made, the XML schema and column with XML data selected, the Schema Tree window (screenshot below) will list the selected schema and the column that will be used for the Working XML File.
Two temporary XML files are generated from the DB (see DBs and StyleVision for an illustration):
•A temporary editable XML file, which can be edited in Authentic View
•A temporary non-editable XML File, which is used as the Working XML File (for previews and output generation)
The temporary editable XML file is generated when the DB is loaded into StyleVision. It can be edited in Authentic View after the SPS has been created. The display in Authentic View can be filtered by using the Query mechanism available in Authentic View. Any modification made in Authentic View to the editable data is written to this temporary XML File. Clicking File | Save Authentic XML Data saves the information in the temporary editable XML file to the DB.
The temporary non-editable XML file is generated when the DB is loaded into StyleVision. It is used as the Working XML File and for generating HTML, RTF, PDF, and Word 2007+ output. The editable XML file must be saved before changes made in Authentic View can be viewed in a preview.
Note:
•In the Authentic View of other Authentic View products (a graphical XML-document-editor available in the Altova products XMLSpy, Authentic Desktop, Authentic Browser, and StyleVision) only one temporary (editable) XML file is created when a DB-based SPS is opened. Modifications made in Authentic View are written to this file. When the file is saved, the information in the XML file is written to the DB.
•You can filter the data that goes into the non-editable temporary XML File for report-generation. (See Edit DB Filter for details.)
•You do not have to specifically assign a Working XML File in order to see HTML, Text, RTF, PDF, and Word 2007+ previews. The automatically generated (non-editable) temporary XML file is used for this purpose.