Create an XML schema that identifies the type of data in the XML files, and upload the schema to Prinergy RBA.
The complete syntax is:
<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
..<element name="Job">
....<complexType>
......<all minOccurs="1">
........<element name="JobName" type="string" />
........<element name="InputFile" type="string" />
........<element name="ProcessTemplateRefine" type="string" />
........<element name="ProcessTemplateOutput" type="string" />
........<element name="EmailProcessError" type="string" />
........<element name="EmailOutputSuccess" type="string" />
........</all>
....</complexType>
..</element>
</schema>
For information about writing XSDs, see https://www.w3.org/XML/Schema.
- Create a text file, and add the following required tags.
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
...
</schema>
The first line identifies a specific XML language version and character coding. The<schema>
tag identifies the specific W3C standard that the schema follows. - Create the main element in the schema-a job.
<element name="Job">
...
</element>
A schema must have only one root element, which is the object that the schema is describing. - Define the data type of the main element.
<complexType>
...
</complexType>
Since the job contains other elements, its data type iscomplex
, which is defined using a separate element inside the job element. - Create the elements of the job, including the job name, input file from the customer, process templates required to refine the customer file and print it, and email addresses that receive messages when errors occur and when the job is successfully printed.
<element name="JobName" />
<element name="InputFile" />
<element name="ProcessTemplateRefine" />
<element name="EmailProcessError" />
<element name="EmailOutputSuccess" />
- Define the data type of the child elements.
<element name="JobName" type="string" />
<element name="InputFile" type="string" />
<element name="ProcessTemplateRefine" type="string" />
<element name="ProcessTemplateOutput" type="string" />
<element name="EmailProcessError" type="string" />
<element name="EmailOutputSuccess" type="string" />
Since the child elements do not contain other elements, the type can be defined within the tag. Since these elements will contain words or phrases, their data type isstring
. - Wrap the elements with a tag that makes them all required.
<all minOccurs="1">
...
</all>
- Save the text file with the file name extension
.xsd
. - Create a test XML that matches the schema.
For example:<?xml version="1.0" encoding="utf-8"?>
<Job>
..<JobName>MyJob</JobName>
..<InputFile>\\MyServer\MyFolder\MyCustomerFile.pdf</InputFile>
..<ProcessTemplateRefine>Refine:Refine:1stRef-Normz</
ProcessTemplateRefine>
..<ProcessTemplateOutput>Loose Page Proof:Virtual Proof:Virtual
Proof.LoosePage</ProcessTemplateOutput>
..<EmailProcessError>test@kodak.com</EmailProcessError>
..<EmailOutputSuccess>test@kodak.com</EmailOutputSuccess>
</Job>
- Add the schema to the Prinergy system:
- In Rule Set Manager, select Tools > XML Schema Manager.
- (Optional) Click Add a Group to add a group to contain the schema. Type a name, click the parent group in the Groups list on the left, and click Create.
- Click Add a Schema. Type a name, and click a group in the Groups menu on the left. Click the Browse button next to the Schema File box, select the schema (
.xsd
) file, and click Open. Click Add Schema.
You can ignore the TransformFile box, which applies only when the XML files are in JDF format and you must add an
.xslt
file that transforms them into the simpler XML format used in RBA.
The schema now appears in the Schema Name list in Rule Parameters Editor for the Read XML action. - Use XML Schema Manager to test the XML file against the schema, and ensure that RBA can read the XML file.