Altova StyleVision 2024 Enterprise Edition

Property: FirstXMLData as XMLData



Set or get the first XMLData element in the underlying document that is partially, or completely selected by the range. The exact beginning of the selection is defined by the FirstXMLDataOffset attribute.


Whenever you set FirstXMLData to a new data object, FirstXMLDataOffset gets set to the first cursor position inside this element. Only XMLData objects that have a cursor position may be used. If you set FirstXMLData / FirstXMLDataOffset selects a position greater then the current LastXMLData / LastXMLDataOffset, the latter gets moved to the new start position.


HINT: You can use the FirstXMLData and LastXMLData properties to directly access and manipulate the underlying XML document in those cases where the methods available with the AuthenticRange object are not sufficient.




The authentic range object, or its related view object is not valid.


Invalid address for the return parameter was specified.


Internal error


The XMLData object cannot be accessed.



' -----------------------------------------------

' Scripting environment - VBScript

' show name of currently selected XMLData element

' -----------------------------------------------

Dim objAuthenticView

' we assume that the active document is open in authentic view mode

Set objAuthenticView = Application.ActiveDocument.AuthenticView


Dim objXmlData

Set objXMLData = objAuthenticView.Selection.FirstXMLData

' authentic view adds a 'text' child element to elements

' of the document which have content. So we have to go one

' element up.

Set objXMLData = objXMLData.Parent

MsgBox "Current selection selects element " & objXMLData.Name

© 2018-2024 Altova GmbH