Package net.sf.saxon.s9api

## Enum UnprefixedElementMatchingPolicy

- java.lang.Object
- - java.lang.Enum<UnprefixedElementMatchingPolicy>
  - - net.sf.saxon.s9api.UnprefixedElementMatchingPolicy

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Comparable<UnprefixedElementMatchingPolicy>`

      public enum UnprefixedElementMatchingPolicy
      extends java.lang.Enum<UnprefixedElementMatchingPolicy>

  An enumeration defining possible strategies for resolving unprefixed element names appearing as name tests in the steps of a path expression or XSLT match pattern

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---
    `ANY_NAMESPACE` | Under this policy, unprefixed element names match on the local part only; an element with this local name is matched regardless of its namespace (that is, it can have any namespace, or none)
    `DEFAULT_NAMESPACE` | The standard W3C policy, whereby element names are implicitly qualified by the default namespace for elements and types, as defined in the XPath static context.
    `DEFAULT_NAMESPACE_OR_NONE` | Under this policy, unprefixed element names match provided that (a) the local part of the name matches, and (b) the namespace part of the name is either equal to the default namespace for elements and types, or is absent.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static UnprefixedElementMatchingPolicy` | `valueOf​(java.lang.String name)` | Returns the enum constant of this type with the specified name.
    `static UnprefixedElementMatchingPolicy[]` | `values()` | Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### DEFAULT_NAMESPACE

          public static final UnprefixedElementMatchingPolicy DEFAULT_NAMESPACE

      The standard W3C policy, whereby element names are implicitly qualified by the default namespace for elements and types, as defined in the XPath static context. In XSLT this can be set using the `[xsl:]xpath-default-namespace` attribute, or programmatically using `XsltCompiler.setDefaultElementNamespace(String)`

    - #### ANY_NAMESPACE

          public static final UnprefixedElementMatchingPolicy ANY_NAMESPACE

      Under this policy, unprefixed element names match on the local part only; an element with this local name is matched regardless of its namespace (that is, it can have any namespace, or none)

    - #### DEFAULT_NAMESPACE_OR_NONE

          public static final UnprefixedElementMatchingPolicy DEFAULT_NAMESPACE_OR_NONE

      Under this policy, unprefixed element names match provided that (a) the local part of the name matches, and (b) the namespace part of the name is either equal to the default namespace for elements and types, or is absent.

      This policy is provided primarily for use with HTML, where it can be unpredictable whether HTML elements are in the XHTML namespace or in no namespace. It is also useful with other vocabularies where instances are sometimes in a namespace and sometimes not. The policy approximates to the special rules defined in the HTML5 specification, which states that unprefixed names are treated as matching names in the XHTML namespace if the context item for a step is "a node in an HTML DOM", and as matching no-namespace names otherwise; since in the XDM data model it is not possible to make a distinction between different kinds of DOM, this policy allows use of unprefixed names both when matching elements in the XHTML namespace and when matching no-namespace elements

  - ### Method Detail

    - #### values

          public static UnprefixedElementMatchingPolicy[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (UnprefixedElementMatchingPolicy c : UnprefixedElementMatchingPolicy.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static UnprefixedElementMatchingPolicy valueOf​(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null