Altova Authentic 2024 Browser Edition

Authentic.GetAllowedElements

Home Prev Top Next

See also

 

Declaration: GetAllowedElements(nAction as SPYAuthenticElementActions,pStartElement as XMLData,pEndElement as XMLData,pElements as Variant)

 

Description

GetAllowedElements() returns the allowed elements for the various actions specified by nAction.

 

 

JavaScript example:

 

 function GetAllowed()

 {

         var arrElements = new Array(1);

 

         var objStart = objPlugIn.CurrentSelection.Start;

         var objEnd = objPlugIn.CurrentSelection.End;

 

         var strText;

         strText = "valid elements at current selection:\";

 

         for(var i = 0;i <= 4;i++)        {

                 objPlugIn.GetAllowedElements(i,objStart,objEnd,arrElements);

                 strText = strText + ListArray(arrElements) + "------------------\";

         }

 

         return strText;

 }

 

 function ListArray(arrIn)

 {

         var strText = "";

 

         if(typeof(arrIn) == "object")        {

                 for(var i = 0;i <= (arrIn.length - 1);i++)

                         strText = strText + arrIn[i] + "\";

         }

 

         return strText;

 }

 

VBScript example:

 

 Sub DisplayAllowed

         dim arrElements()

 

         dim objStart

         dim objEnd

         set objStart = objPlugIn.CurrentSelection.Start

         set objEnd = objPlugIn.CurrentSelection.End

 

         dim strText

         strText = "Valid elements at current selection:" & chr(13) & chr(13)

 

         dim i

 

         For i = 1 To 4

                 objView.GetAllowedElements i,objStart,objEnd,arrElements

                 strText = strText & ListArray(arrElements) & "---------------" & chr(13)

         Next

 

         msgbox strText

 End Sub

 

 Function ListArray(arrIn)

         dim strText

 

         If IsArray(arrIn) Then

                 dim i

 

                 For i = 0 To UBound(arrIn)

                         strText = strText & arrIn(i) & chr(13)

                 Next

         End If

 

         ListArray = strText

 End Function

 

© 2017-2023 Altova GmbH