summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-09-02 22:51:20 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-09-17 12:06:07 +0200
commit76cfea4acb19ed99a31b84d1d6d3d83d1ac5f225 (patch)
tree4d6c257d8380da266af73f1332eb1f38bf3c49f7 /source/fitz
parent13e335fd06789a42369d03b2cad65818014f3f79 (diff)
downloadmupdf-76cfea4acb19ed99a31b84d1d6d3d83d1ac5f225.tar.xz
xps: Add fz_xml_is_tag to simplify tag matching.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/xml.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/fitz/xml.c b/source/fitz/xml.c
index d916f205..bf36523a 100644
--- a/source/fitz/xml.c
+++ b/source/fitz/xml.c
@@ -148,7 +148,14 @@ char *fz_xml_text(fz_xml *item)
char *fz_xml_tag(fz_xml *item)
{
- return item->name;
+ if (item->name[0])
+ return item->name;
+ return NULL;
+}
+
+int fz_xml_is_tag(fz_xml *item, const char *name)
+{
+ return item->name && !strcmp(item->name, name);
}
char *fz_xml_att(fz_xml *item, const char *name)