Yes. I’m pretty sure it’s used to implicitly convert a qname into a proper
string representation to an XML name. This can be in client code such as var
foo:String = myXML.name(). It’s also used in XML.toAttributeName().
On Sep 19, 2016, at 9:35 PM, Alex Harui <aha...@adobe.com> wrote:
> FlexJS has a Qname class. Looks like it is mostly used in XML. It has a
> toString() that adds a "::" between the uri and localname. Is toString()
> being used anywhere?
> I want to change Qname.toString() to produce a valid JS identifier. Then
> I can use Qname outside of XML. If mx_internal which is a namespace used
> in a qname has the uri of "http://www.a.com/foo/bar" is used in
> Qname(mx_internal, "baz"), you currently get a toString() of
> "http://www.a.com/foo/bar::baz". I believe that ':' and "/" and '.' are
> not valid in JS identifiers, so I would just replace them all with "_"
> (yes, I know I could URIEncode them, but it makes it less readable) so the
> result would be "http___www_a_com_foo_bar_baz".
> This would allow us to support
> mx_internal function baz()
> Which would then cross compile to:
> someClass.prototype.http___www_a_com_foo_bar_baz = function()
> And access like
> Var baz:Qname = Qname(mx_internal, "baz");
> someClass[baz] would then work.