Uploaded image for project: 'Axiom'
  1. Axiom
  2. AXIOM-339

Allow StAXUtils to apply properties to XMLInputFactory and XMLOutputFactory

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.9
    • None
    • None

    Description

      The problem:

      Axis2 uses StAXUtils to get XMLInputFactory and XMLOutputFactory instances. In general the user has no control over the properties that are set on these factories, though this would sometimes be desirable, e.g. to control how CDATA sections are handled (see e.g. SYNAPSE-280). Actually code using StAXUtils should not modify any properties on the factories: since they are cached, this could have undesirable side effects.

      Proposed solution:

      Let StAXUtils look for property files with well defined names (XMLInputFactory.properties and XMLOutputFactory.properties) in the classpath, using the same classloader as the one from which the factory is loaded (by default this is the context classloader). The content of these files would then be used to initialize the factory properties. This mechanism would allow the user to easily apply a custom factory configuration to a given instance of Axis2 or Synapse. Since StAXUtils caches created factories, the overhead introduced by this feature is minimal.

      Attachments

        Issue Links

          Activity

            People

              veithen Andreas Veithen
              veithen Andreas Veithen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: