OperationThis document describes how to use the recommended Design Tool software packages to produce specific PDS product label schemas, which can then be used to generate product labels. In PDS4, product label schemas must conform to the XML Schema standard. The following diagram details the product label schema lifecycle: As depicted in the diagram above, generic product schemas are derived from the information model. These schemas can be used as templates for defining new products via specific schemas. The steps detailed in this section for producing a specific product label schema follow the steps (pretty closely) defined in section 6.0 - PDS4 Product Label Schema of the Data Providers' Handbook. In this section the steps have been narrowed down to the following: Select Generic SchemaThe first step is to select a generic product schema from the repository. The repository is located at http://pds.nasa.gov/schema/pds4/generic/common/. Generic schemas are available for several products (e.g., Grayscale Image, Character Table, etc.). Select the appropriate schema that corresponds with the data product to be described. In addition, download any ancillary schemas (e.g., base types, extended types, etc.) that are included in the selected generic schema. The examples in this document use schemas from version 0111c. A later version may be available from the repository. The following schemas are utilized in this example: Copy SchemaThe next step is to make a copy of the generic schema so that it can be tailored into a specific schema. This can be accomplished via the operating system (e.g., cp …) or via your XML Editor of choice. For this example, the Product_Table_Character_0111c.xsd is renamed to My_Product_Table_Character_0111c.xsd. Tailor SchemaThe next step involves tailoring the newly named specific schema. Options for tailoring include:
Launch your XML Editor of choice. If using Eclipse, you should first change to the XML perspective:
Select the Other... menu item and then XML from the resulting list to enter the XML perspective. Create ProjectCreate a new project for managing the specific schema tailoring. In Eclipse, navigate to the File menu, select the New menu item followed by the Project... menu item as follows:
Select the Project item from the list on the New Project popup window and then select the Next button. Enter a name for the project and select the Finish button to create the project. Although Eclipse prompts the user for a project name, Oxygen defaults to newProject. In Oxygen, the project can be named later using the Save As feature. In Oxygen, navigate to the Project menu, select the New Project menu item as follows:
Load SchemasLoad the schema files into the project. In both applications, the user can drag-and-drop the files into the project list. The alternative in Eclipse, is to right-click the project name from the project list and select the Import… menu item as follows:
Select the File System item from the list in the Import popup window and then select the Next button. Specify the target schemas for import and then select the Finish button to import the schemas into the project. In Oxygen, right-click the project name from the project list and select the Add Files menu item as follows:
Specify the target schemas, one by one, for import and then select the Open button to import each schema into the project. Modify SchemaOpen the My_Product_Table_Character_0111c.xsd schema file by double-clicking the file name from the project file list or navigating to the File menu and selecting the Open... menu item. In Eclipse, change from Design view to Source view. In Oxygen, change from Schema view to Text view. Now that the file is open, the first modification is to change the name within the schema to correspond with the file name change. Find instances of Product_Table_Character and replace them with My_Product_Table_Character. In Eclipse, navigate to the Edit menu and select the Find/Replace... menu item. In Oxygen, navigate to the Find menu and select the Find/Replace... menu item. This is where the assorted modifications listed at the beginning of this section can be made. Validate SchemaAlthough both applications notify the user real-time when the active schema file is not valid, the schema can be validated using the XML Editor’s validate feature. Example errors could include typos or non-XML conformant entries or missing element definitions. In order to initiate validation, right-click the file name from the project file list and select the Validate or Validate Selection menu item in Eclipse and Oxygen, respectively. In Eclipse, the pulldown menu and resulting window are as follows:
In Oxygen, the pulldown menu and resulting window are as follows:
After a few or many iterations of modifying the specific schema, save the completed specific schema. Create Sample LabelCreate a sample label in XML from the tailored specific schema. In Eclipse, right-click the file name from the project list and select the Generate->XML File … menu item as follows:
Select the Create optional attributes and Create optional elements check boxes on the New XML File popup window. In addition, edit the namespace entry and blank out the prefix for the namespace. Select the OK button in the New Namespace Information popup window and then select the Finish button on the New XML File popup window to generate the sample label. In Oxygen, right-click the file name from the project list and select the Generate Sample XML Files… menu item as follows:
Select the OPTIONS tab on the Generate Sample XML Files popup window and then select the Generate optional elements and Generate optional attributes check boxes. Select the OK button to generate the sample label. The generated XML sample label is conformant with the My_Product_Table_Character_0111c.xsd schema.
|