{
continue; // Ignore all rdf:ID attributes.
}
else
{
throw new XMPException(
"Invalid attribute for resource property element", BADRDF);
}
}
// walk through the children
Node currChild = null;
boolean found = false;
int i;
for (i = 0; i < xmlNode.getChildNodes().getLength(); i++)
{
currChild = xmlNode.getChildNodes().item(i);
if (!isWhitespaceNode(currChild))
{
if (currChild.getNodeType() == Node.ELEMENT_NODE && !found)
{
boolean isRDF = NS_RDF.equals(currChild.getNamespaceURI());
String childLocal = currChild.getLocalName();
if (isRDF && "Bag".equals(childLocal))
{
newCompound.getOptions().setArray(true);
}
else if (isRDF && "Seq".equals(childLocal))
{
newCompound.getOptions().setArray(true).setArrayOrdered(true);
}
else if (isRDF && "Alt".equals(childLocal))
{
newCompound.getOptions().setArray(true).setArrayOrdered(true)
.setArrayAlternate(true);
}
else
{
newCompound.getOptions().setStruct(true);
if (!isRDF && !"Description".equals(childLocal))
{
String typeName = currChild.getNamespaceURI();
if (typeName == null)
{
throw new XMPException(
"All XML elements must be in a namespace", BADXMP);
}
typeName += ':' + childLocal;
addQualifierNode (newCompound, "rdf:type", typeName);
}
}
rdf_NodeElement (xmp, newCompound, currChild, false);
if (newCompound.getHasValueChild())
{
fixupQualifiedNode (newCompound);
}
else if (newCompound.getOptions().isArrayAlternate())
{
XMPNodeUtils.detectAltText(newCompound);
}
found = true;
}
else if (found)
{
// found second child element
throw new XMPException(
"Invalid child of resource property element", BADRDF);
}
else
{
throw new XMPException(
"Children of resource property element must be XML elements", BADRDF);
}
}
}
if (!found)
{
// didn't found any child elements
throw new XMPException("Missing child of resource property element", BADRDF);
}
}