Class MCRLanguageXML

java.lang.Object
org.mycore.datamodel.language.MCRLanguageXML

public class MCRLanguageXML extends Object
Helper class to map xml:lang and lang attributes in XML to MCRLanguage
Author:
Frank Lützenkirchen
  • Constructor Details

    • MCRLanguageXML

      public MCRLanguageXML()
  • Method Details

    • setLangAttribute

      public static void setLangAttribute(MCRLanguage lang, Element element)
      Sets the lang attribute to the ISO 639-2 bibliographic code of the given language
    • setXMLLangAttribute

      public static void setXMLLangAttribute(MCRLanguage lang, Element element)
      Sets the xml:lang attribute to the ISO 639-1 code of the given language
    • getLanguage

      public static MCRLanguage getLanguage(Element element)
      Returns the language of the given XML element, by inspecting the xml:lang or lang attribute. If neither exists, the default language is returned.