AS3 RSS FEED XML Namespace

AS3 - FLASH 10
Hello,
I'm having some trouble understanding how can I access a tag in a xml RSS Feed 2 format. Some tags have, what I think to be, namespaces that just ignore my request when accessing such tag. Here is an example:
// XML LOADED
<rss>
<channel>
<item>
    <title>POST TITLE</title>
    <link>http://domain.org/blog/2009/08/post-name/</link>
    <comments>http://domain.org/blog/2009/08/post-name/#comments</comments>
    <pubDate>Mon, 31 Aug 2009 21:39:40 +0000</pubDate>
    <dc:creator>admin</dc:creator>
    <category><![CDATA[CATEGORY]]></category>
    <category><![CDATA[CATEGORY]]></category>
    <guid isPermaLink="false">http://domain.org/blog/?p=3</guid>
    <description><![CDATA[DATA[...]]]></description>
    <content:encoded><![CDATA[DATA]]></content:encoded>
    <wfw:commentRss>http://domain.org/blog/2009/08/post-name/feed/</wfw:commentRss>
    <slash:comments>0</slash:comments>
</item>
</channel>
</rss>
// FLASH CODE
trace ( xml.channel.item.title ) // Output POST TITLE
trace ( xml.channel.item.content ) // Output undefined or “”
… same for wfw and slash tags.
Any help?
Regards

One of the ways is to use regular expressions and replace all the unwanted namespaces with pure tags:
1. Get the xml data as string:
var xmlString:String = [write the data here]
2. Pattern for the tags with namespaces is something like this:
var exp:RegExp = /<\\|(\w+):(\w+)>/gi;
3. This is just to demostrate what it outputs: - is not needed in the final code
var tagsArray:Array = xmlString.match(exp);
var currentOccurance:Array;
for (var i:int = 0; i < tagsArray.length; i++) {
     currentOccurance = tagsArray[i].split(":");
     trace("left = " + currentOccurance[0] + "; right = " + currentOccurance[1]);
It outputs something like this:
left = content; right = encoded>
left = content; right = encoded>
left = wfw; right = commentRss>
left = wfw; right = commentRss>
left = slash; right = comments>
left = slash; right = comments>
4. Depending on what side you want to use in the final tag:
a. If left:
xmlString = xmlString.replace(exp, "$1");
It will make the following changes:
From:
<content:encoded>....</content:encoded>
<wfw:commentRss>...</wfw:commentRss>
To:
<content>....</content>
<wfw>...</wfw>
b. if right:
xmlString = xmlString.replace(exp, "$2>");
It will make the following changes:
To
<encoded>....</encoded>
<commentRss>...</commentRss>
The final code is actually 4 lines only (assuming you use complete event):
var xmlString:String = e.target.data;
var exp:RegExp = /<\\|(\w+):(\w+)>/gi;
xmlString = xmlString.replace(exp, "$1");
var myXML:XML = new XML(xmlString);
Viola! You can parse xml regular way.

Similar Messages

  • RSS Feed XML iView Suffix

    Hi,
    we created a XML iView for a RSS Input. Out problem is, if the rss - feed ends upon .xml everything work fine. Unfortunatly our RSS - feed URL does not end with .xml and so the iView produces only an error message.
    Does anyone know how to configure the iView to run without the xml suffix? (We are not able to manipulate the RSS feed)
    Greetings

    sorry bur i don't know!
    Edited by: ludovic roux on Apr 3, 2008 2:23 PM

  • Rss feed, xml, dreamweaver and updating newsletters

    Hello
    Ok.. tell me if I'm wrong but I am under the impression that
    somehow I can subscribe to an RSS Feed or download an xml current
    news story almost straight into an HTML(ASP, COLD FUSION?) file(s)
    and upload to my companies FTP to give our customers a current
    customized newsletter.. is this so? is it a spry data set type
    importing thing? My company is looking for me to streamline the was
    we process new news stories..
    Thanks
    Rob

    sorry bur i don't know!
    Edited by: ludovic roux on Apr 3, 2008 2:23 PM

  • Rss Feeds XML Parsing

    Hi,
    I'm working on the example on Rss Feed which needs to integrated to our website.Hence below link i'm using for my reference purpose.
    http://www.vogella.com/articles/RSSFeed/article.html
    When i run the program the below exception is displayed.
    Please do the needful.Thanks in advance
    Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect
         at de.vogella.rss.RSSFeedParser.read(RSSFeedParser.java:146)
         at de.vogella.rss.RSSFeedParser.readFeed(RSSFeedParser.java:61)
         at de.vogella.rss.ReadTest.main(ReadTest.java:13)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.URL.openStream(Unknown Source)
         at de.vogella.rss.RSSFeedParser.read(RSSFeedParser.java:144)
         ... 2 more

    Hi,
    I'm working on the example on Rss Feed which needs to integrated to our website.Hence below link i'm using for my reference purpose.
    http://www.vogella.com/articles/RSSFeed/article.html
    When i run the program the below exception is displayed.
    Please do the needful.Thanks in advance
    Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect
         at de.vogella.rss.RSSFeedParser.read(RSSFeedParser.java:146)
         at de.vogella.rss.RSSFeedParser.readFeed(RSSFeedParser.java:61)
         at de.vogella.rss.ReadTest.main(ReadTest.java:13)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.URL.openStream(Unknown Source)
         at de.vogella.rss.RSSFeedParser.read(RSSFeedParser.java:144)
         ... 2 more

  • I figured out the XML RSS feed to webpage but..

    Hello All
    I finally figured out how to get and rss feed xml to my
    webpage(s) via the Spry xml data set etc.. when I previewed in IE
    it was fine but I uploaded it and I get an error
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct
    the error and then click the Refresh button, or try again later.
    Only one top level element is allowed in an XML document.
    Error processing resource '
    http://www.michaelsondesign.com/Spry/r...
    I just want to show my boss that I have been working on this
    and would love to show him an example of this awesome technology is
    there something Im not uploading? What does this error mean?
    Thank you
    Rob

    Hi,
    I am trying to display an RSS feed on my website as well. I
    haven't figured it out.
    Can you help?
    Thanks,
    H.J.D.
    [email protected]

  • The system Pages library and its RSS feed do not work properly in SharePoint 2010

    This question is about RSS feed for the system 'Pages' library in SharePoint 2010.
    Now there are 5 'News' pages in the system 'Pages' library. In each news page there is one field called 'Title' for the news title. One of the news page is named 'FileNamePage5.aspx', and the news title is 'This is the title of page5'.
    I have enabled RSS in Site Settings, and configured RSS Settings for the 'Pages' library from the Communications section via Document Library Settings. I selected a few columns to display in the RSS description, including the 'Title' column. In the RSS feed
    (XML file) of the system 'Pages' library, I checked the XML source code, and found the news page file name appearing in the <title> tag below within the feed (XML source code).
     <title>FileNamePage5</title>
    and the original news title 'This is the title of page5' was appearing in the <description> tag in the feed (XML sorce code)
     <description><![CDATA[<div> ... This is the title of page5... </div>]]></description>.
    This would make it hard to extract ONLY the original news title (This is the title of page5) out of the feed via XSLT, because the data within the <description> tag in the feed also contains data from all other selected columns defined via the RSS
    Setting. If I did not select the 'Title' column via RSS Setting above, I even could not find the orinigal news title in the RSS feed.
    This is happening for all other news pages in the system 'Pages' library. Is this what SharePoint 2010 normally does? or is something wrong with the settings for site or the system 'Pages' library?
    How to display ONLY the original news title (This is the title of page5) in the <title> tag in the RSS feed. Please Help me to resolve this issue.
    谢亚军@Sydney

    Hi,
    According to your description, my understanding is that you want to display the value in Title column of Pages library in title tag in RSS Feed in SharePoint.
    I tested the same scenario per your post, the title tag in RSS Feed displayed the value of Name column in libraries and displayed the value of Title column in lists.
    It is by design and there is no OOB way to change the default column mapping in RSS Feed.
    I recommend to customize your own RSS Feed style sheet to make the title displays the value of Title column in SharePoint libraries.
    Here is a link about customizing the RSS Feed for document library for you to take a look:
    http://markeev.com/Articles/sharepoint-blog-rss.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • RSS Feed on Apex

    Does anyone know how to show an RSS feed in APEX ? I have seen examples showing shredded items in a report. I want to show the RSS Feed XML as you can see at this link:
    http://www.oracle.com/rss/rss_ocom_pr.xml (try the link with Firefox and not with IE)
    Anything I do in Apex, it shows as text stripping XML tags.

    First, there's a setting in the report attributes to enable / disable HTML tags in your report.
    Second, I'm not sure what you're trying to achieve is going to work. I believe (but have not tried) that browsers such as Firefox will render complete XML files, such as an RSS feed, with a default stylesheet. I don't think they'll render XML that is part of and HTML document. IMHO, you should confirm this, perhaps with a simple HTML file with some embedded XML before you start writing a bunch of SQL / PL/SQL to test this.
    Third, what is your end goal? If users need a particular browser render this feed, are you perhaps expecting too much of your end users?
    Tyler

  • Better rss feeds without jf namespace prefix

    Hi Discussions,
    It would be nice if the RSS feeds provided did not use these 'jf' namespace prefixed tags, but rather plain old RSS tags that most RSS readers, inclusive of Safari & Mail currently understand. The feeds contain tags like:
    <jf:creationDate>Mon, 31 Mar 2008 14:02:16 -0500</jf:creationDate>
    <jf:modificationDate>Mon, 31 Mar 2008 14:02:16 -0500</jf:modificationDate>
    <jf:author>J.K. ROFLing</jf:author>
    <jf:replyCount>0</jf:replyCount>
    it would be better if they were something like:
    <pubDate>Mon, 31 Mar 2008 14:02:16 -0500</pubDate>
    <author>J.K. ROFLing</author>
    or
    <dc:creator>J.K. ROFLing</dc:creator>
    or if they included such standard tags in addition to the jf: tags. As it is now, an rss reader doesn't know what these tags are and gives each entry the pubDate of the entire feed, and includes no author or subject info.
    The feeds could also include the discussion group name as a "category" tag for each entry. that would perhaps be even better when a couple of feeds are grouped together.
    As it is today the RSS feeds aren't nearly as compatible with Safari and Mail or other RSS readers as one might reasonably hope/expect. With all the work already sunk into providing the feeds at all, it would be nice to go the last couple of inches and make them (more) useable.
    Cheers,
    Chris

    Hi Nick,
    I added the namespace to the file (as per the below) but it gives compilation errors (C:\JDeveloper\mywork\FeedReader\RSSViewController\public_html\rssFeedReader.jsff - Error(4,11): This attribute is not recognized)
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xlmns: h="http://java.sun.com/jsf/html">
    <af:panelGroupLayout layout="vertical" id="qjgpgl1">
    <af:outputText value="#{bindings.titleHead.inputValue}"
    inlineStyle="color:Black; font-weight:bold;" id="qjgot1"/>
    <af:outputText value="#{bindings.titleDesc.inputValue}"
    inlineStyle="color:Gray;" id="qjgot2"/>
    <af:spacer width="10" height="10" id="qjgs1"/>
    <af:forEach var="row" items="#{bindings.Feed.rangeSet}">
    <h:panelGrid columns="1" id="qjgpg1">
    <af:goLink text="#{row.title}"
    destination="#{row.link}"
    inlineStyle="width:100%; font-weight:bold; color:ActiveCaption;"
    id="qjggl1"/>
    <af:outputText value="#{row.description}"
    inlineStyle="color:Black;" id="qjgot3"/>
    <af:spacer width="10" height="5" id="qjgs2"/>
    </h:panelGrid>
    </af:forEach>
    </af:panelGroupLayout>
    </jsp:root>

  • Download RSS feed as xml file from Sharepoint Online using PowerShell

    Hello
    Our company sharepoint (Office 365) contains also several RSS feeds.
    How it is possible to download xml file out of this feed (website) using PowerShell?
    I can authenticate with sharepoint using CSOM but do not what to do next.
    As service user is not administrator I cannot use "SPOService".
    This script works OK for standard website, but not for Sharepoint.
    $doc = New-Object System.Xml.XmlDocument
    $doc.Load("http://www.{CompanySite}.com/feed/")
    $doc.save("C:\temp\feed.xml")
    I am getting this error when using for company Sharepoint:
    "The remote server returned an error: (403) Forbidden."
    Thanks for your time considering this question.
    Jozin

    Hi Scott,
    thanks for advice.
    Combination of WebClient and Sharepoint Credentials is working OK:
    $client = New-Object System.Net.WebClient 
    $client.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User, $SecurePassword)
    $client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f")
    $client.DownloadFile($SiteURL, $file)

  • Newbie here trying to load an rss feed thru xml in Flash AS 2.0

    I have never looked into RSS feeds before, I now have someone that wants  Yahoo rss newsfeed  embedded in his main.fla. I have an AS 2.0 rss newsreader he sent to me, knowing nothing about RSS I started to look around and eventually got to a point where I went to a Yahoo RSS feed and copied the source page and dropped it in the xml file that came with the feedreader. When saved, published and uploaded to the server the file displays the feed from yahoo fine, but it never update the stories. I would think this has to do with the xml as it is embedded in the page so it can't change so my question is how do I get an rss feed converted to xml to update???
    I gotta be missing something here, I hope this isn't too dumb of a question.
    RD

    Yep, as I suspected a dumb question. All I had to do was replace the xml file name with rssurl and it worked.
    sorry guys. I have another question regard this I will post separate.
    rd

  • How to create an XML/RSS feed from a SQL recordset?

    I've been trying to find either a tutorial or extension that will allow me to take a SQL recordset, and create my RSS feed on the fly.  Not having much luck... anyone out there have a suggestion??

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • Using xml rss feeds in dreamweaver

    I used dreamweaver to configure a rss feed in my webpage.
    One thing led to another and I was forced to reinstall my php
    server via
    xampp
    Now when I load the page on my computer I have this error:
    Fatal error: Call to undefined method domdocument::loadXML()
    in
    N:\INETPUB\xampp\htdocs\1purpose_bethel\includes\MM_XSLTransform\MM_XSLTransform.class.ph p
    on line 303
    I checked the includes folder and I do have the class file
    MM_XSLTransform.class.php
    but what I am wondering is if there is a place in my php.ini
    file that needs
    to modified to allow for the RSS feed? Or is there something
    else that I am
    over looking?
    any insight would be greatly appreciated
    thank you
    Kevin

    Hi, I'm also having the same error. I found in some other
    forums that I should do the following (I think its you David who
    suggested it):
    comment the line --> $xml =
    DOMDocument::loadXML($content);
    then add these two lines
    $doc = new DOMDocument();
    $err = $doc->loadXML($content);
    Well, actually when MM_XSLTransform.class.php was created it
    was already updated. But I'm still getting the error.
    I'm still a baby in PHP and I've been trying to figure it out
    for 2 days and nothing is happening.
    Please, please...your response will be highly appreciated.
    Kind regards,
    Jeng

  • Metadata on iPod from RSS feed (podcast) - ID3 tags or XML-generated?

    Hi,
    Does the metadata on an iPod come from the ID3 tags or from the XML-generated content in the RSS feed?
    Thanks!

    Afterthought:
    My experience is generally with tweaking tags to get iTunes to merge feeds but if you are downloading podcasts directly to the iPod it may concentrate on the feed information. Short of running tests with deliberately different information in the feed & the tag it is hard to say.
    tt2

  • Generating RSS Feeds using files with extension .xml

    Bonjour!
    Apologies if this is not the correct forum - please redirect me if necessary.
    I am trying to create an .xml file to upload to my server allowing me to generate rss feeds on my web site. If i understand correctly (I am a beginner webmaster) for my RSS feed to be valid, the first line must read for example '<?xml version="1.0" ?>
    <rss version="0.91"> which is the case in my document until I save it! When I try to save the text file as .xml MAC OSX treats it as a Word File. I have tried saving as .txt with the same result. Trying to change the extension once the file has been uploaded to my server doesn't work either - the RSS feed validators still pick the document up as a Word file.
    http://www.immobilier.rimcka.com/rss.xml
    Could you advise, please?
    Merci

    What APP are you using to save it?
    Might drop it on FileWiz and see if it has a Type/Creator code.
    Might give BBEdit a look/try...
    http://www.barebones.com/products/bbedit/
    http://www.barebones.com/products/bbedit/featuresweb.shtml
    "Syntax coloring and function navigation support for HTML, JavaScript, Perl, PHP, Ruby, SQL, XHTML, XML, and YAML Improved!"
    Or any of these...
    http://www.versiontracker.com/php/qs.php?mode=basic&action=search&str=xml+edit&s rchArea=macosx&submit=Go

  • Editing XML/RSS feed in iWeb to input all neccessary information for iTunes

    I have been trawling through a lot of the other posts but don't seem to be able to find an answer.
    Basically, i have successfully created my own page to host my podcasts and i have had my RSS feed accepted by iTunes. I can now view my podcast from the link the iTunes staff sent to me, however i am unable to find it by typing the name into the search bar. I have read in the podcast help on this forum that it may be because i have to add 'key words' to the XML as this is what the search tool uses to find the podcasts but i am unable to work out exactly how to do this. I have found my XML page and attempted to insert some lines using TextEdit but this just appears to corrupt my feed.
    If anyone has had a similar problem and knows of a solution, it would be greatly appreciated by myself.
    Thanks for reading :o)

    Alancito wrote:
    funky_ben wrote:
    I have found my XML page and attempted to insert some lines using TextEdit but this just appears to corrupt my feed.
    If the file you're editing has an ".html" extension, then this from TextEdit's +Help viewer+ may be relevant:
    If you want to work with an existing HTML file, choose File > Open and select the file you want. Be sure to select “Ignore rich text commands.” When you save the file, it remains a “.html” file.
    ...And there are other places where important selections are made for HTML files:
    In TextEdit's Save dialogue, select "HTML" from the +File Format+ menu.
    In TextEdit's +Preferences > New Document+ tab, select +"Plain text"+.
    In TextEdit's +Preferences > Open and Save+ tab, select +"Ignore rich text commands in HTML files"+.
    XML is not HTML your last post is irrelevant you should know what you're talking about before providing recommendations.
    Is this a late April Fools joke?
    funky_ben,
    You do not add XML data into an html file it should be inserted into an XML file look over the iTunes tech spec page provided unfortunately reading comprehension is required.

Maybe you are looking for