Re: [flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-23 Thread Roger Braunstein
Interesting! I didn't know about xml:id. It appears that for processors that support it, the xml namespace is bound implicitly to http://www.w3.org/XML/1998/namespace, and id is an attribute scoped to this namespace. AS3 seems to support this. Hurray! Here are some ways you could extract the id

Re: [flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-22 Thread Roger Braunstein
http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1320 I think in this example the processing instruction is a red herring. You were testing: ?xml-stylesheet href=my.css type=text/css? root xmlns=http://example.com/;; xml:id=wtf / right? But I think that's

Re: [flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-22 Thread Claus Wahlers
I think in this example the processing instruction is a red herring. You were testing: ?xml-stylesheet href=my.css type=text/css? root xmlns=http://example.com/;; xml:id=wtf / right? But I think that's not well formed. What's up with the semicolon Whoops, that must have been an email typo,

Re: [flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-22 Thread Claus Wahlers
var a:XMLList = new XMLList( '?xml-stylesheet href=my.css type=text/css?' + 'root xmlns=http://example.com/; xmlns:id=wtf /'); var b:XML = a[1]; trace(b.namespaceDeclarations()); //wtf trace(b.namespace()); //http://example.com/ namespaceDeclarations() gets the namespaces the node

Re: [flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-22 Thread Roger Braunstein
It seems like a limitation that toXmlString() can't handle default namespaces or implicitly defined namespaces. For instance, when you use xml:id, you're using a namespace xml that you don't declare, and when you're using the default namespace http://example.com that namespace doesn't have a

Re: [flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-22 Thread Claus Wahlers
It seems like a limitation that toXmlString() can't handle default namespaces or implicitly defined namespaces. For instance, when you use xml:id, you're using a namespace xml that you don't declare, and when you're using the default namespace http://example.com that namespace doesn't have a

[flexcoders] E4X: Parsing XML with xml-stylesheet PI

2007-03-15 Thread Claus Wahlers
Hi list, i was playing around with E4X tonight and got stuck trying to parse a pretty simple, perfectly wellformed XML: ?xml-stylesheet href=my.css type=text/css? root xmlns=http://example.com/; xml:id=wtf / First try: XML.ignoreProcessingInstructions = false; var a:XML = new XML(