Sample Replace scriptlets are provided with the Astoria system.
Sample Replace scriptlets are included in starScriptlets.py.
Adds a snapshot label (approvalLabel) to the current object. If specified, the approvalDateStr specifies a cryptic numeric time string. Contact Astoria Support for assistance.
For example, use addApprovalLabel("Omega")
to add a snapshot label Omega.
Adds a <platform> element as the last child of the context (e.g. <prodinfo>) element. The content of the platform element will be the value of the platformStr parameter.
Given a productStr (for example, new-shared-product
) and a version string (for example, 10.2
), adds a <prodinfo> element with appropriate child elements having the specified values before <othermeta> if present, or as the last child of the context (<metadata>) object.
Given a versionStr (for example, 10.2
), adds a <vrm> element as the last child of the context element.
Adds the specified XML fragment at the specified position, relative to the content object. The XML fragment will be made a child of the context element.
addXML('<p class="fooClass">Hello <i>World</i></p>')
<p>Hello <b>World</b></p>
<p>First paragraph</p><p>Second paragraph</p>
hello <b>World</b>, how are you?
“http://shrike/astoria/_id_00000018WIA33D06910GYZ_conrefA1.dita#conrefA/para”
Use this value in the XML fragment string: <conref href="http://shrike/astoria/_id_00000018WIA33D06910GYZ_conrefA1.dita#conrefA/para/">
You can also use the folder item path syntax instead of the ID syntax: <conref href=http://shrike/astoria/DITA/Translation Testing/Approval/conrefA1.dita#conrefA/para/>
In either case, it is critical that you include the trailing fragment string (#conrefA/para
), if you wish to reference a specific element.<image href="http://shrike/astoria/DITA/Translation Testing/Effectivity/basediag3.gif"/>
The Replace With parameter specifies the optionalGUID and optionalFragmentIDs of the replacement document.
optionalGUID value | optionalFragmentIDs value | Results |
---|---|---|
None | None | Invalid |
None | newID/subID | A different element in the same document is targeted. |
newGUID | None | The element in a new replacement document having the same id/subid is targeted. |
newGUID | newId/subId | The element with the specified newId/subId in the new replacement document is targeted. |
Sets custom attribute values.