"Found invalid prefix for PDF/A extension, found '" + xmpSchema.getPrefix()
+ "', should be '" + stPdfaExt.preferedPrefix() + "'");
}
// create schema and types
PDFAExtensionSchema pes = (PDFAExtensionSchema) xmpSchema;
ArrayProperty sp = pes.getSchemasProperty();
for (AbstractField af : sp.getAllProperties())
{
if (af instanceof PDFASchemaType)
{
PDFASchemaType st = (PDFASchemaType) af;
String namespaceUri = st.getNamespaceURI();
String prefix = st.getPrefixValue();
ArrayProperty properties = st.getProperty();
ArrayProperty valueTypes = st.getValueType();
XMPSchemaFactory xsf = tm.getSchemaFactory(namespaceUri);
// retrieve namespaces
if (xsf == null)
{
// create namespace with no field
tm.addNewNameSpace(namespaceUri, prefix);
xsf = tm.getSchemaFactory(namespaceUri);
}
// populate value type
if (valueTypes != null)
{
for (AbstractField af2 : valueTypes.getAllProperties())
{
if (af2 instanceof PDFATypeType)
{
PDFATypeType type = (PDFATypeType) af2;
String ttype = type.getType();
String tns = type.getNamespaceURI();
String tprefix = type.getPrefixValue();
String tdescription = type.getDescription();
ArrayProperty fields = type.getFields();
if (ttype == null || tns == null || tprefix == null || tdescription == null)
{
// all fields are mandatory
throw new XmpParsingException(ErrorType.RequiredProperty,
"Missing field in type definition");
}
// create the structured type
DefinedStructuredType structuredType = new DefinedStructuredType(meta, tns,
tprefix, null); // TODO
// maybe
// a name
// exists
if (fields != null)
{
List<AbstractField> definedFields = fields.getAllProperties();
for (AbstractField af3 : definedFields)
{
if (af3 instanceof PDFAFieldType)
{
PDFAFieldType field = (PDFAFieldType) af3;