SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: News feed

  1. #1
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking News feed

    Ok say I create a news feed using xml and xslt. How would I set up the user to display the news on their site? Say they only have html and of course javascript available. What steps would they have to take to display the news feed on their site? Or if this cant be done let me know. Very new to this but I think Im coming around

    Silly

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    Perth, Australia
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sillysoft
    Ok say I create a news feed using xml and xslt. How would I set up the user to display the news on their site? Say they only have html and of course javascript available. What steps would they have to take to display the news feed on their site? Or if this cant be done let me know. Very new to this but I think Im coming around

    Silly
    Just some options:

    1) Make the XML feed file freely available, and the user can render it using his/her own XSLT

    2) Create a series of different layouts, and output 'em into JavaScript files that write out the HTML. Also, to make it more customisable, different stylesheets could be applyed to the same output.

  3. #3
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by peDey
    Just some options:

    1) Make the XML feed file freely available, and the user can render it using his/her own XSLT

    2) Create a series of different layouts, and output 'em into JavaScript files that write out the HTML. Also, to make it more customisable, different stylesheets could be applyed to the same output.
    Option 1, say I do make the xml available for them to "link" to on their site. Is there a way to imbed the xsl output into a html file? Say it is news and they want to add the news to their menu. All they have is html, could they imbed it anywhere on their page? Or would it have to be a full page of the xsl file?

    Silly

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    Perth, Australia
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sillysoft
    Option 1, say I do make the xml available for them to "link" to on their site. Is there a way to imbed the xsl output into a html file? Say it is news and they want to add the news to their menu. All they have is html, could they imbed it anywhere on their page? Or would it have to be a full page of the xsl file?

    Silly
    Yes, but it depends on what browsers you want to support. I haven't used a browser for client side XSLT for quite some time (at that stage only MS IE 5 was capable of doing it), and I'm not sure about other browser vendors.

    To reach more users, you could also consider Option 2: Use your XSLT to create a .js file that writes out the HTML-rendered News feed data. Then if someone wants to include your news into a static HTML file, they could include the .js file that you created.

    Offering both options may give your target users a good choice of dealing with the transforming the XML file themselves, or inlcuding pre-formatted XML data with the .js file(s). That way, If someone wants to transform your XML file themselves, it's irrelevant if they use server or client side XSLTs. If they want a less savvy, easy way to include HTML-formatted XML data, they can simply include the .js file.

  5. #5
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I think Im getting it, at least for xml and xslt. They seem very easy. The next step would to learn now how to process it in php using dynamic information.

    I have another question though for anyone. Is there anyway to embed the output of the xsl in pure html? Im sure you can do it in javascript, but is there a way to make a xml file, write a xsl stylesheet and output it anywhere in a html document? I can use the xsl as a stylesheet link in a xml doc, the problem is the format wont work in a html page. I can use xhtml, but doesnt that mean the whole page has to be in xhtml format?

    Silly

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't embed pure XSL (or XML for that matter) within HTML; on the other hand if you need to embed the transformed XML to HTML then set the XSL stylesheet as HTML and include the HTML HEAD, STYLEs etc within the ROOT of the stylesheet.

    Have a look over at www.xmltree.com for more XSL stylesheet examples using HTML.

  7. #7
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    You can't embed pure XSL (or XML for that matter) within HTML; on the other hand if you need to embed the transformed XML to HTML then set the XSL stylesheet as HTML and include the HTML HEAD, STYLEs etc within the ROOT of the stylesheet.

    Have a look over at http://www.xmltree.com for more XSL stylesheet examples using HTML.
    Hmm cant seem to access that website. Any other ones with the same information?

    Silly

  8. #8
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also are you stating to use the xmlutput method as html? Darn website still not coming up.

    Silly


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •