Class OPCComplianceFlags

java.lang.Object
org.apache.poi.openxml4j.opc.OPCComplianceFlags

public class OPCComplianceFlags extends Object
Allows disabling specific OPC compliance rules. By default, rules M4.2, M4.3, M4.4, and M4.5 are all enforced which will prevent non-compliant documents from being parsed. Consumers may disable these compliance checks individually or as a whole at their own discretion to allow certain non-compliant documents to be parsed.
Since:
5.4.1
  • Field Details

    • ENFORCE_M4_2_FORBID_MARKUP_COMPATIBILITY_NAMESPACE

      protected boolean ENFORCE_M4_2_FORBID_MARKUP_COMPATIBILITY_NAMESPACE
    • ENFORCE_M4_3_FORBID_REFINING_DUBLIN_CORE_ELEMENTS

      protected boolean ENFORCE_M4_3_FORBID_REFINING_DUBLIN_CORE_ELEMENTS
      Rule M4.3: Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.
    • ENFORCE_M4_4_FORBID_XML_LANG_ATTRIBUTE

      protected boolean ENFORCE_M4_4_FORBID_XML_LANG_ATTRIBUTE
      Rule M4.4: Producers shall not create a document element that contains the xml:lang attribute. Consumers shall consider a document element that violates this constraint to be an error.
    • ENFORCE_M4_5_RESTRICT_XSI_TYPE_ATTRIBUTE

      protected boolean ENFORCE_M4_5_RESTRICT_XSI_TYPE_ATTRIBUTE
  • Method Details

    • enforceAll

      public static OPCComplianceFlags enforceAll()
    • disableAll

      public static OPCComplianceFlags disableAll()
    • setForbidMarkupCompatibilityNamespace

      public OPCComplianceFlags setForbidMarkupCompatibilityNamespace(boolean flag)
    • setForbidRefiningDublinCoreElements

      public OPCComplianceFlags setForbidRefiningDublinCoreElements(boolean flag)
    • setForbidXmlLangAttribute

      public OPCComplianceFlags setForbidXmlLangAttribute(boolean flag)
    • setRestrictXsiTypeAttribute

      public OPCComplianceFlags setRestrictXsiTypeAttribute(boolean flag)
    • getForbidMarkupCompatibilityNamespace

      public boolean getForbidMarkupCompatibilityNamespace()
    • getForbidRefiningDublinCoreElements

      public boolean getForbidRefiningDublinCoreElements()
    • getForbidXmlLangAttributes

      public boolean getForbidXmlLangAttributes()
    • getRestrictXsiTypeAttribute

      public boolean getRestrictXsiTypeAttribute()