combit List & Label 30 - .NET Help
combit.Reporting.DataProviders Namespace / XmlDataProvider Class / PreParseXPathNavigator Event
Example


PreParseXPathNavigator Event
Allows to override the default data type parsing behavior.
Syntax
'Declaration
 
Public Event PreParseXPathNavigator As EventHandler(Of PreParseXPathNavigatorEventArgs)
 
Event Data

The event handler receives an argument of type PreParseXPathNavigatorEventArgs containing data related to this event. The following PreParseXPathNavigatorEventArgs properties provide information specific to this event.

PropertyDescription
XPathNavigator  
Current content of the node.  
Automatically parsed data type.  
Skip default processing.  
Example
XmlDataProvider provider = new XmlDataProvider(xmlDocument);
provider.PreParseXPathNavigator += new EventHandler<PreParseXPathNavigatorEventArgs>(provider_PreParseXPathNavigator);
...
void provider_PreParseXPathNavigator(object sender, PreParseXPathNavigatorEventArgs e)
{
    if (e.Navigator.Name == "ZIP")
    {
        e.ParsedType = typeof(string);
        e.ParsedContent = e.Navigator.ValueAs(typeof(string));
        e.SkipDefaultProcessing = true;
    }
}
Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also