Skip to content

Discussion: Provide NodeNavigator interface to get native data #77

@srebhan

Description

@srebhan

When using the xpath library with data-formats that know the data-type of a node (e.g. JSON or Protocol buffer it would be nice to have access to this native underlying value. This has the benefit of being able to parse data with unknown a-priori format and/or data-types.

The above can be done by adding an interface

type NodeNavigatorNativeData interface {
	// NativeValue gets the native value of current node.
	NativeValue() interface{}
}

or, alternatively, change the return type of Value() in the NodeNavigator interface. The naming is subject to discussion.

Please let me know what you think and I can submit a PR for either way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions