Altova XMLSpy 2025 Professional Edition

Superseded by AuthenticRange.PerformAction

 

Use spyAuthenticApply for the eAction parameter. The PerformAction method allows to apply text state attributes to any range of the document, not only the current UI selection.

 

// ----- javascript sample -----

// instead of:

// Application.ActiveDocument.DocEditView.ApplyTextState ("bold");

// use now:

if (! Application.ActiveDocument.AuthenticView.Selection.PerformAction (spyAuthenticApply, "bold"))

   MsgBox ("Error: can't set current selection to bold");

 

Declaration: ApplyTextState (elementName as String)

 

Description

Applies or removes the text state defined by the parameter elementName. Common examples for the parameter elementName would be strong and italic.

 

In an XML document there are segments of data, which may contain sub-elements. For example consider the following HTML:

 

 <b>fragment</b>

 

The HTML tag <b> will cause the word fragment to be bold. However, this only happens because the HTML parser knows that the tag <b> is bold. With XML there is much more flexibility. It is possible to define any XML tag to do anything you desire. The point is that it is possible to apply a Text state using XML. But the Text state that is applied must be part of the schema. For example in the OrgChart.xml,  OrgChart.sps, OrgChart.xsd example the tag <strong> is the same as bold. And to apply bold the method ApplyTextState() is called. But like the row and edit operations it is necessary to test if it is possible to apply the text state.

 

See also IsTextStateEnabled and IsTextStateApplied.

 

 

 

© 2018-2024 Altova GmbH