Altova Authentic 2024 Browser Edition

Siehe auch

 

Deklaration: GetAllAttributes(pForElement als XMLData, pElements als Variant)

 

Beschreibung

GetAllAttributes() gibt die für das angegebene Element zulässigen Attribute als String-Array zurück.

 

JavaScript-Beispiel:

 

 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-Beispiel:

 

 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

 

© 2018-2024 Altova GmbH