Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmlns:ns is now returned as attribute #676

Closed
torokati44 opened this issue Oct 31, 2023 · 5 comments
Closed

xmlns:ns is now returned as attribute #676

torokati44 opened this issue Oct 31, 2023 · 5 comments

Comments

@torokati44
Copy link
Contributor

We're seeing a change of behavior starting with #545.

This causes CI on ruffle-rs/ruffle#13785 to fail: https://github.com/ruffle-rs/ruffle/actions/runs/6709470764/job/18232602777

The specific code that's broken:

var y1 = <y xmlns:ns="foo" a="10" ns:c="30" ns:d="40"/>;
trace(y1.@*);

Expected: 103040
Ruffle with quick-xml update: foo103040

It seems the xmlns:ns attribute is now returned when it previously wasn't.
Is this expected? If so, could you assist us in how to get back the old behavior?

@Mingun
Copy link
Collaborator

Mingun commented Oct 31, 2023

Could you explain, what that syntax mean and should do?

var y1 = <y xmlns:ns="foo" a="10" ns:c="30" ns:d="40"/>;
trace(y1.@*);

@torokati44
Copy link
Contributor Author

Yes, sorry, this was not evident at all... 😅

This is ActionScript - the programming language for Adobe Flash movies.

This test is supposed to list all the attribute values of the element.
An excerpt from the documentation:

You can use the * wildcard symbol with the @ symbol to access all attributes of an XML or XMLList object, as in the following code:

var employee:XML =  
    <employee id="6401" code="233"> 
        <lastName>Wu</lastName> 
        <firstName>Erin</firstName> 
    </employee>; 
trace(employee.@*.toXMLString());  
// 6401 
// 233

https://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e6b.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7e61

@torokati44
Copy link
Contributor Author

torokati44 commented Oct 31, 2023

As for how quick-xml is used, I think this is a good place to start looking around: https://github.com/ruffle-rs/ruffle/blob/master/core/src/avm2/e4x.rs

@Dinnerbone
Copy link

I looked into this on the Ruffle side, it's our mistake, sorry!

We expected to see xmlns and xml as ResolveResult::Unknown("xmlns")/ResolveResult::Unknown("xml") - so the change to resolve them out to their URLs threw us off.

@torokati44
Copy link
Contributor Author

Turns out, this was on us. Sorry for bothering you and wasting your bandwidth... 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants