ASSERT(0);
}
+uns
+xml_next_state(struct xml_context *ctx, uns pull)
+{
+ uns saved = ctx->pull;
+ ctx->pull = pull;
+ uns res = xml_next(ctx);
+ ctx->pull = saved;
+ return res;
+}
+
+uns
+xml_skip_element(struct xml_context *ctx)
+{
+ ASSERT(ctx->state == XML_STATE_STAG);
+ struct xml_node *node = ctx->node;
+ uns saved = ctx->pull, res;
+ ctx->pull = XML_PULL_ETAG;
+ while ((res = xml_next(ctx)) && ctx->node != node);
+ ctx->pull = saved;
+ return res;
+}
+
uns
xml_parse(struct xml_context *ctx)
{
/* Parse with the PUSH interface, return XML_STATE_x (zero on EOF or fatal error) */
uns xml_next(struct xml_context *ctx);
+/* Equivalent to xml_next, but with temporarily changed ctx->pull value */
+uns xml_next_state(struct xml_context *ctx, uns pull);
+
+/* May be called on XML_STATE_STAG to skip it's content; can return XML_STATE_ETAG or XML_STATE_EOF on fatal error */
+uns xml_skip_element(struct xml_context *ctx);
+
/* Returns the current row number in the document entity */
uns xml_row(struct xml_context *ctx);