2016

Table Of Contents
ConstructFileRequest
ConstructStreamRequest
To construct a new QuarkXPress project by editing an existing document, first deconstruct a
QuarkXPress project using code like the following:
XMLRequest dcnstrq = new XMLRequest();
rc.request = dcnstrq;
Next, alter the project by manipulating the XML. When you're done, pass the modified XML
document to ConstructStreamRequest to create a new QuarkXPress project. For example:
ConstructStreamRequest cnstrq =
new ConstructStreamRequest();
cnstrq.modify = Buffer; // Byte[] for the modified XML
rc.request = cnstrq;
QuarkXPressRenderRequest qxprq =
new QuarkXPressRenderRequest();
cnstrq.request = qxprq;
Alternatively, you can deconstruct a QuarkXPress project using code like the following:
RequestServiceService svc =
new RequestServiceService()
Project proj = svc.getDOM("document.qxp");
Next, alter the project by manipulating the XML. When you're done, pass the modified Project
instance to ConstructRequest to create a new QuarkXPress project. For example:
ConstructRequest cnstrq =
new ConstructRequest();
cnstrq.project = proj;
QRequestContext rc = new QRequestContext();
rc.request = cnstrq;
QuarkXPressRenderRequest qxprq =
new QuarkXPressRenderRequest();
cnstrq.request = qxprq;
The construct namespace takes two arguments: The name of the project to be created and a
modify parameter with the string or the path of the XML file that describes how to create the
project:
http://localhost:8080/qxpdoc/construct/project1.qxp?
modify=file:path to XML file on server
http://localhost:8080/qxpdoc/construct/project1.qxp?
modify=<xml-string>
Notes
Construct and modify
The modify parameter lets you modify existing projects. For example:
http://QXPServer8:8080/project1.qxp?
modify=file:path to XML file on server
or:
http://QXPServer8:8080/project1.qxp?modify=XML string
It's important to understand that although the construct namespace uses the same
DTD that you use when you modify an existing project, the construct namespace
uses it differently. When you use the construct namespace, the XML you pass simply
contains a description of everything in the document you want to create much as
an HTML file describes a page you want to display in a browser. There is no need to
use a command and create elements such as ADDCELLS, OPERATION, and MOVERIGHT;
you simply describe each item in the layout with elements such as <BOX> and <TABLE>,
and specify each item's position with the <POSITION> element type. When you use
the modify attribute without the construct namespace, however, the XML you pass
A GUIDE TO QUARKXPRESS SERVER 2016 | 111
USING QUARKXPRESS SERVER