SCION compiles SCXML to an intermediate JSON format called SCJSON. SCJSON inlines “custom" namespaces (namespaces that are not SCXML or the default namespace) on the action object’s “$type” attribute using the template “{namespaceURI}localName”. This is the same technique used by the python
lxml library to handle namespaces.
Previously, this technique was only applied to attributes in custom namespaces, but I have pushed a patch to apply this technique to tags as well:
https://github.com/jbeard4/SCION/commit/b814d88d35842b354e84e7211e8797d692e74282
Now, for example, if you do:
model.prepare(function(err, fnModel){
//start state machine here
},{
postMessage : console.log.bind(console,'custom action tag parameters:')
});
On SCXML:
<state id="A">
<onentry>
<foo:bar foo:bat="bif" belt="bin"/>
</onentry>
</state>
</scxml>
You will get the following output:
custom action tag parameters: { name: 'Sandbox.action',
data:
{ '$line': 3,
'$column': 41,
belt: 'bin' } }
You might want to use this regex from scjon-to-module.js in your code to parse out the inlined namespace:
var stripNsPrefixRe = /^(?:{(?:[^}]*)})?(.*)$/;
You can get this change by pulling the master branch into your fork.
Please let me know if you have any questions about this. Thank you,
Jake