use of org.apache.xmpbox.schema.XmpSchemaException in project pdfbox by apache.
the class DomXmpParser method parseDescriptionRoot.
private void parseDescriptionRoot(XMPMetadata xmp, Element description) throws XmpParsingException {
nsFinder.push(description);
TypeMapping tm = xmp.getTypeMapping();
try {
List<Element> properties = DomHelper.getElementChildren(description);
// parse attributes as properties
NamedNodeMap nnm = description.getAttributes();
for (int i = 0; i < nnm.getLength(); i++) {
Attr attr = (Attr) nnm.item(i);
if (XMLConstants.XMLNS_ATTRIBUTE.equals(attr.getPrefix())) {
// do nothing
} else if (XmpConstants.DEFAULT_RDF_PREFIX.equals(attr.getPrefix()) && XmpConstants.ABOUT_NAME.equals(attr.getLocalName())) {
// do nothing
} else if (attr.getPrefix() == null && XmpConstants.ABOUT_NAME.equals(attr.getLocalName())) {
// do nothing
} else {
parseDescriptionRootAttr(xmp, description, attr, tm);
}
}
parseChildrenAsProperties(xmp, properties, tm, description);
} catch (XmpSchemaException e) {
throw new XmpParsingException(ErrorType.Undefined, "Parsing failed", e);
} finally {
nsFinder.pop();
}
}
Aggregations