You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by woonsan <gi...@git.apache.org> on 2016/08/01 13:29:50 UTC

[GitHub] commons-scxml pull request #2: SCXML-251: Parse src attribute of data elemen...

Github user woonsan commented on a diff in the pull request:

    https://github.com/apache/commons-scxml/pull/2#discussion_r72977373
  
    --- Diff: src/main/java/org/apache/commons/scxml2/io/SCXMLReader.java ---
    @@ -1094,7 +1094,21 @@ private static void readData(final XMLStreamReader reader, final Configuration c
     
             Data datum = new Data();
             datum.setId(readRequiredAV(reader, ELEM_DATA, ATTR_ID));
    -        datum.setExpr(readAV(reader, ATTR_EXPR));
    +        final String expr = readAV(reader, ATTR_EXPR);
    +        final String src = readAV(reader, ATTR_SRC);
    +
    +        if (expr != null && src != null) {
    +          LogFactory.getLog(SCXMLReader.class).error(
    +              "Found src and expr attributes for data node '" + datum.getId() + "', which is not valid SCXML.");
    +          throw new ModelException();
    --- End diff --
    
    I think you should invoke #reportConflictingAttribute(reader, configuration, ...) instead here. That method leaves logs in a consistent manner and can handle strict or non-strict mode properly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---