Re: [Flashcoders] XPath
On Tue, Apr 29, 2008 at 7:11 PM, Peter Hall [EMAIL PROTECTED] wrote: In XPath 1.0, an attribute is an axis, not a node, and so cannot be used as a context node. (ie the self axis that you are attempting to access with . does not exist). I could be wrong on this, Actually, I might be talking crap about that. It was a year ago that I worked on the library and, well, you know... I'm looking at the spec again now and it's quite confusing, so I'm still not completely sure. Peter I wonder if the test site that you mention is completely compliant. For example certain XPath 2.0 features such as a/(b | c) work in there, but are not valid in XPath 1.0, so it's possible that they support more than is required. Anyway, the following will work instead: //*[contains(@file, '.swf')]/@file Peter On Tue, Apr 29, 2008 at 6:06 PM, Glen Pike [EMAIL PROTECTED] wrote: Hmmm, Seems my original reply did not go to the list: Here is the email again, but don't worry too much about it, as I have a workaround... (The sitemap snippet is also missing some activity file=activity1.swf type=SWF/ entries too - I can't just search for //animation/@file[...] ) It's a bit of a sneaky one, but I have a workaround - I just wanted to flag it up... Here is the email I sent back to Pete... I am trying to find all nodes with an attribute called file which ends in (can't do this in XPath 1.0 so contains will have to do) .swf. Here is my XPath string; //@file[contains(., .swf)] I am comparing the AS XPath implementation with this online testbed - which is also very useful :) http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm My workaround is to pull out all nodes with an attribute called file, then compare the values with .swf myself. //@file Below is a snippet of the XML I am using... sitemap section label=Home intro animation file=animations/MainIntro.swf/ animation file=animations/AndyIntroDuffy.swf/ animation file=animations/duffy_intro_1.swf/ animation file=animations/duffy_intro_2.swf/ animation file=animations/duffy_intro_3.swf/ /intro section label=Geography intro animation file=animations/geog_quiz_intro.swf/ /intro quiz file=geography.xml/ activity type=PDF label=Duffy's Oceans file=geo-1-duffys-oceans.pdf/ activity type=PDF label=Duffy's Coasts file=geo-2-duffys-coasts.pdf/ activity type=PDF label=Geography Glossary file=geo-glossary.pdf/ /section section label=English intro animation file=animations/english_quiz_intro.swf/ /intro quiz file=english.xml/ activity type=PDF label=A Home For Duffy file=eng-1-home-for-duffy.pdf/ activity type=PDF label=A Sad Story file=eng-2-a-sad-story.pdf/ activity type=PDF label=Duffy's Day file=eng-3-duffys-day.pdf/ activity type=PDF label=Do The Duffy Rap file=eng-4-duffy-rap.pdf/ activity type=PDF label=English Glossary file=eng-glossary.pdf/ /section /section sitemap -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
But hey, it works now right and I won't be upgrading XFactorStudio for this site, so all I do is learn a small bad habit, which I will remember for future stuff anyway :) Peter Hall wrote: On Tue, Apr 29, 2008 at 7:11 PM, Peter Hall [EMAIL PROTECTED] wrote: In XPath 1.0, an attribute is an axis, not a node, and so cannot be used as a context node. (ie the self axis that you are attempting to access with . does not exist). I could be wrong on this, Actually, I might be talking crap about that. It was a year ago that I worked on the library and, well, you know... I'm looking at the spec again now and it's quite confusing, so I'm still not completely sure. Peter I wonder if the test site that you mention is completely compliant. For example certain XPath 2.0 features such as a/(b | c) work in there, but are not valid in XPath 1.0, so it's possible that they support more than is required. Anyway, the following will work instead: //*[contains(@file, '.swf')]/@file Peter On Tue, Apr 29, 2008 at 6:06 PM, Glen Pike [EMAIL PROTECTED] wrote: Hmmm, Seems my original reply did not go to the list: Here is the email again, but don't worry too much about it, as I have a workaround... (The sitemap snippet is also missing some activity file=activity1.swf type=SWF/ entries too - I can't just search for //animation/@file[...] ) It's a bit of a sneaky one, but I have a workaround - I just wanted to flag it up... Here is the email I sent back to Pete... I am trying to find all nodes with an attribute called file which ends in (can't do this in XPath 1.0 so contains will have to do) .swf. Here is my XPath string; //@file[contains(., .swf)] I am comparing the AS XPath implementation with this online testbed - which is also very useful :) http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm My workaround is to pull out all nodes with an attribute called file, then compare the values with .swf myself. //@file Below is a snippet of the XML I am using... sitemap section label=Home intro animation file=animations/MainIntro.swf/ animation file=animations/AndyIntroDuffy.swf/ animation file=animations/duffy_intro_1.swf/ animation file=animations/duffy_intro_2.swf/ animation file=animations/duffy_intro_3.swf/ /intro section label=Geography intro animation file=animations/geog_quiz_intro.swf/ /intro quiz file=geography.xml/ activity type=PDF label=Duffy's Oceans file=geo-1-duffys-oceans.pdf/ activity type=PDF label=Duffy's Coasts file=geo-2-duffys-coasts.pdf/ activity type=PDF label=Geography Glossary file=geo-glossary.pdf/ /section section label=English intro animation file=animations/english_quiz_intro.swf/ /intro quiz file=english.xml/ activity type=PDF label=A Home For Duffy file=eng-1-home-for-duffy.pdf/ activity type=PDF label=A Sad Story file=eng-2-a-sad-story.pdf/ activity type=PDF label=Duffy's Day file=eng-3-duffys-day.pdf/ activity type=PDF label=Do The Duffy Rap file=eng-4-duffy-rap.pdf/ activity type=PDF label=English Glossary file=eng-glossary.pdf/ /section /section sitemap -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Well, anyway, thanks for pointing this out because I think it's a bug and the same bug is present in Xpath-as3. The spec is quite confusing because it defines 4 different node types: node, processing-instruction, comment and text. Attribute is actually of type node, but you have to read between the lines to get that, especially as attributes have special treatment elsewhere. Peter On Wed, Apr 30, 2008 at 12:23 PM, Glen Pike [EMAIL PROTECTED] wrote: But hey, it works now right and I won't be upgrading XFactorStudio for this site, so all I do is learn a small bad habit, which I will remember for future stuff anyway :) Peter Hall wrote: On Tue, Apr 29, 2008 at 7:11 PM, Peter Hall [EMAIL PROTECTED] wrote: In XPath 1.0, an attribute is an axis, not a node, and so cannot be used as a context node. (ie the self axis that you are attempting to access with . does not exist). I could be wrong on this, Actually, I might be talking crap about that. It was a year ago that I worked on the library and, well, you know... I'm looking at the spec again now and it's quite confusing, so I'm still not completely sure. Peter I wonder if the test site that you mention is completely compliant. For example certain XPath 2.0 features such as a/(b | c) work in there, but are not valid in XPath 1.0, so it's possible that they support more than is required. Anyway, the following will work instead: //*[contains(@file, '.swf')]/@file Peter On Tue, Apr 29, 2008 at 6:06 PM, Glen Pike [EMAIL PROTECTED] wrote: Hmmm, Seems my original reply did not go to the list: Here is the email again, but don't worry too much about it, as I have a workaround... (The sitemap snippet is also missing some activity file=activity1.swf type=SWF/ entries too - I can't just search for //animation/@file[...] ) It's a bit of a sneaky one, but I have a workaround - I just wanted to flag it up... Here is the email I sent back to Pete... I am trying to find all nodes with an attribute called file which ends in (can't do this in XPath 1.0 so contains will have to do) .swf. Here is my XPath string; //@file[contains(., .swf)] I am comparing the AS XPath implementation with this online testbed - which is also very useful :) http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm My workaround is to pull out all nodes with an attribute called file, then compare the values with .swf myself. //@file Below is a snippet of the XML I am using... sitemap section label=Home intro animation file=animations/MainIntro.swf/ animation file=animations/AndyIntroDuffy.swf/ animation file=animations/duffy_intro_1.swf/ animation file=animations/duffy_intro_2.swf/ animation file=animations/duffy_intro_3.swf/ /intro section label=Geography intro animation file=animations/geog_quiz_intro.swf/ /intro quiz file=geography.xml/ activity type=PDF label=Duffy's Oceans file=geo-1-duffys-oceans.pdf/ activity type=PDF label=Duffy's Coasts file=geo-2-duffys-coasts.pdf/ activity type=PDF label=Geography Glossary file=geo-glossary.pdf/ /section section label=English intro animation file=animations/english_quiz_intro.swf/ /intro quiz file=english.xml/ activity type=PDF label=A Home For Duffy file=eng-1-home-for-duffy.pdf/ activity type=PDF label=A Sad Story file=eng-2-a-sad-story.pdf/ activity type=PDF label=Duffy's Day file=eng-3-duffys-day.pdf/ activity type=PDF label=Do The Duffy Rap file=eng-4-duffy-rap.pdf/ activity type=PDF label=English Glossary file=eng-glossary.pdf/ /section /section sitemap -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list
RE: [Flashcoders] XPath
Bugs - interesting I've used this extensively for some time now and never had a problem with it What specifically are you seeing Glen ? Pete -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glen Pike Sent: 29 April 2008 15:20 To: Flashcoders mailing list Subject: [Flashcoders] XPath Hi, Does anyone know who to speak to about bugs in XFactorStudio's XPath api? Thanks Glen -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
I was about to reply the same thing. But I don't think it is being developed any more, so it might be a matter of fixing it yourself... Peter On Tue, Apr 29, 2008 at 4:52 PM, Pete Hotchkiss [EMAIL PROTECTED] wrote: Bugs - interesting I've used this extensively for some time now and never had a problem with it What specifically are you seeing Glen ? Pete ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath
I used to use it, but AS3 made it obsolete. What bugs do you see? I found that it had serious performance flaws on large datasets, but otherwise worked really well. Jason Merrill Bank of America Global Technology Operations LLD eTools Multimedia Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glen Pike Sent: Tuesday, April 29, 2008 10:20 AM To: Flashcoders mailing list Subject: [Flashcoders] XPath Hi, Does anyone know who to speak to about bugs in XFactorStudio's XPath api? Thanks Glen -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Hmmm, Seems my original reply did not go to the list: Here is the email again, but don't worry too much about it, as I have a workaround... (The sitemap snippet is also missing some activity file=activity1.swf type=SWF/ entries too - I can't just search for //animation/@file[...] ) It's a bit of a sneaky one, but I have a workaround - I just wanted to flag it up... Here is the email I sent back to Pete... I am trying to find all nodes with an attribute called file which ends in (can't do this in XPath 1.0 so contains will have to do) .swf. Here is my XPath string; //@file[contains(., .swf)] I am comparing the AS XPath implementation with this online testbed - which is also very useful :) http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm My workaround is to pull out all nodes with an attribute called file, then compare the values with .swf myself. //@file Below is a snippet of the XML I am using... sitemap section label=Home intro animation file=animations/MainIntro.swf/ animation file=animations/AndyIntroDuffy.swf/ animation file=animations/duffy_intro_1.swf/ animation file=animations/duffy_intro_2.swf/ animation file=animations/duffy_intro_3.swf/ /intro section label=Geography intro animation file=animations/geog_quiz_intro.swf/ /intro quiz file=geography.xml/ activity type=PDF label=Duffy's Oceans file=geo-1-duffys-oceans.pdf/ activity type=PDF label=Duffy's Coasts file=geo-2-duffys-coasts.pdf/ activity type=PDF label=Geography Glossary file=geo-glossary.pdf/ /section section label=English intro animation file=animations/english_quiz_intro.swf/ /intro quiz file=english.xml/ activity type=PDF label=A Home For Duffy file=eng-1-home-for-duffy.pdf/ activity type=PDF label=A Sad Story file=eng-2-a-sad-story.pdf/ activity type=PDF label=Duffy's Day file=eng-3-duffys-day.pdf/ activity type=PDF label=Do The Duffy Rap file=eng-4-duffy-rap.pdf/ activity type=PDF label=English Glossary file=eng-glossary.pdf/ /section /section sitemap -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
In XPath 1.0, an attribute is an axis, not a node, and so cannot be used as a context node. (ie the self axis that you are attempting to access with . does not exist). I could be wrong on this, but I implemented my own xpath library for AS3 from the w3c spec, without referencing the xfactorstudio code, and it does not work either (actually it throws an error). I wonder if the test site that you mention is completely compliant. For example certain XPath 2.0 features such as a/(b | c) work in there, but are not valid in XPath 1.0, so it's possible that they support more than is required. Anyway, the following will work instead: //*[contains(@file, '.swf')]/@file Peter On Tue, Apr 29, 2008 at 6:06 PM, Glen Pike [EMAIL PROTECTED] wrote: Hmmm, Seems my original reply did not go to the list: Here is the email again, but don't worry too much about it, as I have a workaround... (The sitemap snippet is also missing some activity file=activity1.swf type=SWF/ entries too - I can't just search for //animation/@file[...] ) It's a bit of a sneaky one, but I have a workaround - I just wanted to flag it up... Here is the email I sent back to Pete... I am trying to find all nodes with an attribute called file which ends in (can't do this in XPath 1.0 so contains will have to do) .swf. Here is my XPath string; //@file[contains(., .swf)] I am comparing the AS XPath implementation with this online testbed - which is also very useful :) http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm My workaround is to pull out all nodes with an attribute called file, then compare the values with .swf myself. //@file Below is a snippet of the XML I am using... sitemap section label=Home intro animation file=animations/MainIntro.swf/ animation file=animations/AndyIntroDuffy.swf/ animation file=animations/duffy_intro_1.swf/ animation file=animations/duffy_intro_2.swf/ animation file=animations/duffy_intro_3.swf/ /intro section label=Geography intro animation file=animations/geog_quiz_intro.swf/ /intro quiz file=geography.xml/ activity type=PDF label=Duffy's Oceans file=geo-1-duffys-oceans.pdf/ activity type=PDF label=Duffy's Coasts file=geo-2-duffys-coasts.pdf/ activity type=PDF label=Geography Glossary file=geo-glossary.pdf/ /section section label=English intro animation file=animations/english_quiz_intro.swf/ /intro quiz file=english.xml/ activity type=PDF label=A Home For Duffy file=eng-1-home-for-duffy.pdf/ activity type=PDF label=A Sad Story file=eng-2-a-sad-story.pdf/ activity type=PDF label=Duffy's Day file=eng-3-duffys-day.pdf/ activity type=PDF label=Do The Duffy Rap file=eng-4-duffy-rap.pdf/ activity type=PDF label=English Glossary file=eng-glossary.pdf/ /section /section sitemap -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Hi, Your query works fine, thanks for that :) I guess the online tool is useful, but will treat results with some scepticism and will try to get my head around axes and nodes, etc. a bit more... Cheers Glen Peter Hall wrote: In XPath 1.0, an attribute is an axis, not a node, and so cannot be used as a context node. (ie the self axis that you are attempting to access with . does not exist). I could be wrong on this, but I implemented my own xpath library for AS3 from the w3c spec, without referencing the xfactorstudio code, and it does not work either (actually it throws an error). I wonder if the test site that you mention is completely compliant. For example certain XPath 2.0 features such as a/(b | c) work in there, but are not valid in XPath 1.0, so it's possible that they support more than is required. Anyway, the following will work instead: //*[contains(@file, '.swf')]/@file Peter On Tue, Apr 29, 2008 at 6:06 PM, Glen Pike [EMAIL PROTECTED] wrote: Hmmm, Seems my original reply did not go to the list: Here is the email again, but don't worry too much about it, as I have a workaround... (The sitemap snippet is also missing some activity file=activity1.swf type=SWF/ entries too - I can't just search for //animation/@file[...] ) It's a bit of a sneaky one, but I have a workaround - I just wanted to flag it up... Here is the email I sent back to Pete... I am trying to find all nodes with an attribute called file which ends in (can't do this in XPath 1.0 so contains will have to do) .swf. Here is my XPath string; //@file[contains(., .swf)] I am comparing the AS XPath implementation with this online testbed - which is also very useful :) http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm My workaround is to pull out all nodes with an attribute called file, then compare the values with .swf myself. //@file Below is a snippet of the XML I am using... sitemap section label=Home intro animation file=animations/MainIntro.swf/ animation file=animations/AndyIntroDuffy.swf/ animation file=animations/duffy_intro_1.swf/ animation file=animations/duffy_intro_2.swf/ animation file=animations/duffy_intro_3.swf/ /intro section label=Geography intro animation file=animations/geog_quiz_intro.swf/ /intro quiz file=geography.xml/ activity type=PDF label=Duffy's Oceans file=geo-1-duffys-oceans.pdf/ activity type=PDF label=Duffy's Coasts file=geo-2-duffys-coasts.pdf/ activity type=PDF label=Geography Glossary file=geo-glossary.pdf/ /section section label=English intro animation file=animations/english_quiz_intro.swf/ /intro quiz file=english.xml/ activity type=PDF label=A Home For Duffy file=eng-1-home-for-duffy.pdf/ activity type=PDF label=A Sad Story file=eng-2-a-sad-story.pdf/ activity type=PDF label=Duffy's Day file=eng-3-duffys-day.pdf/ activity type=PDF label=Do The Duffy Rap file=eng-4-duffy-rap.pdf/ activity type=PDF label=English Glossary file=eng-glossary.pdf/ /section /section sitemap -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath
Curious why not use AS3 instead? Is your audience still using FP8? Jason Merrill Bank of America Global Technology Operations LLD eTools Multimedia Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Merrill, Jason wrote: Curious why not use AS3 instead? I don't speak for the OT here, just a comment to your earlier comment that AS3 made XPath obsolete. This is not really true. It is true that with E4X you have almost the same functionality as XPath, but E4X fails badly if your query comes from an external source, like if your application needs to deal with arbitrary XML and the queries are dynamic in nature (for example provided by a user, etc). Cheers, Claus. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath
I don't speak for the OT here, just a comment to your earlier comment that AS3 made XPath obsolete. This is not really true. It is true that with E4X you have almost the same functionality as XPath, but E4X fails badly if your query comes from an external source, like if your application needs to deal with arbitrary XML and the queries are dynamic in nature (for example provided by a user, etc). OK, so I'll concede AS3 only 98% makes it obsolete. :) Jason Merrill Bank of America Global Technology Operations LLD eTools Multimedia Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath
Although i think obsolete is a somewhat binary term, like pregnant, no? I don't think so. Is Windows 98 obsolete? Yes. Is it still used in places around the world, and therefore has uses? Yes. But we're just arguing symantics now, who really cares. The main point is, for most people, AS3 should handle what they want to so with XML. For a few, Xpath may still have some apparent uses. Jason Merrill Bank of America Global Technology Operations LLD eTools Multimedia Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Claus Wahlers Sent: Tuesday, April 29, 2008 4:20 PM To: Flash Coders List Subject: Re: [Flashcoders] XPath Merrill, Jason wrote: I don't speak for the OT here, just a comment to your earlier comment that AS3 made XPath obsolete. This is not really true. It is true that with E4X you have almost the same functionality as XPath, but E4X fails badly if your query comes from an external source, like if your application needs to deal with arbitrary XML and the queries are dynamic in nature (for example provided by a user, etc). OK, so I'll concede AS3 only 98% makes it obsolete. :) For you, maybe. For me it'd be more like 25%. Although i think obsolete is a somewhat binary term, like pregnant, no? Cheers, Claus. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Claus Wahlers wrote: Merrill, Jason wrote: Curious why not use AS3 instead? I don't speak for the OT here, just a comment to your earlier comment that AS3 made XPath obsolete. This is not really true. It is true that with E4X you have almost the same functionality as XPath, but E4X fails badly if your query comes from an external source, like if your application needs to deal with arbitrary XML and the queries are dynamic in nature (for example provided by a user, etc). Curious about this: like using eXist or doing interactive queries? -Ricky ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Hi, The choice not to use AS3 is because I am re-using a lot of code from a very similar previous project. Both projects were/are for a not-for-profit organisation, so the budget is small and we are trying to concentrate on the content rather than rewriting lots of code for AS3. Glen Merrill, Jason wrote: Curious why not use AS3 instead? Is your audience still using FP8? Jason Merrill Bank of America Global Technology Operations LLD eTools Multimedia Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath
Ricky Bacon wrote: Claus Wahlers wrote: Merrill, Jason wrote: Curious why not use AS3 instead? I don't speak for the OT here, just a comment to your earlier comment that AS3 made XPath obsolete. This is not really true. It is true that with E4X you have almost the same functionality as XPath, but E4X fails badly if your query comes from an external source, like if your application needs to deal with arbitrary XML and the queries are dynamic in nature (for example provided by a user, etc). Curious about this: like using eXist or doing interactive queries? In my particular case it's about rendering XForms, which relies a great deal on XPath for data binding (E4X can't help me there) http://www.w3schools.com/xforms/xforms_xpath.asp Cheers, Claus. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath online
I would look on msdn.microsoft.com/library under Win32 and COM Development - XML - MSXML - MSXML 4.0 SDK - XML Standards Reference - XPath Reference. It's an excellent reference for XPath 1.0 and 2.0. There's nothing different about MSFT's XPath implementation other than their specific extensions which you wouldn't use anyway. Enjoy... - Original Message - From: Hairy Dog Digital [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com; [EMAIL PROTECTED] Sent: Monday, April 09, 2007 2:07 PM Subject: [Flashcoders] XPath online Hey all, Can anyone recommend a solid online reference for XPath (working with XFactorStudio XPath is Flash MX 04 Pro)? Their web site is next to non-existent, I just had to backpeddle on a project, and trying to get my bearings on XPath and their implementation of it for AS2. Thanks, Rob ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] XPath online
Try this: http://download.macromedia.com/pub/documentation/en/flash/fl8/XpathAPI.pdf -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hairy Dog Digital Sent: Monday, April 09, 2007 12:07 PM To: flashcoders@chattyfig.figleaf.com; [EMAIL PROTECTED] Subject: [Flashcoders] XPath online Hey all, Can anyone recommend a solid online reference for XPath (working with XFactorStudio XPath is Flash MX 04 Pro)? Their web site is next to non-existent, I just had to backpeddle on a project, and trying to get my bearings on XPath and their implementation of it for AS2. Thanks, Rob ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] XPath online
While this doesn't cover the xfactorstudios version of Xpath, it may have some info that will help. http://flash.terra.ee/flash-books/o'reilly%20-%20actionscript.cookbook.2 003/0596004907_actscptckbk-chp-19-sect-15.html and http://www.w3schools.com/xpath/default.asp Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hairy Dog Digital Sent: Monday, April 09, 2007 3:07 PM To: flashcoders@chattyfig.figleaf.com; [EMAIL PROTECTED] Subject: [Flashcoders] XPath online Hey all, Can anyone recommend a solid online reference for XPath (working with XFactorStudio XPath is Flash MX 04 Pro)? Their web site is next to non-existent, I just had to backpeddle on a project, and trying to get my bearings on XPath and their implementation of it for AS2. Thanks, Rob ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
Had to setup my site again, but hopefully this is a little more clear: http://criticalpile.com/blog/ -Scott On 10/19/06, slangeberg [EMAIL PROTECTED] wrote: Can't find the links i've looked at, but here's the code I'm currently using. This example probably shows most of the xml data-access capabilities: //in this case, we're only pulling the title of a video, //if a section has any videos! import com.xfactorstudio.xml.xpath.*; . . . var path:String = /content/section/[EMAIL PROTECTED]' + id + ']/video; var videos:Array = XPath.selectNodes( xmlDoc, path ); for ( var i:Number = 0; ivideos.length; i++ ) { var video:XML = new XML( videos[i] ); path = XPath.selectSingleNode( video, video/source ).firstChild.nodeValue; var title:String = XPath.selectSingleNode( video, video/title ).firstChild.nodeValue; } example xml: ?xml version=1.0 encoding=utf-8 ? content section id=1.0 title ![CDATA[...text here...]] /title /section section id= 1.1 titleHigher Fatality Rates and Costs/title bkgd_imgassets/pics/to_load/safety_concerns_tab1.jpg/bkgd_img text/text video title/title /video /section . . . /content On 10/19/06, Chip Moeser [EMAIL PROTECTED] wrote: Does anyone know where I can samples using these (http:// www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- : : ) Scott -- : : ) Scott ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
Found this, not too detailed though. Hope it helps. http://www.skylab.ws/?p=85 __ Joseph Balderson, Flash Platform Developer http://www.joeflash.ca | 416-768-0987 Writing partner, Community MX | http://www.communitymx.com Consultant, New Toronto Group | http://www.newyyz.com Chip Moeser wrote: Does anyone know where I can samples using these (http://www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
yeah, i used the w3schools to learn the syntax, and i get by with that. On 10/28/06, Joseph Balderson [EMAIL PROTECTED] wrote: Found this, not too detailed though. Hope it helps. http://www.skylab.ws/?p=85 __ Joseph Balderson, Flash Platform Developer http://www.joeflash.ca | 416-768-0987 Writing partner, Community MX | http://www.communitymx.com Consultant, New Toronto Group | http://www.newyyz.com Chip Moeser wrote: Does anyone know where I can samples using these (http://www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
It's not the samples but this may be of use to you: http://download.macromedia.com/pub/documentation/en/flash/fl8/XpathAPI.pdf http://www.sephiroth.it/file_detail.php?id=130# --Damian Mindshare Media, Inc. 622A Alto St. Santa Fe, NM 87501-2519 http://mindsharemedia.net ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] XPath
Here is an old one: http://flash.terra.ee/flash-books/o'reilly%20-%20actionscript.cookbook.2 003/0596004907_actscptckbk-chp-19-sect-15.html Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Chip Moeser Sent: Thursday, October 19, 2006 11:10 AM To: Flashcoders mailing list Subject: [Flashcoders] XPath Does anyone know where I can samples using these (http:// www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
there you go: www.w3schools.com cheers, thomas Chip Moeser wrote: Does anyone know where I can samples using these (http://www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Thomas Rühl Design, Programming Concepts akitogo OHG Hanauer Landstrasse 188 60314 Frankfurt Telefon +49 (0) 69 800 69 445 Fax +49 (0) 69 800 69 449 Mobil +49 (0) 179 750 75 87 E-Mail [EMAIL PROTECTED] Web http://www.akitogo.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
Can't find the links i've looked at, but here's the code I'm currently using. This example probably shows most of the xml data-access capabilities: //in this case, we're only pulling the title of a video, //if a section has any videos! import com.xfactorstudio.xml.xpath.*; . . . var path:String = /content/section/[EMAIL PROTECTED]' + id + ']/video; var videos:Array = XPath.selectNodes( xmlDoc, path ); for ( var i:Number = 0; ivideos.length; i++ ) { var video:XML = new XML( videos[i] ); path = XPath.selectSingleNode( video, video/source ).firstChild.nodeValue; var title:String = XPath.selectSingleNode( video, video/title ).firstChild.nodeValue; } example xml: ?xml version=1.0 encoding=utf-8 ? content section id=1.0 title ![CDATA[...text here...]] /title /section section id=1.1 titleHigher Fatality Rates and Costs/title bkgd_imgassets/pics/to_load/safety_concerns_tab1.jpg/bkgd_img text/text video title/title /video /section . . . /content On 10/19/06, Chip Moeser [EMAIL PROTECTED] wrote: Does anyone know where I can samples using these (http:// www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- : : ) Scott ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] XPath
there you go: www.w3schools.com W3schools Xpath specs are not the same as Xfactorstudio's implementation - Xfactorstudios is still only a partial implementation, and I think the poster also wanted Actionscript examples to get what they want from the classes. Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Thomas Rühl -akitogo- Sent: Thursday, October 19, 2006 11:59 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] XPath there you go: www.w3schools.com cheers, thomas Chip Moeser wrote: Does anyone know where I can samples using these (http://www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Thomas Rühl Design, Programming Concepts akitogo OHG Hanauer Landstrasse 188 60314 Frankfurt Telefon +49 (0) 69 800 69 445 Fax +49 (0) 69 800 69 449 Mobil +49 (0) 179 750 75 87 E-Mail [EMAIL PROTECTED] Web http://www.akitogo.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath
Hi, yeah I know, however w3schools still show the direction to go and give a sense of how to use xpath generally. cheers, thomas. Merrill, Jason wrote: there you go: www.w3schools.com W3schools Xpath specs are not the same as Xfactorstudio's implementation - Xfactorstudios is still only a partial implementation, and I think the poster also wanted Actionscript examples to get what they want from the classes. Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Thomas Rühl -akitogo- Sent: Thursday, October 19, 2006 11:59 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] XPath there you go: www.w3schools.com cheers, thomas Chip Moeser wrote: Does anyone know where I can samples using these (http://www.xfactorstudio.com/) xpath classes? Thanks! -Chip ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Thomas Rühl Design, Programming Concepts akitogo OHG Hanauer Landstrasse 188 60314 Frankfurt Telefon +49 (0) 69 800 69 445 Fax +49 (0) 69 800 69 449 Mobil +49 (0) 179 750 75 87 E-Mail [EMAIL PROTECTED] Web http://www.akitogo.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Thomas Rühl Design, Programming Concepts akitogo OHG Hanauer Landstrasse 188 60314 Frankfurt Telefon +49 (0) 69 800 69 445 Fax +49 (0) 69 800 69 449 Mobil +49 (0) 179 750 75 87 E-Mail [EMAIL PROTECTED] Web http://www.akitogo.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
I'm using SEPY on OSX, good enough for you? ; On 11 May 2006, at 14:06, Johannes Nel wrote: get a proper as editor i would say ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
then obvisouly not. sepy is not a bad editor, but it should surely point out things like that. fdt is the way :) On 5/15/06, Kent Humphrey [EMAIL PROTECTED] wrote: I'm using SEPY on OSX, good enough for you? ; On 11 May 2006, at 14:06, Johannes Nel wrote: get a proper as editor i would say ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
fdt? Can it really notice the wrong case of a 3rd party class/function? On 15 May 2006, at 13:10, Johannes Nel wrote: then obvisouly not. sepy is not a bad editor, but it should surely point out things like that. fdt is the way :) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
yup. if its in the class path it picks it up (maybe sepy has that ability as well, you just need to configure the classpaths). we even use fdt for our flex 1.5 devlopment, it really is the sheet. On 5/15/06, Kent Humphrey [EMAIL PROTECTED] wrote: fdt? Can it really notice the wrong case of a 3rd party class/function? On 15 May 2006, at 13:10, Johannes Nel wrote: then obvisouly not. sepy is not a bad editor, but it should surely point out things like that. fdt is the way :) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
perm/item has no children with 'name' attributes. It has no children at all... Kent Humphrey wrote: ok, been banging my head against a wall for ages on this one. These lines of code work: menu_root = XPath.selectNodes(this, root/menu/item/@name); trace('menu_root: ' + menu_root); These don't: perm_items = Xpath.selectNodes(this, root/perm/item/@name); trace('perm_items: ' + perm_items); The trace returns undefined. Here is the XML, trimmed down to the vitals: root menu item name=Profiles colour=0x73556b item name=The Salon type=content colour=0x7797ac height=400 filename=profiles-the-salon/ item name=Meet Michael Van Clarke type=content colour=0x7797ac height=400 filename=profiles-mvc/ item name=Team Profiles / item name=Testimonials type=content height=400 colour=0x7797ac / /item item name=Book Online colour=0x73 item name=Booking Form / /item etc etc /menu perm item name=Special Offers / item name=Book an Appointment / item name=Register for Newsletter / /perm /root Anyone have any ideas what the problem is? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
Could it be just a plain old typo? XPath is with capital X and capital P. In the perm_items line you wrote Xpath Serge These lines of code work: menu_root = XPath.selectNodes(this, root/menu/item/@name); trace('menu_root: ' + menu_root); These don't: perm_items = Xpath.selectNodes(this, root/perm/item/@name); trace('perm_items: ' + perm_items); ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
Unbelievable! Thanks a lot Serge, you're a lifesaver : On 11 May 2006, at 13:50, Serge Jespers wrote: Could it be just a plain old typo? XPath is with capital X and capital P. In the perm_items line you wrote Xpath Serge These lines of code work: menu_root = XPath.selectNodes(this, root/menu/item/@name); trace('menu_root: ' + menu_root); These don't: perm_items = Xpath.selectNodes(this, root/perm/item/@name); trace('perm_items: ' + perm_items); ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
You're welcome... I mixup capitals all the time so it was the first thing I looked at ;-) Serge Unbelievable! Thanks a lot Serge, you're a lifesaver : ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath xml strangeness
get a proper as editor i would say On 5/11/06, Serge Jespers [EMAIL PROTECTED] wrote: You're welcome... I mixup capitals all the time so it was the first thing I looked at ;-) Serge Unbelievable! Thanks a lot Serge, you're a lifesaver : ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] XPath Problem
Any chance you can show an example of what your xml file looks like? I was goign to suggest that you try: countryName = XPath.selectNodes(country, ./name); or countryName = XPath.selectNodes(country, ./country/name); But I can't be sure without looking at the xml structure. -Original Message- From: [EMAIL PROTECTED] on behalf of Kevin Cannon Sent: Sun 4/30/2006 6:37 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] XPath Problem Hi, I'm playing around with Xfactor's XPath implementation but running into trouble with a basic test. I can parse the xml fine on the first run, but I want to subsequently parse those results. Here's the (rough) code: // This gets a list of the countries function parseXML(xmlData) { countriesList = XPath.selectNodes(xmlData, /map/country); handleCountry(countriesList[0]); } // I want to find the name of a country function handleCountry(country) { trace(country); // traces the corect XML out for the country countryName = XPath.selectNodes(country, /country/name); trace(countryName); // shows nothing // If I do this though, I get back the original results countryList = XPath.selectNodes(country, /map/country); trace(countryList); // shows country list } It doesn't seem to point to the XML I've grabbed from the first function. Traces all seem to be fine up to that point, so I'm really at a loss. Anyone got any ideas? - Kevin ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath Problem
On Sun, Apr 30, 2006 at 10:39:23AM -0400, Howard Nager wrote: Any chance you can show an example of what your xml file looks like? I was goign to suggest that you try: countryName = XPath.selectNodes(country, ./name); or countryName = XPath.selectNodes(country, ./country/name); But I can't be sure without looking at the xml structure. Hey, Here's the XML: http://www.conquerclub.com/maps/Indochina.xml Your first solution works fine, though I admit I'm at a bit of a loss as to why. :) Thnaks! - Kevin ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath Problem
That's because you're searching from the country-node, that's the structure you're searching in. Forget about all its parentnodes, we're talking about a new xml-document here. var countriesList:Array = XPath.selectNodes(xmlData, /map/country); for (var i=0; icountriesList; i++) { var countryName:XMLNode = XPath.selectSingleNode(countriesList[i], name); trace(countryName); } // -- this should give the same results since xmlData is the source var countryNames:Array = XPath.selectNodes(xmlData, /country/name); trace(countryNames); 2006/4/30, Kevin Cannon [EMAIL PROTECTED]: On Sun, Apr 30, 2006 at 10:39:23AM -0400, Howard Nager wrote: Any chance you can show an example of what your xml file looks like? I was goign to suggest that you try: countryName = XPath.selectNodes(country, ./name); or countryName = XPath.selectNodes(country, ./country/name); But I can't be sure without looking at the xml structure. Hey, Here's the XML: http://www.conquerclub.com/maps/Indochina.xml Your first solution works fine, though I admit I'm at a bit of a loss as to why. :) Thnaks! - Kevin ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath Problem
Bart, Thanks for the explanation, I understand it a better now. Cheers, - Kevin ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath Problem
That's because you're searching from the country-node, that's the structure you're searching in. Forget about all its parentnodes, we're talking about a new xml-document here. var countriesList:Array = XPath.selectNodes(xmlData, /map/country); for (var i=0; icountriesList; i++) { var countryName:XMLNode = XPath.selectSingleNode(countriesList[i], name); trace(countryName); } // -- this should give the same results since xmlData is the source var countryNames:Array = XPath.selectNodes(xmlData, /country/name); trace(countryNames); I was following the thread, but don't anderstand the answer. I was sure it was a problem of context, but I don't get how to fix it. Your explanation is clear but doesn't follow the first example provided : function parseXML(xmlData) { countriesList = XPath.selectNodes(xmlData, /map/country); handleCountry (countriesList [0]);--- seems to sends a new context node } function handleCountry(country) { countryName = XPath.selectNodes(country, /country/name); why not root node of the new context here ? trace(countryName); // shows nothing // If I do this though, I get back the original results countryList = XPath.selectNodes(country, /map/country); -- still evaluating xmlData there ? trace(countryList); // shows country list } Perhaps it's because of references. country is an XMLNode passed by reference to handleCountry Then, when XPath tries to filter from country's context, it uses in fact the same XMLdocument as before. I am not really happy with this explanation though. Further explanation ? Thanks. --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath Problem
OK, I get it. It's definitively a problem of reference. In order to filter an already filtered XMLNode, you've got to clone it before. XMLNode has such a function, cloneNode. So your example should work like this : function parseXML(xmlData) { countriesList = XPath.selectNodes(xmlData, /map/country); handleCountry(countriesList[0].cloneNode (true)); // Note the cloning process } function handleCountry(country) { countryName = XPath.selectNodes(country, /country/name); trace(countryName); // Should work. } Cheers. --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath, apostrophe, XPath's escape chars?
Ramon, I need to search an XML via a string that may contain apostrophes. ex.: var sDesc:String = XPath.selectNodes(_xml, //[EMAIL PROTECTED]' + sReleasedLabel + ']/@writeup)[0]; Is there a way to escape the apostrophe? The problem is that the sReleasedLabel, which contains Chinese New Year '06, is thought to end at ... Year because of the apostrophe. I've tried / and \ as escape chars but they don't work. You should be able to use double quotes surrounding the expression you are looking for... XPath.selectNodes(_xml, //[EMAIL PROTECTED] + sReleasedLabel + \]/ @writeup)[0]; This is something that wouldn't work in an xpath statement in an XML file, but you should be able to get away with it in ActionScript depending on whether the xpath library you are using supports this notation. Other than that there is no solution to your problem. Better to encode your attribute values so that they contain apos; instead of apostrophe characters. Cheers, Steve -- Steve Webster Head of Development Featurecreep Ltd. http://www.featurecreep.com 14 Orchard Street, Bristol, BS1 5EH 0117 905 5047 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath, apostrophe, XPath's escape chars?
Steve, Thanks, I'll try using quotes. I do used apos; all the time, but it becomes an apostrophe somewhere there when Flash loads the XML doc. Thanks! On 4/10/06, Steve Webster [EMAIL PROTECTED] wrote: Ramon, I need to search an XML via a string that may contain apostrophes. ex.: var sDesc:String = XPath.selectNodes(_xml, //[EMAIL PROTECTED]' + sReleasedLabel + ']/@writeup)[0]; Is there a way to escape the apostrophe? The problem is that the sReleasedLabel, which contains Chinese New Year '06, is thought to end at ... Year because of the apostrophe. I've tried / and \ as escape chars but they don't work. You should be able to use double quotes surrounding the expression you are looking for... XPath.selectNodes(_xml, //[EMAIL PROTECTED] + sReleasedLabel + \]/ @writeup)[0]; This is something that wouldn't work in an xpath statement in an XML file, but you should be able to get away with it in ActionScript depending on whether the xpath library you are using supports this notation. Other than that there is no solution to your problem. Better to encode your attribute values so that they contain apos; instead of apostrophe characters. Cheers, Steve -- Steve Webster Head of Development Featurecreep Ltd. http://www.featurecreep.com 14 Orchard Street, Bristol, BS1 5EH 0117 905 5047 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Ramon Miguel M. Tayag Managing Director Quirkworks ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath hangs
What happens if you put the value in a CDATA? Ron Yotam Laufer wrote: Hi List, I've been using xfactor studio's XPath class for AS 2.0 but have been experiencing some problems with a specific path. I've got this XML: ?xml version=1.0? RetrieveContent xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; RetrieveContentResult Assets Asset itemId45785/itemId itemNameVolkslied/itemName Properties Property name=Abstract valueWilhelmus, gezongen door Lois Lane/value /Property Property name=ThumbnailFilename value http://picsrv.dme.knvb.nl/?fif=/syndication/videos/13/36462.fpx/value /Property Property name=Duration value53/value /Property /Properties AssetFiles AssetFile type=StreamFileWM2 Filename9138387_300kbps.mov/Filename Path/Path /AssetFile AssetFile type=StreamFileWM3 Filename9138387_500kbps.mov/Filename Path/Path /AssetFile AssetFile type=StreamFileWM4 Filename9138387_700kbps.mov/Filename Path/Path /AssetFile /AssetFiles /Asset /Assets /RetrieveContentResult /RetrieveContent And I'm using this: trace (XPath.selectNodes (xml, //[EMAIL PROTECTED]'ThumbnailFilename']/value)); And Flash seems to go into an infinite loop or recurssion and I get the a script is causing your... would you like to abort window. I know for a fact that it's the [EMAIL PROTECTED]'ThumbnailFilename'] part of the path that is causing the problem but it happens that this is why I'm using XPath in the first place. Has anyone had this problem before and knows a way around it? Thanks, Yotam. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath hangs
Hi Ron, I don't see how that should change anything, but in any case I don't have the option to do so. Even if I omit the value and search only for //[EMAIL PROTECTED]'ThumbnailFilename'] it will still hang. Thanks, Yotam. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath hangs
I've tested it and it just works like a charm. No hangup or anything. I'm using Flash 8 AS2 by the way and the latest release of xfactorstudio's XPath import DepthManagerTest; import nl.mediamonkey.xml.XMLLoader; import mx.utils.Delegate; import com.xfactorstudio.xml.xpath.XPath; var test = new DepthManagerTest(this); var loader = new XMLLoader(data.xml); loader.addEventListener(load, Delegate.create(this, onComplete)); loader.startLoading(); function onComplete(evt:Object):Void { trace(XPath.selectNodes(evt.value, //[EMAIL PROTECTED]'ThumbnailFilename']/value/)); // outputs the node trace(XPath.selectNodes(evt.value, //[EMAIL PROTECTED]'ThumbnailFilename']/value/text())); // outputs the string with some returns in front of it trace(XPath.selectNodesAsString(evt.value, //[EMAIL PROTECTED]'ThumbnailFilename']/value/text())); // outputs the string with some returns in front of it } 2006/4/3, Yotam Laufer [EMAIL PROTECTED]: Hi Ron, I don't see how that should change anything, but in any case I don't have the option to do so. Even if I omit the value and search only for //[EMAIL PROTECTED]'ThumbnailFilename'] it will still hang. Thanks, Yotam. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath hangs
I can't get it to work. Saved it as a file, new FLA, still hangs. MX2004, FP7. On 03/04/06, Bart Wttewaall [EMAIL PROTECTED] wrote: I've tested it and it just works like a charm. No hangup or anything. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] XPath problems with single character value nodes
Thanks Adrian. I tested out both the examples, and the one that works best is var e = XPath.selectNodesAsNumber(this,/weather/dayf/[EMAIL PROTECTED]'3']/[EMAIL PROTECTED]'d']/icon/text()); For some reason the one that should work and Won't work is var e = XPath.selectNodes(this,/weather/dayf/[EMAIL PROTECTED]'3']/[EMAIL PROTECTED]'d']/icon/text()); e = String( e.firstChild.nodeValue ); I wonder why.. But I like the first example which works and thanks so much for looking into it. Chaitu. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wade Arnold Sent: Saturday, March 11, 2006 3:17 PM To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com; Adrian Park Subject: Re: [Flashcoders] XPath problems with single character value nodes Thanks Adrian for following up on this. We are having issues with parsing the content feed from the weather.com api. http://www.t8design.com/personal/chaitu/Weather/weather_proxy.php?id=USIA088 5 On 3/11/06 10:58 AM, Adrian Park [EMAIL PROTECTED] wrote: I've done some investigation on nthis issue and found this... If you modify your path like this (note the /text() at the end) you should get the value correctly... var e = XPath.selectNodesAsString (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/text()); Interestingly, if you try this it won't work... var e = XPath.selectNodesAsNumber (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/number()); ...but this does... var e = XPath.selectNodesAsNumber (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/text()); This final example actually returns a Number (not a String as the first example does) which is what I guess you'd want to get from the icon element but seems to do it the wrong way (using text() )! I'm going to report this info to Xfactor Studio. Hope this is helpful. A. On 3/11/06, erixtekila [EMAIL PROTECTED] wrote: Le 11 mars 06, à 11:27, Adrian Park a écrit : I encountered exactly the same issue on the project I'm currently working on. I got around the problem by using XPath.selectNodes rather than XPath.selectNodesAsString. Please send a mail to XPath author to get this fixed. --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath problems with single character value nodes
Le 11 mars 06, à 11:27, Adrian Park a écrit : I encountered exactly the same issue on the project I'm currently working on. I got around the problem by using XPath.selectNodes rather than XPath.selectNodesAsString. Please send a mail to XPath author to get this fixed. --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath problems with single character value nodes
I've done some investigation on nthis issue and found this... If you modify your path like this (note the /text() at the end) you should get the value correctly... var e = XPath.selectNodesAsString (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/text()); Interestingly, if you try this it won't work... var e = XPath.selectNodesAsNumber (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/number()); ...but this does... var e = XPath.selectNodesAsNumber (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/text()); This final example actually returns a Number (not a String as the first example does) which is what I guess you'd want to get from the icon element but seems to do it the wrong way (using text() )! I'm going to report this info to Xfactor Studio. Hope this is helpful. A. On 3/11/06, erixtekila [EMAIL PROTECTED] wrote: Le 11 mars 06, à 11:27, Adrian Park a écrit : I encountered exactly the same issue on the project I'm currently working on. I got around the problem by using XPath.selectNodes rather than XPath.selectNodesAsString. Please send a mail to XPath author to get this fixed. --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPath problems with single character value nodes
Thanks Adrian for following up on this. We are having issues with parsing the content feed from the weather.com api. http://www.t8design.com/personal/chaitu/Weather/weather_proxy.php?id=USIA088 5 On 3/11/06 10:58 AM, Adrian Park [EMAIL PROTECTED] wrote: I've done some investigation on nthis issue and found this... If you modify your path like this (note the /text() at the end) you should get the value correctly... var e = XPath.selectNodesAsString (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/text()); Interestingly, if you try this it won't work... var e = XPath.selectNodesAsNumber (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/number()); ...but this does... var e = XPath.selectNodesAsNumber (this,/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL PROTECTED]'d']/icon/text()); This final example actually returns a Number (not a String as the first example does) which is what I guess you'd want to get from the icon element but seems to do it the wrong way (using text() )! I'm going to report this info to Xfactor Studio. Hope this is helpful. A. On 3/11/06, erixtekila [EMAIL PROTECTED] wrote: Le 11 mars 06, à 11:27, Adrian Park a écrit : I encountered exactly the same issue on the project I'm currently working on. I got around the problem by using XPath.selectNodes rather than XPath.selectNodesAsString. Please send a mail to XPath author to get this fixed. --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPATH Question
try using or for the xpath query Localidades/Localidad[idLocalidad=83 or idComunidadAutonoma=15] sample: import mx.xpath.XPathAPI; z = new XML('LocalidadesLocalidadidLocalidad type=number83/idLocalidadidProvincia type=number34/idProvinciaidComunidadAutonoma type=number15/idComunidadAutonoma/LocalidadLocalidadidLocalidad type=number106/idLocalidadidProvincia type=number35/idProvinciaidComunidadAutonoma type=number15/idComunidadAutonoma/Localidad/Localidades'); var thePath_str:String = Localidades/Localidad[idLocalidad=83 or idComunidadAutonoma=15]; var result_array:Array = XPathAPI.selectNodeList(z.firstChild,thePath_str); for (var i:Number = 0; i result_array.length; i++) { trace(result_array[i].firstChild.toString()); } i'm just tracing out the firstChild but the query will contain the whole node. regards. kada. On 3/1/06, julian atienza [EMAIL PROTECTED] wrote: I have this XML Localidades Localidad idLocalidad type=number83/idLocalidad idProvincia type=number34/idProvincia idComunidadAutonoma type=number15/idComunidadAutonoma /Localidad Localidad idLocalidad type=number106/idLocalidad idProvincia type=number35/idProvincia idComunidadAutonoma type=number15/idComunidadAutonoma /Localidad /Localidades And want to generate a XPATH to select all nodes that f.e, are from idLocalidad=83 OR with idComunidadAutonoma = 15 that query that i will made with a SELECT in SQL SELECT * FROM LOCALIDADES WHERE idLocalidad = 83 OR idComunidadAutonoma = 15 ¿¿is it possible?? i'm trying with a lot of things like Localidades/Localidad[idLocalidad = 83] | Localidades/Localidad[idComunidadAutonoma = 15]; but it returns 3 elements (1 for idLocalidad = 83, and two for idComunidadAutonoma, when i really would like to receive 2... thanks in advance ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] XPATH Question
Try this: /Localidades/Localidad[idLocalidad='83' or idComunidadAutonoma='15'] That should work for you. On 3/1/06, julian atienza [EMAIL PROTECTED] wrote: I have this XML Localidades Localidad idLocalidad type=number83/idLocalidad idProvincia type=number34/idProvincia idComunidadAutonoma type=number15/idComunidadAutonoma /Localidad Localidad idLocalidad type=number106/idLocalidad idProvincia type=number35/idProvincia idComunidadAutonoma type=number15/idComunidadAutonoma /Localidad /Localidades And want to generate a XPATH to select all nodes that f.e, are from idLocalidad=83 OR with idComunidadAutonoma = 15 that query that i will made with a SELECT in SQL SELECT * FROM LOCALIDADES WHERE idLocalidad = 83 OR idComunidadAutonoma = 15 ¿¿is it possible?? i'm trying with a lot of things like Localidades/Localidad[idLocalidad = 83] | Localidades/Localidad[idComunidadAutonoma = 15]; but it returns 3 elements (1 for idLocalidad = 83, and two for idComunidadAutonoma, when i really would like to receive 2... thanks in advance ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] xpath - returning object not string?
But doesn't that object get put into the array (clientList - declared as an array earlier), and I'm targeting a single item in the array? On 3 Feb 2006, at 12:16, Alias wrote: Your query will return a list of objects which have the attribute name. There may be more than one of them, hence you get the object. HTH, Alias On 2/3/06, Kent Humphrey [EMAIL PROTECTED] wrote: Continuing my further adventures in xpath land: clientList = XPath.selectNodes(this, root/clients/client/@name); trace(typeof(clientList[0])); That trace statement returns object, so my array is an array of objects, not the strings I was after. WIll I have to String(clientList[0]) everytime I need the string value, or is there some other way? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] xpath / xpath4as2 beginners question
Try: XPath.selectNodes(this,product/products/text()); Instead. What does your XML look like? For the above to work, it would have to be: product product Hi there. /product /product However, not a good idea to have a child node be the same name as the parent node (though it's OK in the sense it that won't screw up Xpath). Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Kent Humphrey Sent: Thursday, February 02, 2006 10:20 AM To: Flashcoders mailing list Subject: [Flashcoders] xpath / xpath4as2 beginners question I'm trying to figure out how to use xfactorstudios xpath4as2 class, but I can't seem to get over the first hurdle! Can anyone tell me why this isn't working? import com.xfactorstudio.xml.xpath.*; myDoc = new XML(); myDoc.onLoad = function(){ var products = XPath.selectNodes(this,/product/products); trace(Products: +products); trace(this); } myDoc.load(../xml/test.xml); The above code is from the xfactostudios site (http:// www.xfactorstudio.com/ActionScript/AS2/XPath/) and the xml file I am loading is also from that page. What I have added is the two trace() statements to see if things are working. The first trace doesn't give me anything, but the second shows the whole xml file, so I know that at least the load is working. I have the class files located in Mac HD/Users/Username/Library/ Application Support/Macromedia/Flash 8/en/Configuration/Classes/com/ xfactorstudio/xml/xpath/ - that's correct isn't it? Any ideas? And does anyone know some good tutorials for this class? Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] xpath / xpath4as2 beginners question
On 2 Feb 2006, at 15:48, Merrill, Jason wrote: However, not a good idea to have a child node be the same name as the parent node (though it's OK in the sense it that won't screw up Xpath). Would you believe my problem was I had product/products instead of product/products ?! Sheesh... Thanks for the help. Can I have some general XML help too please? : Does this XML file make sense, is it well formed? root clients client name=Borgo di Colleoli sectorProperty/sector disciplineDirect Mail/discipline disciplineAdvertising/discipline /client client name=Royal Bank of Scotland sectorFinance/sector disciplineInteractive Design/discipline disciplineStrategy/discipline /client /clients sectors sector name=Property clientBorgo di Colleoli/client disciplineDirect Mail/discipline disciplineAdvertising/discipline disciplineChannel and Sales/discipline disciplineInteractive Design/discipline /sector /sectors disciplines discipline name=Direct Mail sectorProperty/sector clientBorgo di Colleoli/client /discipline /disciplines /root I know I'm in danger of repeating my first mistake by doing something like client/clients instead of clients/client - but I can't think of another way to organise it. Observant readers may recognise this as an xml sample of my matrix/ relationships questions from a few days ago : ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] xpath / xpath4as2 beginners question
It's well formed, sure, but I would do it like this instead - make heavy use of attributes - as much as possible for speed, relationships, and readability, something like this: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients sectors sector name=Property client=Borgo di Colleoli discipline name=Direct Mail/ discipline name=Advertising/ discipline name=Channel and Sales/ discipline name=Interactive Design/ /sector /sectors disciplines discipline name=Direct Mail sector=Property client=Borgo di Colleoli/ /disciplines /root Preferrably if you could find a way to work this, you could also maybe just do this to reduce redundancy: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients ..add more here /root ...and then make some use of XPath's search features to find the opposite relationships - i.e. sector to client, discipline to sector, etc. - though I haven't used it yet so wouldn't have an example to share Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Kent Humphrey Sent: Thursday, February 02, 2006 12:01 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] xpath / xpath4as2 beginners question On 2 Feb 2006, at 15:48, Merrill, Jason wrote: However, not a good idea to have a child node be the same name as the parent node (though it's OK in the sense it that won't screw up Xpath). Would you believe my problem was I had product/products instead of product/products ?! Sheesh... Thanks for the help. Can I have some general XML help too please? : Does this XML file make sense, is it well formed? root clients client name=Borgo di Colleoli sectorProperty/sector disciplineDirect Mail/discipline disciplineAdvertising/discipline /client client name=Royal Bank of Scotland sectorFinance/sector disciplineInteractive Design/discipline disciplineStrategy/discipline /client /clients sectors sector name=Property clientBorgo di Colleoli/client disciplineDirect Mail/discipline disciplineAdvertising/discipline disciplineChannel and Sales/discipline disciplineInteractive Design/discipline /sector /sectors disciplines discipline name=Direct Mail sectorProperty/sector clientBorgo di Colleoli/client /discipline /disciplines /root I know I'm in danger of repeating my first mistake by doing something like client/clients instead of clients/client - but I can't think of another way to organise it. Observant readers may recognise this as an xml sample of my matrix/ relationships questions from a few days ago : ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] xpath / xpath4as2 beginners question
Hi, After reading this article, I'm confused why client name does not merit an element? (http://www-128.ibm.com/developerworks/xml/library/x-eleatt.html) On Feb 2, 2006, at 10:00 AM, Merrill, Jason wrote: It's well formed, sure, but I would do it like this instead - make heavy use of attributes - as much as possible for speed, relationships, and readability, something like this: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients sectors sector name=Property client=Borgo di Colleoli discipline name=Direct Mail/ discipline name=Advertising/ discipline name=Channel and Sales/ discipline name=Interactive Design/ /sector /sectors disciplines discipline name=Direct Mail sector=Property client=Borgo di Colleoli/ /disciplines /root Preferrably if you could find a way to work this, you could also maybe just do this to reduce redundancy: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients ..add more here /root ...and then make some use of XPath's search features to find the opposite relationships - i.e. sector to client, discipline to sector, etc. - though I haven't used it yet so wouldn't have an example to share Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Kent Humphrey Sent: Thursday, February 02, 2006 12:01 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] xpath / xpath4as2 beginners question On 2 Feb 2006, at 15:48, Merrill, Jason wrote: However, not a good idea to have a child node be the same name as the parent node (though it's OK in the sense it that won't screw up Xpath). Would you believe my problem was I had product/products instead of product/products ?! Sheesh... Thanks for the help. Can I have some general XML help too please? : Does this XML file make sense, is it well formed? root clients client name=Borgo di Colleoli sectorProperty/sector disciplineDirect Mail/discipline disciplineAdvertising/discipline /client client name=Royal Bank of Scotland sectorFinance/sector disciplineInteractive Design/discipline disciplineStrategy/discipline /client /clients sectors sector name=Property clientBorgo di Colleoli/client disciplineDirect Mail/discipline disciplineAdvertising/discipline disciplineChannel and Sales/discipline disciplineInteractive Design/discipline /sector /sectors disciplines discipline name=Direct Mail sectorProperty/sector clientBorgo di Colleoli/client /discipline /disciplines /root I know I'm in danger of repeating my first mistake by doing something like client/clients instead of clients/client - but I can't think of another way to organise it. Observant readers may recognise this as an xml sample of my matrix/ relationships questions from a few days ago : ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] xpath / xpath4as2 beginners question
Ha - screw that article, M$ ain't the gods you know. IMO it's preference - I like elements for speed and what I think is readability. You'll see in mxml, coldFusion, etc. even Micosoft's new xaml, that attribute driven XML is the preferred method. However, if bloating an XML file with a bunch of nodes is your preferred method, there's not a whole lot wrong with that either... in a way. Whatever works. If you are working with a Huge app and other peeps, then yeah, you'll need to standardize. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Chris Kennon Sent: Thursday, February 02, 2006 2:19 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] xpath / xpath4as2 beginners question Hi, After reading this article, I'm confused why client name does not merit an element? (http://www-128.ibm.com/developerworks/xml/library/x-eleatt.html) On Feb 2, 2006, at 10:00 AM, Merrill, Jason wrote: It's well formed, sure, but I would do it like this instead - make heavy use of attributes - as much as possible for speed, relationships, and readability, something like this: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients sectors sector name=Property client=Borgo di Colleoli discipline name=Direct Mail/ discipline name=Advertising/ discipline name=Channel and Sales/ discipline name=Interactive Design/ /sector /sectors disciplines discipline name=Direct Mail sector=Property client=Borgo di Colleoli/ /disciplines /root Preferrably if you could find a way to work this, you could also maybe just do this to reduce redundancy: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients ..add more here /root ...and then make some use of XPath's search features to find the opposite relationships - i.e. sector to client, discipline to sector, etc. - though I haven't used it yet so wouldn't have an example to share Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Kent Humphrey Sent: Thursday, February 02, 2006 12:01 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] xpath / xpath4as2 beginners question On 2 Feb 2006, at 15:48, Merrill, Jason wrote: However, not a good idea to have a child node be the same name as the parent node (though it's OK in the sense it that won't screw up Xpath). Would you believe my problem was I had product/products instead of product/products ?! Sheesh... Thanks for the help. Can I have some general XML help too please? : Does this XML file make sense, is it well formed? root clients client name=Borgo di Colleoli sectorProperty/sector disciplineDirect Mail/discipline disciplineAdvertising/discipline /client client name=Royal Bank of Scotland sectorFinance/sector disciplineInteractive Design/discipline disciplineStrategy/discipline /client /clients sectors sector name=Property clientBorgo di Colleoli/client disciplineDirect Mail/discipline disciplineAdvertising/discipline disciplineChannel and Sales/discipline disciplineInteractive Design/discipline /sector /sectors disciplines discipline name=Direct Mail sectorProperty/sector clientBorgo di Colleoli/client /discipline /disciplines /root I know I'm in danger of repeating my first mistake by doing something like client/clients instead of clients/client - but I can't think of another way to organise it. Observant readers may recognise this as an xml sample of my matrix/ relationships questions from a few days ago : ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com
RE: [Flashcoders] xpath / xpath4as2 beginners question
Xpath is quick enough to read it directly each time. It's what I like about it. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Kent Humphrey Sent: Thursday, February 02, 2006 5:36 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] xpath / xpath4as2 beginners question Merrill, Jason wrote: It's well formed, sure, but I would do it like this instead - make heavy use of attributes - as much as possible for speed, relationships, and readability, something like this: Preferrably if you could find a way to work this, you could also maybe just do this to reduce redundancy: root clients client name=Borgo di Colleoli sector=Property discipline name=Direct Mail/ discipline name=Advertising/ /client client name=Royal Bank of Scotland sector=Finance discipline name=Interactive Design/ discipline name=Strategy/ /client /clients ..add more here /root ...and then make some use of XPath's search features to find the opposite relationships - i.e. sector to client, discipline to sector, etc. - though I haven't used it yet so wouldn't have an example to share Thanks for that. Unfortunately I don't think I'm going to be able to use attributes for anything more than names, because a client may exist inside multiple sectors I believe. I was hoping I could cut down on the redundancy, so I'll certainly look into traversing the tree in both directions with XPath. I did wonder if using attributes more than text inside nodes made more sense After reading this article, I'm confused why client name does not merit an element? I don't know the rules - or even if there ARE rules - but my reasoning was that the name attribute was part of the client, but the others were separate but belonged to the client. Just my logic. Another question, would I be better off parsing all my relationships into associative arrays (like they are hardcoded now) on start up, or is XPath quick enough that I could read it directly each time? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and aphostrophes
MM V8 AS2. I havent tried with any other compilers, maybe a bug in the compiler? Helmut [EMAIL PROTECTED] wrote: are you compiling with the MM compiler or with MTASC and if so what version, i had the issue when running MTASC V9 and don't have this issue with 1.11 Grant - Original Message - From: Helmut Granda [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 12/14/05 12:31 AM Subject: Re: [Flashcoders] Xpath and aphostrophes Ok I found where the problem is, when I run this command: XPath.selectNodes (myDoc,/Node[Attribute = '+SearchTermWithAphostrophe+']); It goes into an infinite loop, does anyone has any idea why the SearchTermWithAphostrophe would trigger the infinite loop? TIA. Helmut Helmut Granda wrote: Hello, I have in interactive CD with a search function on it. I am using XPath to handle all my search funcionallity since it needs to work on PC and MAC. The CD I am producing crashes everything I try to search for strings that have aphostrophes on them (exe - Helmut's Files). I have tried for a couple of days to fix the issue for I am still having trouble, I was wondering if anyone has encounter this problem and found a solution for it. Better yet, if there is a better alternative to XPATH, welcome. What I am mainly doing is a search engine for a listing. TIA. Helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and aphostrophes
MM V7 AS2 Crashes too. Any Suggestions? So far Im working on testing if the string has a ' to change it to Hex and back. Helmut Helmut Granda wrote: MM V8 AS2. I havent tried with any other compilers, maybe a bug in the compiler? Helmut [EMAIL PROTECTED] wrote: are you compiling with the MM compiler or with MTASC and if so what version, i had the issue when running MTASC V9 and don't have this issue with 1.11 Grant - Original Message - From: Helmut Granda [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 12/14/05 12:31 AM Subject: Re: [Flashcoders] Xpath and aphostrophes Ok I found where the problem is, when I run this command: XPath.selectNodes (myDoc,/Node[Attribute = '+SearchTermWithAphostrophe+']); It goes into an infinite loop, does anyone has any idea why the SearchTermWithAphostrophe would trigger the infinite loop? TIA. Helmut Helmut Granda wrote: Hello, I have in interactive CD with a search function on it. I am using XPath to handle all my search funcionallity since it needs to work on PC and MAC. The CD I am producing crashes everything I try to search for strings that have aphostrophes on them (exe - Helmut's Files). I have tried for a couple of days to fix the issue for I am still having trouble, I was wondering if anyone has encounter this problem and found a solution for it. Better yet, if there is a better alternative to XPATH, welcome. What I am mainly doing is a search engine for a listing. TIA. Helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and aphostrophes
Ok I found where the problem is, when I run this command: XPath.selectNodes (myDoc,/Node[Attribute = '+SearchTermWithAphostrophe+']); It goes into an infinite loop, does anyone has any idea why the SearchTermWithAphostrophe would trigger the infinite loop? TIA. Helmut Helmut Granda wrote: Hello, I have in interactive CD with a search function on it. I am using XPath to handle all my search funcionallity since it needs to work on PC and MAC. The CD I am producing crashes everything I try to search for strings that have aphostrophes on them (exe - Helmut's Files). I have tried for a couple of days to fix the issue for I am still having trouble, I was wondering if anyone has encounter this problem and found a solution for it. Better yet, if there is a better alternative to XPATH, welcome. What I am mainly doing is a search engine for a listing. TIA. Helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
I'm having the same issue even without XPATH, I have a CDATA section in my XML and the text field renders the text and the HTML tags without rendering HTML, if I cut and paste the HTML to a string and set the text field to that it works as expected. I've done this before and it worked, difference now is I'm compiling with MTASC and using flash 8 IDE. I'm going to try a standalone fla test and compile with MM compiler and flash 7 to see what the issue is. Grant - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 12/7/05 1:56 PM Subject: [Flashcoders] Xpath and HTML tags inside XML bug? Searched Google, no dice, when the chattyfig servers were down again, I turned to Flexcoders, no luck either. Anyone who has experience with Xpath, I hope you can help. Problem overview: using Xpath, HTML tags inside of XML does not render, even with CDATA tags applied. Problem detail: I am using xfactorstudios' Xpath classes to bring in XML node data which contains text and HTML tags to display in a Flash text area component in the Flash 7 player. Here is a snippet of the XML: http://www.fda.gov/cdrh/'Center for Devices of Radiological Health. More text...]] The text area component IS set to HTML=true, but when it renders, it shows the text plus the HTML: Welcome to the Center for Devices of Radiological Health. More text... Does the same thing with a regular dynamic text field. If I hard code the same string directly in the .fla, it renders properly in the text field and/or component. The string from XPath returns, interestingly enough, looks like this: Welcome to the a href='http://www.fda.gov/cdrh/'Center for Devices of Radiological Health/a. More text... Not sure why Xpath is changing the string from . to /a, but Flash doesn't like it obviously. Anyone come across this before and have a solution? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Don't know if this helps, but for html, you set: textArea.html = true; then: textArea.text = thestring; ,but for textField, you set: textField.html = true; then: textField.htmlText = thestring; But you probably knew that. I think that's really confusing the way Macromedia coded that. Guess their developers weren't talking to each other enough. What are you using to bring in the XML? Before going to the textfield, the string is being traced out as having the HTML tags intact or no? The CDATA tags are correct in the XML as well? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
yes doing that, when I do a trace when I have a CDATA section with hello and bold tags around it (not typing it as it won't be displayed in the flashlist) I see in the text field the hello with the html tags and the same in the trace, if I set a string to hello with bold tags around it and assign it to the same text field it works... I'll create a demo file and upload soon, I had a deadline so ended up using loadvars for the html content and that worked, but I've done the CDATA section stuff for my old site and it worked then. Grant - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 12/9/05 1:36 PM Subject: RE: [Flashcoders] Xpath and HTML tags inside XML bug? Don't know if this helps, but for html, you set: textArea.html = true; then: textArea.text = thestring; ,but for textField, you set: textField.html = true; then: textField.htmlText = thestring; But you probably knew that. I think that's really confusing the way Macromedia coded that. Guess their developers weren't talking to each other enough. What are you using to bring in the XML? Before going to the textfield, the string is being traced out as having the HTML tags intact or no? The CDATA tags are correct in the XML as well? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Yes this is how I have been fixing the problem. Seems like a pain to have to use both methods, rather than just using the xpath. Morten Barklund Shockwaved wrote: Merrill, Jason wrote: [...] Problem overview: using Xpath, HTML tags inside of XML does not render, even with CDATA tags applied. [...] Does the same thing with a regular dynamic text field. If I hard code the same string directly in the .fla, it renders properly in the text field and/or component. The string from XPath returns, interestingly enough, looks like this: Welcome to the lt;a href=apos;http://www.fda.gov/cdrh/apos;gt;Center for Devices of Radiological Healthlt;/agt;. More text... Not sure why Xpath is changing the string from /a. to lt;/agt;, but Flash doesn't like it obviously. Anyone come across this before and have a solution? If you used the regular XML and XMLNode-classes in Flash, you'd come to the same problem if you tried to insert the node directly - and didn't use the nodeValue-property of the XMLNode-object. If your XPath implementation returns XMLNode-object, just use the my_xmlnode.nodeValue-property and insert this in the textfield. If the XPath implementation returns a string and this string is the toString-value of the XMLNode (which the above is) and *not* the nodeValue-property, then the writer of the XPath implementation should read his manual once again :) Hope that helps. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Quote: http://www.w3.org/TR/xpath#section-Expressions I can never seem to make heads or tails of the w3.org documentation - maybe I'm just dumb, but it's always information overload to me. Mike, since we seem to be having the exact same problem, did you get it working? If so, can you send a code snippet of what works? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Mike Boutin Juicy Studios Merrill, Jason wrote: Quote: http://www.w3.org/TR/xpath#section-Expressions I can never seem to make heads or tails of the w3.org documentation - maybe I'm just dumb, but it's always information overload to me. Mike, since we seem to be having the exact same problem, did you get it working? If so, can you send a code snippet of what works? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Mike Boutin wrote: Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Why is it a workaround? Doesn't the XPath return the XMLNode? You can't just use the regular toString-method of the XMLNode-object - that'll return the wrong encoding. The nodeValue *is* the only proper way to fetch the correct textdata without encoding. If the XPath-method, that you use, is supposed to return the string value of a text element, then using nodeValue is a hack. But if you only use an XPath-method which is supposed to return an XMLNode, then it is *not* a hack, but doing exactly, what you are supposed to do. I haven't used this XPath-extension, but maybe I should check i out. -- Morten Barklund - Information Architect - Shockwaved Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark Phone: +45 7027 2227 - Fax: +45 3369 1174 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
I was able to use xpath to return titlesome html/title then use nodeValue on that. but I *wish* i could just do /xmlnode/xmlnode/text() and cut nodeValue out but i dont think its possible. Morten Barklund Shockwaved wrote: Mike Boutin wrote: Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Why is it a workaround? Doesn't the XPath return the XMLNode? You can't just use the regular toString-method of the XMLNode-object - that'll return the wrong encoding. The nodeValue *is* the only proper way to fetch the correct textdata without encoding. If the XPath-method, that you use, is supposed to return the string value of a text element, then using nodeValue is a hack. But if you only use an XPath-method which is supposed to return an XMLNode, then it is *not* a hack, but doing exactly, what you are supposed to do. I haven't used this XPath-extension, but maybe I should check i out. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass So basically, unless Martin's suggestions prove correct, you simply cannot use the xfactorstudios' xPath classes to bring in HTML formatted strings from XML, right? That SUCKS. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mike Boutin Sent: Wednesday, December 07, 2005 2:46 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Xpath and HTML tags inside XML bug? Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Mike Boutin Juicy Studios Merrill, Jason wrote: Quote: http://www.w3.org/TR/xpath#section-Expressions I can never seem to make heads or tails of the w3.org documentation - maybe I'm just dumb, but it's always information overload to me. Mike, since we seem to be having the exact same problem, did you get it working? If so, can you send a code snippet of what works? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
I was able to use xpath to return titlesome html/title then use nodeValue on that. Can you send me an actionscript example of how you did that? I'm not even that far yet. This returns undefined: myNode = XPath.selectNodes(config_xml,config/welcome/introduction); This works and returns the string (but with the unwanted gobbledegook): myNode = XPath.selectNodes(config_xml,config/welcome/introduction/text()); Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
string = XPath.selectNodes(my_xml, /path/to/nodes).nodeValue; This results in undefined. Johannes Nel wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; !-- single node Johannes Nel wrote: sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
use the selectSingleNode method or use the array accessor On 12/7/05, Mike Boutin [EMAIL PROTECTED] wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; !-- single node Johannes Nel wrote: sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes (my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Where is the documentation on selectSingleNode It doesnt seem to be in flash 8 help files. Johannes Nel wrote: use the selectSingleNode method or use the array accessor On 12/7/05, Mike Boutin [EMAIL PROTECTED] wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; !-- single node Johannes Nel wrote: sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes (my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Mike Boutin wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; I've just gotten the libraries, and it is exactly as I expected. selectNodes returns an Array of XMLNode-objects. Even the notion of /text() is just to get the node, which has no name, as it is a textnode - but it does not mean, that it will return the text. The function will still return an array of XMLNode-objects. So in order to actually get the text, you need to select the corrent index in the array, and then get the nodeValue from the XMLNode. given: var nodes:Array = XPath.selectNodes(my_xml, /pathto[1]/xml/text()); var textnode:XMLNode = XMLNode(nodes[0]); var text:String = textnode.nodeValue; That would be the proper way to do this perfectly and correctly. And rather OOP and nice too :) -- Morten Barklund - Information Architect - Shockwaved Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark Phone: +45 7027 2227 - Fax: +45 3369 1174 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Perfect, thanks for the help! Morten Barklund Shockwaved wrote: Mike Boutin wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; I've just gotten the libraries, and it is exactly as I expected. selectNodes returns an Array of XMLNode-objects. Even the notion of /text() is just to get the node, which has no name, as it is a textnode - but it does not mean, that it will return the text. The function will still return an array of XMLNode-objects. So in order to actually get the text, you need to select the corrent index in the array, and then get the nodeValue from the XMLNode. given: var nodes:Array = XPath.selectNodes(my_xml, /pathto[1]/xml/text()); var textnode:XMLNode = XMLNode(nodes[0]); var text:String = textnode.nodeValue; That would be the proper way to do this perfectly and correctly. And rather OOP and nice too :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
By the way Martin, I hope I didn't come across as being unappreciative - thanks again for your help. Mike too. Mike, if it's any less painful, while not pretty, I knocked it down to a single line and this works: myText=XMLNode((XPath.selectNodes(myxml,myNodePath/mynode())[0])).node Value; Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Sweet that works. thanks for the update! ;) Mike Boutin Juicy Studios Merrill, Jason wrote: By the way Martin, I hope I didn't come across as being unappreciative - thanks again for your help. Mike too. Mike, if it's any less painful, while not pretty, I knocked it down to a single line and this works: myText=XMLNode((XPath.selectNodes(myxml,myNodePath/mynode())[0])).node Value; Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Error...
Hmm... it works if you nest the predicate bit to... //product[colors[clr= 'green']] ...apparently (after quick google) this is legal XPath. Chris Wilcox Bounce Digital Ltd 12 Goslett Yard | London | WC2H 0EQ UK T +44(0)207 478 4488 | www.bouncedigital.co.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Coning Sent: 03 November 2005 12:13 To: Flashcoders mailing list Subject: [Flashcoders] XPath Error... Has anone encountered the following error that doesn't allow you to query child nodes of a particular node? Here is the sample code. Sorry for the wrapping: --- import com.xfactorstudio.xml.xpath.*; _global.XPath = XPath; // XML var myStr:String = productsproductflag0/flagcolorsclrgreen/clr/colorscolo rsclrred/clr/colorsnameItem 1/nameprice19.95/price/productproductflag1/flagcolorscl rblue/clrclrred/clr/colorsnamePlate/nameprice12.95/price /productproductcolorsclrsilver/clr/colorsflag0/flagnam eSpoon/nameprice4.95/price/product/products; var myXML:XML = new XML(myStr); trace(myXML: + myXML); // Query 1 var result1_array:Array = XPath.selectNodes(myXML,//product[colors/clr = 'green']); trace(\nGreen Results:\t + result1_array); trace(Result Length:\t\t + result1_array.length); // Query 2 var result2_array:Array = XPath.selectNodes(myXML,//product[colors/clr = 'red']); trace(\nRed Results:\t + result2_array); trace(Result Length:\t\t + result2_array.length); Doug Coning Software Developer FORUM Solutions, LLC This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. __ __ This email has been scanned by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Error...
It allows you to query the 'first' child, but not any other children... Doug Coning Software Developer FORUM Solutions, LLC -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Chris Wilcox Sent: Thursday, November 03, 2005 8:30 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Error... Hmm... it works if you nest the predicate bit to... //product[colors[clr= 'green']] ...apparently (after quick google) this is legal XPath. Chris Wilcox Bounce Digital Ltd 12 Goslett Yard | London | WC2H 0EQ UK T +44(0)207 478 4488 | www.bouncedigital.co.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Coning Sent: 03 November 2005 12:13 To: Flashcoders mailing list Subject: [Flashcoders] XPath Error... Has anone encountered the following error that doesn't allow you to query child nodes of a particular node? Here is the sample code. Sorry for the wrapping: --- import com.xfactorstudio.xml.xpath.*; _global.XPath = XPath; // XML var myStr:String = productsproductflag0/flagcolorsclrgreen/clr/colorscolo rsclrred/clr/colorsnameItem 1/nameprice19.95/price/productproductflag1/flagcolorscl rblue/clrclrred/clr/colorsnamePlate/nameprice12.95/price /productproductcolorsclrsilver/clr/colorsflag0/flagnam eSpoon/nameprice4.95/price/product/products; var myXML:XML = new XML(myStr); trace(myXML: + myXML); // Query 1 var result1_array:Array = XPath.selectNodes(myXML,//product[colors/clr = 'green']); trace(\nGreen Results:\t + result1_array); trace(Result Length:\t\t + result1_array.length); // Query 2 var result2_array:Array = XPath.selectNodes(myXML,//product[colors/clr = 'red']); trace(\nRed Results:\t + result2_array); trace(Result Length:\t\t + result2_array.length); Doug Coning Software Developer FORUM Solutions, LLC This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. __ __ This email has been scanned by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Error...
You are correct. Yes, it allows you to query if you nest the child node. Thank you very much Doug Coning Software Developer FORUM Solutions, LLC -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Chris Wilcox Sent: Thursday, November 03, 2005 8:30 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Error... Hmm... it works if you nest the predicate bit to... //product[colors[clr= 'green']] ...apparently (after quick google) this is legal XPath. Chris Wilcox Bounce Digital Ltd 12 Goslett Yard | London | WC2H 0EQ UK T +44(0)207 478 4488 | www.bouncedigital.co.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Coning Sent: 03 November 2005 12:13 To: Flashcoders mailing list Subject: [Flashcoders] XPath Error... Has anone encountered the following error that doesn't allow you to query child nodes of a particular node? Here is the sample code. Sorry for the wrapping: --- import com.xfactorstudio.xml.xpath.*; _global.XPath = XPath; // XML var myStr:String = productsproductflag0/flagcolorsclrgreen/clr/colorscolo rsclrred/clr/colorsnameItem 1/nameprice19.95/price/productproductflag1/flagcolorscl rblue/clrclrred/clr/colorsnamePlate/nameprice12.95/price /productproductcolorsclrsilver/clr/colorsflag0/flagnam eSpoon/nameprice4.95/price/product/products; var myXML:XML = new XML(myStr); trace(myXML: + myXML); // Query 1 var result1_array:Array = XPath.selectNodes(myXML,//product[colors/clr = 'green']); trace(\nGreen Results:\t + result1_array); trace(Result Length:\t\t + result1_array.length); // Query 2 var result2_array:Array = XPath.selectNodes(myXML,//product[colors/clr = 'red']); trace(\nRed Results:\t + result2_array); trace(Result Length:\t\t + result2_array.length); Doug Coning Software Developer FORUM Solutions, LLC This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. __ __ This email has been scanned by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath Error...
But the xml structure is not consistent (unless there was a typo). product colors clr/clr clr/clr /colors /product product colors clr/clr /colors colors clr/clr /colors /product So, if i'm not mistaken, this //product[colors[clr= 'green']] will only work for the second part (multiple 'colors' nodes), not the first one. regards, Muzak - Original Message - From: Chris Wilcox [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, November 03, 2005 2:30 PM Subject: RE: [Flashcoders] XPath Error... Hmm... it works if you nest the predicate bit to... //product[colors[clr= 'green']] ...apparently (after quick google) this is legal XPath. Chris Wilcox ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Error...
Well spotted hadn't seen the inconsistent xml, which means you're also right about the XPath... Chris Wilcox Bounce Digital Ltd 12 Goslett Yard | London | WC2H 0EQ UK T +44(0)207 478 4488 | www.bouncedigital.co.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: 03 November 2005 14:09 To: Flashcoders mailing list Subject: Re: [Flashcoders] XPath Error... But the xml structure is not consistent (unless there was a typo). product colors clr/clr clr/clr /colors /product product colors clr/clr /colors colors clr/clr /colors /product So, if i'm not mistaken, this //product[colors[clr= 'green']] will only work for the second part (multiple 'colors' nodes), not the first one. regards, Muzak - Original Message - From: Chris Wilcox [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, November 03, 2005 2:30 PM Subject: RE: [Flashcoders] XPath Error... Hmm... it works if you nest the predicate bit to... //product[colors[clr= 'green']] ...apparently (after quick google) this is legal XPath. Chris Wilcox ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. __ __ This email has been scanned by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath Error...
his XML is fine, its either the chattyfig server or our email clients stripping his xml.. //product[colors[clr='red']] will only return results if the first clr child node of the colors tag has a value of red. the correct syntax to return any clr child of colors that matches red would be : //product[colors/clr[.='red']] but neither the xfactor studio xpath parser or the mx.xpath.xpathAPI classes return anything for that xpath query. I tested it in internet explorer and it works fine. grant - Original Message - From: Chris Wilcox [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 11/3/05 10:00 AM Subject: RE: [Flashcoders] XPath Error... Well spotted hadn't seen the inconsistent xml, which means you're also right about the XPath... Chris Wilcox Bounce Digital Ltd 12 Goslett Yard | London | WC2H 0EQ UK T +44(0)207 478 4488 | www.bouncedigital.co.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: 03 November 2005 14:09 To: Flashcoders mailing list Subject: Re: [Flashcoders] XPath Error... But the xml structure is not consistent (unless there was a typo). So, if i'm not mistaken, this //product[colors[clr= 'green']] will only work for the second part (multiple 'colors' nodes), not the first one. regards, Muzak - Original Message - From: Chris Wilcox To: Flashcoders mailing list Sent: Thursday, November 03, 2005 2:30 PM Subject: RE: [Flashcoders] XPath Error... Hmm... it works if you nest the predicate bit to... //product[colors[clr= 'green']] ...apparently (after quick google) this is legal XPath. Chris Wilcox ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. __ __ This email has been scanned by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Query HELP!
Look at the class com.xfactorstudio.xml.xpath.types.Predicate line 266, add these traces: static function isEqualTo(val1, val2):Boolean{ trace(EQUALS::+val1+ , +val2) var values = Predicate.convertForComparison(val1, val2); for (var i in values){ trace(i+ : +values[i]); } return (values.val1 == values.val2); } You will see that the convertForComparison method is not working correctly for some reason. I don't have time to continue looking at this, I hope this gets you on the right path (har har). - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Query HELP!
I could not resist finding out what was wrong, here's the fix I came up with: Line 70 of com.xfactorstudio.xml.xpath.XPathUtils reads: for (var i=1 ; i=max ; i+=2) It should say i=max to accommodate 1 character text node values. Make that change and your query will work. - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:22 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! Look at the class com.xfactorstudio.xml.xpath.types.Predicate line 266, add these traces: static function isEqualTo(val1, val2):Boolean{ trace(EQUALS::+val1+ , +val2) var values = Predicate.convertForComparison(val1, val2); for (var i in values){ trace(i+ : +values[i]); } return (values.val1 == values.val2); } You will see that the convertForComparison method is not working correctly for some reason. I don't have time to continue looking at this, I hope this gets you on the right path (har har). - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Query HELP!
Oops, I meant to say: Line 70 of com.xfactorstudio.xml.xpath.XPathUtils reads: for (var i=1 ; imax ; i+=2) Note the less than - - - - - - - - - - - - Tim Beynart Athens, GA, USA 706.372.6994 - - - - - - - - - - - - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:41 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! I could not resist finding out what was wrong, here's the fix I came up with: It should say i=max to accommodate 1 character text node values. Make that change and your query will work. - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:22 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! Look at the class com.xfactorstudio.xml.xpath.types.Predicate line 266, add these traces: static function isEqualTo(val1, val2):Boolean{ trace(EQUALS::+val1+ , +val2) var values = Predicate.convertForComparison(val1, val2); for (var i in values){ trace(i+ : +values[i]); } return (values.val1 == values.val2); } You will see that the convertForComparison method is not working correctly for some reason. I don't have time to continue looking at this, I hope this gets you on the right path (har har). - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Query HELP!
Thank you very much. It works great... Doug Coning Software Developer FORUM Solutions, LLC -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:41 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! I could not resist finding out what was wrong, here's the fix I came up with: Line 70 of com.xfactorstudio.xml.xpath.XPathUtils reads: for (var i=1 ; i=max ; i+=2) It should say i=max to accommodate 1 character text node values. Make that change and your query will work. - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:22 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! Look at the class com.xfactorstudio.xml.xpath.types.Predicate line 266, add these traces: static function isEqualTo(val1, val2):Boolean{ trace(EQUALS::+val1+ , +val2) var values = Predicate.convertForComparison(val1, val2); for (var i in values){ trace(i+ : +values[i]); } return (values.val1 == values.val2); } You will see that the convertForComparison method is not working correctly for some reason. I don't have time to continue looking at this, I hope this gets you on the right path (har har). - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Query HELP!
Grant, Thank you very much for your help on this! Doug Coning Software Developer FORUM Solutions, LLC -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, November 01, 2005 2:18 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] XPath Query HELP! doug, do you have a better xml string, the one in your example is not valid xml and the flag you mentioned is not in it... grant - Original Message - From: Doug Coning [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 11/1/05 2:11 PM Subject: [Flashcoders] XPath Query HELP! I am trying to run a query using xfactorstudio to find all the elements where a flag (bit) is set to '1' or true. However, I have been unsuccessful at getting the class to return any items when trying to query on the node. When I use the Xpath.selectNodes() function and pass the queries below, nothing works. Please help! Here's a sample: import com.xfactorstudio.xml.xpath.*; _global.XPath = XPath; var myStr:String = 0Item 119.951Plate 12.950Spoon4.95; var myXML:XML = new XML(myStr); trace(This works: \t\t + XPath.selectNodes(myXML,/products/product[name = 'Plate'])); trace(This doesn't work: + XPath.selectNodes(myXML,/products/product[flag = '1'])); trace(This doesn't work: + XPath.selectNodes(myXML,/products/product[flag = 1])); trace(This doesn't work: + XPath.selectNodes(myXML,/products/product[flag 0])); Thanks, Doug Coning Software Developer FORUM Solutions, LLC This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please reply to sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XPath Query HELP!
Great find Tim! You should send that to Neeld Tanksley [EMAIL PROTECTED] so that he can update the library, if you haven't already done so of course. ;-) On 11/2/05, Tim Beynart [EMAIL PROTECTED] wrote: Oops, I meant to say: Line 70 of com.xfactorstudio.xml.xpath.XPathUtils reads: for (var i=1 ; imax ; i+=2) Note the less than - - - - - - - - - - - - Tim Beynart Athens, GA, USA 706.372.6994 - - - - - - - - - - - - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:41 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! I could not resist finding out what was wrong, here's the fix I came up with: It should say i=max to accommodate 1 character text node values. Make that change and your query will work. - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Beynart Sent: Wednesday, November 02, 2005 10:22 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] XPath Query HELP! Look at the class com.xfactorstudio.xml.xpath.types.Predicate line 266, add these traces: static function isEqualTo(val1, val2):Boolean{ trace(EQUALS::+val1+ , +val2) var values = Predicate.convertForComparison(val1, val2); for (var i in values){ trace(i+ : +values[i]); } return (values.val1 == values.val2); } You will see that the convertForComparison method is not working correctly for some reason. I don't have time to continue looking at this, I hope this gets you on the right path (har har). - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] XPath Query HELP!
Thanks, I did sent him an email this morning. This was my first decent contribution after years of reading this list! - - - - - - - - - - - - Tim Beynart Athens, GA, USA - - - - - - - - - - - - -Original Message- Great find Tim! You should send that to Neeld Tanksley [EMAIL PROTECTED] so that he can update the library, if you haven't already done so of course. ;-) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders