From 76cfea4acb19ed99a31b84d1d6d3d83d1ac5f225 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 2 Sep 2014 22:51:20 +0200 Subject: xps: Add fz_xml_is_tag to simplify tag matching. --- source/xps/xps-doc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/xps/xps-doc.c') diff --git a/source/xps/xps-doc.c b/source/xps/xps-doc.c index e2058fbc..4bcf92cb 100644 --- a/source/xps/xps-doc.c +++ b/source/xps/xps-doc.c @@ -280,7 +280,7 @@ xps_parse_metadata_imp(xps_document *doc, fz_xml *item, xps_fixdoc *fixdoc) { while (item) { - if (!strcmp(fz_xml_tag(item), "Relationship")) + if (fz_xml_is_tag(item, "Relationship")) { char *target = fz_xml_att(item, "Target"); char *type = fz_xml_att(item, "Type"); @@ -297,7 +297,7 @@ xps_parse_metadata_imp(xps_document *doc, fz_xml *item, xps_fixdoc *fixdoc) } } - if (!strcmp(fz_xml_tag(item), "DocumentReference")) + if (fz_xml_is_tag(item, "DocumentReference")) { char *source = fz_xml_att(item, "Source"); if (source) @@ -308,7 +308,7 @@ xps_parse_metadata_imp(xps_document *doc, fz_xml *item, xps_fixdoc *fixdoc) } } - if (!strcmp(fz_xml_tag(item), "PageContent")) + if (fz_xml_is_tag(item, "PageContent")) { char *source = fz_xml_att(item, "Source"); char *width_att = fz_xml_att(item, "Width"); @@ -323,7 +323,7 @@ xps_parse_metadata_imp(xps_document *doc, fz_xml *item, xps_fixdoc *fixdoc) } } - if (!strcmp(fz_xml_tag(item), "LinkTarget")) + if (fz_xml_is_tag(item, "LinkTarget")) { char *name = fz_xml_att(item, "Name"); if (name) @@ -453,7 +453,7 @@ xps_load_fixed_page(xps_document *doc, xps_page *page) if (!root) fz_throw(doc->ctx, FZ_ERROR_GENERIC, "FixedPage missing root element"); - if (!strcmp(fz_xml_tag(root), "AlternateContent")) + if (fz_xml_is_tag(root, "AlternateContent")) { fz_xml *node = xps_lookup_alternate_content(root); if (!node) -- cgit v1.2.3