Skip to content

Commit

Permalink
Add a flag to control the use of identityref types with values
Browse files Browse the repository at this point in the history
A new flag SCH_F_IDREF_VALUES has been created to control the
addition of identityref information to leaf values.
  • Loading branch information
gcampbell512 authored and carlgsmith committed Jul 19, 2024
1 parent 3ace1d0 commit cfe9731
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions apteryx-xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ typedef enum
SCH_F_ADD_MISSING_NULL = (1 << 12), /* Add missing nodes with NULL values */
SCH_F_SET_NULL = (1 << 13), /* Set all nodes to NULL */
SCH_F_FILTER_RDEPTH = (1 << 14), /* Set filter based on depth value */
SCH_F_IDREF_VALUES = (1 << 15), /* Expand identityref based values to include type information */
} sch_flags;
GNode *sch_path_to_gnode (sch_instance * instance, sch_node * schema, const char * path, int flags, sch_node ** rschema);
bool sch_query_to_gnode (sch_instance * instance, sch_node * schema, GNode *parent, const char * query, int flags, int *rflags);
Expand Down
2 changes: 1 addition & 1 deletion schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -3593,7 +3593,7 @@ _sch_gnode_to_json (sch_instance * instance, sch_node * schema, xmlNs *ns, GNode
value = sch_translate_to (schema, value);
}

if (value)
if (value && (flags & SCH_F_IDREF_VALUES))
{
/* Check to see if the schema has any identityref information */
xmlChar *idref_module = xmlGetProp ((xmlNode *)schema, (const xmlChar *)"idref_module");
Expand Down

0 comments on commit cfe9731

Please sign in to comment.