xml spy
Zurück  Nach oben  Weiter

Authentic.CurrentSelection


Siehe auch

 

Deklaration: CurrentSelection als AuthenticSelection

 

Beschreibung

Die Eigenschaft verschafft Zugriff auf die aktuelle Auswahl in der Authentic-Ansicht.

 

Mit dem unten gezeigten Beispielcode wird der komplette Text der aktuellen Auswahl abgerufen:

 

JavaScript:

 

       // somewhere in your script:

       GetSelection(objPlugIn.CurrentSelection);

 

       // GetSelection() collects complete text selection

       function GetSelection(objSel)

       {        

               var strText = "";

       

               var objCurrent = objSel.Start;

               

               while(!objSel.End.IsSameNode(objCurrent))

               {

                       objCurrent = objPlugIn.GetNextVisible(objCurrent);

                       strText += objCurrent.TextValue;

               }

               

               strText += objSel.End.TextValue.substring(0,objSel.EndTextPosition);

               return objSel.Start.TextValue.substr(objSel.StartTextPosition) + strText;

       }


Zurück  Nach oben  Weiter

© 2007 Altova