XStream
  1. XStream
  2. XSTR-429

Allow use of custom friendly naming with SaxWriter and TraxSource

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.2.2
    • Fix Version/s: 1.3
    • Component/s: IO
    • Labels:
      None
    • JDK version and platform:
      Sun 1.5 Windows

      Description

      When you are stuck with a pre-existing schema which contains underscores, it is currently impossible to transform objects based on this schema using existing XSLT sheets, as they expect the names with single underscores, and the SaxWriter class only uses the default XmlReader constructor which does not allow for custom escaping to be defined.

      Enclosed patch rectifies this

      • SaxWriter gains a constructor which enables you to pass a custom name replacer
      • TraxSource is able to use SaxWriter instance passed to setXMLReader method.

      Apologies for the lack of test code, but it does flawlessly transform about 3000 files here

      Usage example -
      {{

      { TraxSource t = new TraxSource(model, xs); t.setXMLReader(new SaxWriter(new XmlFriendlyReplacer("$", "_"))); }}

      }

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Adrian Wilkins
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: