You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/11/26 18:53:29 UTC

[GitHub] [royale-compiler] joshtynjala opened a new issue #101: Missing error for MXML property with different namespace than component

joshtynjala opened a new issue #101: Missing error for MXML property with different namespace than component
URL: https://github.com/apache/royale-compiler/issues/101
 
 
   To set a property on a component in MXML using an XML child element, the namespace prefix must match. The following example of setting the width property on a Spark Application component with the Flex SDK is correct (both use the `s:` namespace prefix):
   
   ```mxml
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   	xmlns:s="library://ns.adobe.com/flex/spark">
   	<s:width>150</s:width>
   </s:Application>
   ```
   
   If the namespace is different, there should be an error, unless there's a component with that name in the namespace. There are at least two scenarios that we don't handle correctly.
   
   1. Using a namespace that isn't even defined in the document:
   
   ```mxml
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   	xmlns:s="library://ns.adobe.com/flex/spark">
   	<z:width>150</z:width>
   </s:Application>
   ```
   
   Flex SDK compiler reports this error:
   
   > Error: The prefix "z" for element "z:width" is not bound.
   
   2. Using a defined namespace, but not the same one:
   
   ```mxml
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   	xmlns:s="library://ns.adobe.com/flex/spark">
   	<fx:width>150</fx:width>
   </s:Application>
   ```
   
   Flex SDK compiler reports this error:
   
   > Error: Could not resolve <fx:width> to a component implementation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services