diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 12:49:44 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:04 +0200 |
commit | 280223756f343e717459f8d326fae0fced1adf1b (patch) | |
tree | 4446db139572726483f568780dc237ff3d9e2147 | |
parent | e87c35f42daa4e36cb31cc0152a3e5bcf68aa84d (diff) | |
download | serd-280223756f343e717459f8d326fae0fced1adf1b.tar.gz serd-280223756f343e717459f8d326fae0fced1adf1b.tar.bz2 serd-280223756f343e717459f8d326fae0fced1adf1b.zip |
Expand datatype of literal nodes in serd_env_expand_node
-rw-r--r-- | src/env.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -235,6 +235,18 @@ serd_env_expand_node(const SerdEnv* env, ret->n_bytes = len; return ret; } + case SERD_LITERAL: + if (serd_node_get_datatype(node)) { + SerdNode* datatype = serd_env_expand_node( + env, serd_node_get_datatype(node)); + if (datatype) { + SerdNode* ret = serd_node_new_literal( + serd_node_get_string(node), datatype, NULL); + serd_node_free(datatype); + return ret; + } + } + return NULL; case SERD_URI: return serd_node_new_resolved_uri_i( serd_node_get_string(node), &env->base_uri); |