summaryrefslogtreecommitdiff
path: root/xps
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-02-19 17:31:30 +0100
committerRobin Watts <robin.watts@artifex.com>2013-02-20 13:50:40 +0000
commitb6519f17bf729617279e1feb78b08ce4fd56cd5b (patch)
tree2a9a9a94e770557e331ee2c9c8ecc591e332eb02 /xps
parent40997a6e6cb6c41ea337354ba4ecc3831ce0dcb7 (diff)
downloadmupdf-b6519f17bf729617279e1feb78b08ce4fd56cd5b.tar.xz
Bug 693639: allow OpenXPS extension and XML namespaces.
Thanks to zeniko.
Diffstat (limited to 'xps')
-rw-r--r--xps/xps_doc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xps/xps_doc.c b/xps/xps_doc.c
index 84d7bbd1..96eee8bc 100644
--- a/xps/xps_doc.c
+++ b/xps/xps_doc.c
@@ -9,6 +9,11 @@
#define REL_REQUIRED_RESOURCE_RECURSIVE \
"http://schemas.microsoft.com/xps/2005/06/required-resource#recursive"
+#define REL_START_PART_OXPS \
+ "http://schemas.openxps.org/oxps/v1.0/fixedrepresentation"
+#define REL_DOC_STRUCTURE_OXPS \
+ "http://schemas.openxps.org/oxps/v1.0/documentstructure"
+
static void
xps_rels_for_part(char *buf, char *name, int buflen)
{
@@ -283,9 +288,9 @@ xps_parse_metadata_imp(xps_document *doc, fz_xml *item, xps_fixdoc *fixdoc)
{
char tgtbuf[1024];
xps_resolve_url(tgtbuf, doc->base_uri, target, sizeof tgtbuf);
- if (!strcmp(type, REL_START_PART))
+ if (!strcmp(type, REL_START_PART) || !strcmp(type, REL_START_PART_OXPS))
doc->start_part = fz_strdup(doc->ctx, tgtbuf);
- if (!strcmp(type, REL_DOC_STRUCTURE) && fixdoc)
+ if ((!strcmp(type, REL_DOC_STRUCTURE) || !strcmp(type, REL_DOC_STRUCTURE_OXPS)) && fixdoc)
fixdoc->outline = fz_strdup(doc->ctx, tgtbuf);
if (!fz_xml_att(item, "Id"))
fz_warn(doc->ctx, "missing relationship id for %s", target);