Specifying Document Type for multiple namespaces
If importing a document that contains multiple namespaces, use the TreeSetPropData.pl utility to change the data in the Document Type property sheet field for a designated branch of objects within the document’s hierarchy.
For example, assume that your XML document contains the namespaces in the example below and that it was imported (using the Contenta Dynamic Import tool) with the Global Document Type field set to the value, SHAKES.
<?xml version="1.0" encoding="utf-8"?>
<Shakespeare:Article xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sdl.com/Shakespeare .\Shakespeare-play.xsd"
xmlns:Shakespeare="http://www.sdl.com/Shakespeare"
xmlns:play="http://www.sdl.com/play">
In this case, all child objects created and imported under the parent object for this document are imported with the Document Type property sheet field populated with the value SHAKES.
Also assume that:
- After importing your document, Shakespeare is the top level container object and Play is an object under Shakespeare with the tag, PLAY.
- You want to change the Document Type property sheet field for all objects in the hierarchy under and including the object Play to PLAY.
To do this, use the TreeSetPropData.pl utility. The file is located in the directory. The syntax and description for the TreeSetPropData.pl utility is shown below. Note that all switches are mandatory.
TreeSetPropData.pl -p path -pd “Document Type” -v value -s
socketnum -n node -d database -u sysadmin -pw password
| Switch | Description |
|---|---|
| -p path | Where path is the path to top level object whose Document Type property sheet is to be modified. Always begins /Global/sysadmin. For example: /Global/sysadmin/XyBooks,Inc./StableData/Shakespeare If any object in the path name contains spaces, enclose the object name in double-quotes. For example: /Global/sysadmin/”XyBooks, Inc.”/StableData/Shakespeare |
| -pd “Document Type” | Document Type is the name of the property sheet field to be modified. Include the double quotes; enter this switch as shown. |
| -v value | Where value is the value for Document Type—for example, PLAY. |
| -s socketnum | Where socketnum is the PcmPortal socket number. |
| -n node | Where node is the name of the Contenta Server. |
| -d database | Where database is the name of the Contenta database (or Oracle user). |
| -u sysadmin | Username, always sysadmin. |
| -pw password | Where password is the password for the sysadmin user. |
The command in the example below changes the Document Type property sheet field to PLAY, starting with the object Play in the hierarchy under XyBooks,Inc/StableData/Shakespeare. The command also specifies a login of sysadmin/xypw, the database name cetrain, the socket number 6050, and server nodename rosie.
For example, TreeSetPropData.pl -p /Global/sysadmin/XyBooks,Inc/StableData/Shakespeare/Play -pd “Document Type” -v PLAY -s 6050 -n rosie -d cetrain -u sysadmin -pw xypw