plugins types FEATURE support explicit xpath transformation
diff --git a/src/plugins_types.h b/src/plugins_types.h
index 812cf05..3ec1d3b 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -33,6 +33,7 @@
struct ly_path;
struct lyd_node;
struct lyd_value;
+struct lyd_value_xpath10;
struct lys_module;
struct lys_glob_unres;
struct lysc_ident;
@@ -447,6 +448,19 @@
LIBYANG_API_DECL void lyplg_type_lypath_free(const struct ly_ctx *ctx, struct ly_path *path);
/**
+ * @brief Print xpath1.0 value in the specific format.
+ *
+ * @param[in] xp_val xpath1.0 value structure.
+ * @param[in] format Format to print in.
+ * @param[in] prefix_data Format-specific prefix data.
+ * @param[out] str_value Printed value.
+ * @param[out] err Error structure on error.
+ * @return LY_ERR value.
+ */
+LIBYANG_API_DECL LY_ERR lyplg_type_print_xpath10_value(const struct lyd_value_xpath10 *xp_val, LY_VALUE_FORMAT format,
+ void *prefix_data, char **str_value, struct ly_err_item **err);
+
+/**
* @defgroup plugintypestoreopts Plugins: Type store callback options.
*
* Options applicable to ::lyplg_type_store_clb().
diff --git a/src/plugins_types/xpath1.0.c b/src/plugins_types/xpath1.0.c
index 7f04c12..6d24aa4 100644
--- a/src/plugins_types/xpath1.0.c
+++ b/src/plugins_types/xpath1.0.c
@@ -216,18 +216,8 @@
return ly_err_new(err, LY_EMEM, LYVE_DATA, NULL, NULL, "No memory.");
}
-/**
- * @brief Print xpath1.0 value in the specific format.
- *
- * @param[in] xp_val xpath1.0 value structure.
- * @param[in] format Format to print in.
- * @param[in] prefix_data Format-specific prefix data.
- * @param[out] str_value Printed value.
- * @param[out] err Error structure on error.
- * @return LY_ERR value.
- */
-static LY_ERR
-xpath10_print_value(const struct lyd_value_xpath10 *xp_val, LY_VALUE_FORMAT format, void *prefix_data,
+LIBYANG_API_DEF LY_ERR
+lyplg_type_print_xpath10_value(const struct lyd_value_xpath10 *xp_val, LY_VALUE_FORMAT format, void *prefix_data,
char **str_value, struct ly_err_item **err)
{
LY_ERR ret = LY_SUCCESS;
@@ -311,7 +301,7 @@
case LY_VALUE_SCHEMA_RESOLVED:
case LY_VALUE_XML:
/* JSON format with prefix is the canonical one */
- ret = xpath10_print_value(val, LY_VALUE_JSON, NULL, &canon, err);
+ ret = lyplg_type_print_xpath10_value(val, LY_VALUE_JSON, NULL, &canon, err);
LY_CHECK_GOTO(ret, cleanup);
ret = lydict_insert_zc(ctx, canon, &storage->_canonical);
@@ -439,7 +429,7 @@
}
/* print in the specific format */
- if (xpath10_print_value(val, format, prefix_data, &ret, &err)) {
+ if (lyplg_type_print_xpath10_value(val, format, prefix_data, &ret, &err)) {
if (err) {
LOGVAL_ERRITEM(ctx, err);
ly_err_free(err);