Altova Authentic 2024 Browser Edition

Authentic.GetAllAttributes

Inicio Anterior Inicio Siguiente

Declaración GetAllAttributes(pForElement as XMLData, pElements as Variant)

 

Descripción

GetAllAttributes() devuelve los atributos permitidos para el elemento indicado en forma de matriz de cadenas.

 

Ejemplo de JavaScript:

 

 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;

 }

 

Ejemplo de VBScript:

 

 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