You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Wolfgang Frech (JIRA)" <ji...@apache.org> on 2007/02/12 15:57:05 UTC

[jira] Created: (SCXML-37) state with src attribute must not have children

state with src attribute must not have children
-----------------------------------------------

                 Key: SCXML-37
                 URL: https://issues.apache.org/jira/browse/SCXML-37
             Project: Commons SCXML
          Issue Type: Bug
    Affects Versions: 0.6
         Environment: Win XP, JDK 1.5  Eclipse 3.2, JUnit 4, details on request
            Reporter: Wolfgang Frech
            Priority: Minor


The Digester accepts an SCXML model with a state that has both a src attribute (and its contents defined in an external file), and an additional onentry child.
According to the WD-SCXML section 3.2.1, "If [the src attribute] is present, no children are allowed."

Test case to demonstrate the actual behavior follows

JUnit test method
----
	@Test
	public void externalStateWithChildren() throws FileNotFoundException,
			IOException, SAXException, ModelException {
		final URL definition = getClass().getClassLoader().getResource(
				"externalStateWithChild-main.scxml");
		SCXML scxml = SCXMLDigester.digest(definition, new SimpleErrorHandler());
		// expected/correct: digesting should throw exception
		// according to WD-SCXML 3.2.1 "If [the src attribute] is present, no
		// children are allowed."
		// actual/incorrect
		assertNotNull(scxml);
	}
----

main scxml
----
<?xml version="1.0"?>
<scxml
  xmlns="http://www.w3.org/2005/07/scxml"
  version="1.0"
  initialstate="external">
  <state
    id="external"
    src="externalStateWithChild-external.scxml">
    <onentry>
      <log
        expr="'This onentry child should not be accepted according to WD-SCXML 3.2.1 Description'" />
    </onentry>
  </state>
----

external scxml
----
?xml version="1.0"?>
<scxml
  xmlns="http://www.w3.org/2005/07/scxml"
  version="1.0"
  initialstate="start">
  <state id="start" /> 
</scxml>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (SCXML-37) state with src attribute must not have children

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rahul Akolkar updated SCXML-37:
-------------------------------

    Fix Version/s: 1.0

That correct, though a couple of comments:

1) Its hard to express this constraint via a DTD (or even a schema).

2) I believe specific elements should be allowed for better reuse and expressivity (<onentry>, <onexit> and <transition>s come quickly to mind). But that is something I need to bring up with the Working Group.

Setting for a fix version of 1.0.


> state with src attribute must not have children
> -----------------------------------------------
>
>                 Key: SCXML-37
>                 URL: https://issues.apache.org/jira/browse/SCXML-37
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Win XP, JDK 1.5  Eclipse 3.2, JUnit 4, details on request
>            Reporter: Wolfgang Frech
>            Priority: Minor
>             Fix For: 1.0
>
>
> The Digester accepts an SCXML model with a state that has both a src attribute (and its contents defined in an external file), and an additional onentry child.
> According to the WD-SCXML section 3.2.1, "If [the src attribute] is present, no children are allowed."
> Test case to demonstrate the actual behavior follows
> JUnit test method
> ----
> 	@Test
> 	public void externalStateWithChildren() throws FileNotFoundException,
> 			IOException, SAXException, ModelException {
> 		final URL definition = getClass().getClassLoader().getResource(
> 				"externalStateWithChild-main.scxml");
> 		SCXML scxml = SCXMLDigester.digest(definition, new SimpleErrorHandler());
> 		// expected/correct: digesting should throw exception
> 		// according to WD-SCXML 3.2.1 "If [the src attribute] is present, no
> 		// children are allowed."
> 		// actual/incorrect
> 		assertNotNull(scxml);
> 	}
> ----
> main scxml
> ----
> <?xml version="1.0"?>
> <scxml
>   xmlns="http://www.w3.org/2005/07/scxml"
>   version="1.0"
>   initialstate="external">
>   <state
>     id="external"
>     src="externalStateWithChild-external.scxml">
>     <onentry>
>       <log
>         expr="'This onentry child should not be accepted according to WD-SCXML 3.2.1 Description'" />
>     </onentry>
>   </state>
> ----
> external scxml
> ----
> ?xml version="1.0"?>
> <scxml
>   xmlns="http://www.w3.org/2005/07/scxml"
>   version="1.0"
>   initialstate="start">
>   <state id="start" /> 
> </scxml>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org