Altova Authentic 2024 Browser Edition

Authentic.GetAllAttributes

Home Prev Top Next

See also

 

Declaration: GetAllAttributes(pForElement as XMLData, pElements as Variant)

 

Description

GetAllAttributes() returns the allowed attributes for the specified element as an array of strings.

 

JavaScript example:

 

 function GetAttributes()

 {

         var arrElements = new Array(1);

 

         var objStart = objPlugIn.CurrentSelection.Start;

 

         var strText;

         strText = "Valid attributes at current selection:\";

 

         for(var i = 1;i <= 4;i++)

         {

                 objPlugIn.GetAllAttributes(objStart, 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 DisplayAllowedAttributes

         dim arrElements()

 

         dim objStart

         dim objEnd

         set objStart = objPlugIn.CurrentSelection.Start

         set objEnd = objPlugIn.CurrentSelection.End

 

         dim strText

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

 

         dim i

 

         For i = 1 To 4

                 objView.GetAllAttributes objStart, 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