* @param element
*/
private Version parseVersion(String tagName, Element element, boolean strict, String encoding)
throws IOException, DocumentException
{
Version version = new Version();
version.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
for ( Iterator i = element.nodeIterator(); i.hasNext(); )
{
Node node = (Node) i.next();
if ( node.getNodeType() != Node.ELEMENT_NODE )
{
}
else
{
Element childElement = (Element) node;
if ( childElement.getName().equals( "name" ) )
{
if ( parsed.contains( "name" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "name" );
version.setName( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "tag" ) )
{
if ( parsed.contains( "tag" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "tag" );
version.setTag( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "id" ) )
{
if ( parsed.contains( "id" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "id" );
version.setId( getTrimmedValue( childElement.getText() ) );
}
else
{
if ( strict )
{