public static function getSchemaType( $domNode )
	{
		try
		{
			$types = SchemaTypes::getInstance();
			$type = $types->getTypeForDOMNode( $domNode );
			if ( $type )
			{
				// TODO Kludge alert!! The XBRL_Types class wrongly used the prefix 'xsd' instead of 'xs'
				//      This needs to be fixed but for now convert 'xs' to 'xsd'
				// BMS 2018-04-09 This can be retired
				// if ( strpos( $type, "xs:" ) === 0 ) $type = str_replace( "xs:", "xsd:", $type );

				$resolves = SchemaTypes::getInstance()->resolvesToBaseType( $type, array( "xs:anySimpleType", "xsd:anySimpleType" ) );
				if ( $resolves )
				{
					return DOMSchemaType::GetBuiltInSimpleTypeByQName( $type );
				}
			}

			return XmlSchema::$AnyType;
		}
		catch ( SchemaException $ex )
		{}

		return XmlSchema::$UntypedAtomic;

	}