Uploaded image for project: 'Commons SCXML'
  1. Commons SCXML
  2. SCXML-88

SCXMLSerializer does not serialize custom namespace declarations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8
    • 0.9
    • None

    Description

      The SCXMLSerializer writes the scxml namespace as the default namespace to the <scxml> root tag and adds a "cs" ("commons-scxml") namespace by default.

      But it does not take into account that the original scxml document might contain other namespace declarations, e.g. on child tags:

      <?xml version="1.0" encoding="UTF-8"?>
      <scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:cs="http://commons.apache.org/scxml" version="1.0" initial="S1">
      <state id="S1">
      <!-- some E4X like condition using XML namespaces -->
      <!-- redefine default namespace to "foo" and use explicit namespace prefix for scxml:transition tag -->
      <scxml:transition event="foo" cond="a.b.bar::c.* == 3" target="S2" xmlns="foo" xmlns:scxml="http://www.w3.org/2005/07/scxml" xmlns:bar="bar">
      </transition>
      </state>
      <state id="S2" final="true">
      </state>
      </scxml>

      The above SCXML document is parsed properly and namespaces are forwarded to the executor (i.e. it works correct). But if it comes to serialization the namespaces are not serialized properly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ingmar Ingmar Kliche
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: