throws ThreddsXmlParserException
{
StartElement startElement = this.getNextEventIfStartElementIsMine();
// Determine if this metadata element gets inherited.
Attribute inheritedAtt = startElement.getAttributeByName( MetadataElementNames.MetadataElement_Inherited );
if ( inheritedAtt != null && inheritedAtt.getValue().equalsIgnoreCase( "true" ) )
this.isInheritedByDescendants = true;
// If contains "threddsMetadataGroup" elements, drop metadata wrapper
StartElement nextElement = this.peekAtNextEventIfStartElement();
if ( this.threddsMetadataElementParserFactory.isEventMyStartElement( nextElement ) )
{
this.containsThreddsMetadata = true;
return;
}
Attribute titleAtt = startElement.getAttributeByName( MetadataElementNames.MetadataElement_XlinkTitle );
Attribute externalRefAtt = startElement.getAttributeByName( MetadataElementNames.MetadataElement_XlinkHref );
if ( titleAtt == null && externalRefAtt == null )
{
this.selfBuilder.setContainedContent( true );
return;
}
if ( titleAtt == null || externalRefAtt == null )
{
String msg = "External reference metadata element has null title or URI.";
ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils.createIssueForUnexpectedElement( msg, this.reader );
log.warn( "parseStartElement(): " + issue.getMessage());
// ToDo Gather issues rather than throw exception.
throw new ThreddsXmlParserException( issue);
}
this.selfBuilder.setTitle( titleAtt.getValue() );
String uriString = externalRefAtt.getValue();
try
{
this.selfBuilder.setExternalReference( new URI( uriString ));
}
catch ( URISyntaxException e )