1. Reading XML and using in a SELECTstatement

    Date: 04/15/05 (SQL Server)    Keywords: xml, sql

    I have an XML document which contains 10,000 rows of item master information, 12 columns per row. I want to read that XML document and use it in a SELECT statement, just as if it was a table or view.

    The SQL help file suggests using OPENXML, which looks pretty simple, but in order to use that, I need to create an internal representation of the XML document with sp_xml_preparedocument.
    In order to do THAT, I have to have the entire XML document in a text parameter. This is not a small file (4.8MB), and is representing about 10,000 rows of data. No way in hell can I pull all of that into an ntext variable.

    I have never worked with XML in SQL Server before. I am familiar with the data in the document (.XML file contains the schema information in the header) but not with the T-SQL functions and procedues used to manipulate XML data.

    How do I read the XML file, either as a part of a SQL SELECT, or by dumping it into a temporary cursor?

    Source: http://www.livejournal.com/community/sqlserver/24405.html

  2. Getting remote script results in PHP

    Date: 04/15/05 (Web Development)    Keywords: php, html, xml

    Calling all PHP gurus: I'm trying to use fopen() to get the XML results of a remote script, using the URL with all the script parameters instead of a file name, but all I get back is the default HTML from the script, instead of the XML results, as if I hadn't passed it any parameters at all.  I'm assuming this has something to do with the HTTP headers fopen() uses to get at remote files, i.e. it bypasses script execution on the remote server and downloads the file directly.  Is there any way I can get around this with fopen() or do I really have to much with HTTP headers and use fsockopen() or something?

    Any help will be greatly appreciated.

    Source: http://www.livejournal.com/community/webdev/189477.html

  3. When *not to* use AJAX

    Date: 04/18/05 (Java Web)    Keywords: xml, web, google

    An example of wrong usage of AJAX aka XmlHttpRequest based web applications - TinkingTeam Corporate Website. Here the menu content is dynamically fetched using Ajax. This is bad because: Search engines like google cannot see it. Users cannot bookmark the pages. It doesn't indicate anything is happening, which can be bothering over slow connections. This can be remedied [...]

    Source: http://blog.taragana.com/index.php/archive/how-not-to-use-ajax/

  4. Opera 8 Released

    Date: 01/01/70 (Webmaster View)    Keywords: xml, linux

    Opera 8 for Windows and Linux released.

    New Features:

    • Voice support.
    • "Fit to window width" abolishes horizontal scrolling.
    • Support for XmlHttpRequest.
    • Easy access to useful features via a Start bar.
    • Easy retrieval of closed pages and blocked pop-ups.


    Source: http://www.webmasterview.com/browsers/opera_8_released

  5. Why Hello...

    Date: 04/20/05 (Javascript Community)    Keywords: php, xml

    My first post to the community, and definately not my last!

    So I'm trying to get XMLHttpRequest working, and it appears that the 'onreadystatechange' event is not firing. Does anyone know of a way to find out why? The file I'm hitting is PHP and simply returns a bunch of text delimited by '\r\n'. Any help would be greatly appreciated.

    Source: http://www.livejournal.com/community/javascript/63612.html

  6. One Problem

    Date: 04/25/05 (PHP Development)    Keywords: rss, xml

    But there is one problem in the code what i have given in the previous entry.

    it shows the entry with date, time, current mood, current music and even the number of comments in that post...
    But the problem i encountered in case of LJ-Cut... It doesn't keep the LJ-cut contents hiden. It shows the whole document. Coz in the XML of the entry the code is like this then followed by the entry...

    Even the XML given through RSS doesn't provide any option to find where the LJ-cut ends. Can anyone help regarding this problem?

    Source: http://www.livejournal.com/community/php_dev/54987.html

  7. I'm having a problem...

    Date: 04/28/05 (PHP Community)    Keywords: mysql, rss, html, xml, database, sql

    Alright, I'm having a bit of a problem.

    I've set up a page to read and parse RSS feeds. It works for the most part. The feed names and addresses are pulled from a mysql database okay. The problem lies in putting them onscreen. At some point, variables are not being dropped or overwritten, and I'm getting the same results repeated, but with the count number of the second feed.

    See what I mean?

    This is the code:

    -- Begin Code --

    include (" [ sql stuff ]");

    $sql = "SELECT * FROM rss_feeds";

    $results = mysql_query($sql);

    while ($myrow = mysql_fetch_array($results))

    $feedtitle = $myrow['name'];
    $feedurl = $myrow['url'];
    $xfeed = $myrow["feed"];
    $maxcount = $myrow['num_items'];

    $xmlfile = fopen("$xfeed", "r");
    if(!$xmlfile)die("This doesn't work");
    $readfile = fread($xmlfile ,100000);
    $searchfile = eregi("< item>(.*)< /item>", $readfile ,$arrayreg);
    $filechunks = explode("< item>", $arrayreg[0]);
    $count = count($filechunks);

    if ($maxcount > $count)
    $maxcount = $count;

    echo "< a href=\"$feedurl\">$feedtitle< /a>< br>";

    for($i=1 ; $i<=$maxcount ; $i++)

    eregi("< title>(.*)< /title>",$filechunks[$i], $title);
    eregi("< link>(.*)< /link>",$filechunks[$i], $link);
    eregi("< pubDate>(.*)< /pubDate>",$filechunks[$i], $pubdate);
    eregi("< description>(.*)< /description>",$filechunks[$i], $description);

    $pubdate = "$pubdate[1]";
    $xlink = "$link[1]";
    $xtitle = "$title[1]";
    $xdescription = "$description[1]";

    $xdescription = html_entity_decode($xdescription);
    $xdescription = strip_tags($xdescription);

    $xday = substr($pubdate, 5, 2);
    $xmonth = substr($pubdate, 8, 3);
    $xyear = substr($pubdate, 12, 4);

    $monthnames = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    $monthnumbers = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");

    $ymonth = str_replace($monthnames, $monthnumbers, $xmonth);

    $articledate = date("F jS, Y", mktime(0, 0, 0, $ymonth, $xday, $xyear));

    echo "< span style=\"text-transform: capitalize;\">< a href =\"$xlink\" target=\"_blank\">$xtitle< /a>< /span>< br>";
    echo "$articledate< br>";
    echo "$xdescription< br>";



    -- End Code --

    Anyone have any idea what could be causing this?

    NOTE: It looks now to be a problem with the one RSS feed itself, and not the code

    Source: http://www.livejournal.com/community/php/292485.html

  8. director mx?

    Date: 05/02/05 (Computer Geeks)    Keywords: html, xml

    If anyone has any experience with Director MX and XMLparser,,, please please please help me:


    Thanks so much. You have no idea.

    Source: http://www.livejournal.com/community/computergeeks/675659.html

  9. Web 2.0

    Date: 01/01/70 (Webmaster View)    Keywords: programming, xml, web

    Web 2.0 for Designers

    Enter Web 2.0, a vision of the Web in which information is broken up into "microcontent" units that can be distributed over dozens of domains. The Web of documents has morphed into a Web of data. We are no longer just looking to the same old sources for information. Now we're looking to a new set of tools to aggregate and remix microcontent in new and useful ways.


    There are six trends that characterize Web 2.0 for designers.


    1. Writing semantic markup (transition to everything XML)
    2. Providing Web services (moving away from place)
    3. Remixing content (about when and what, not who or why)
    4. Emergent navigation and relevance (users are in control)
    5. Adding metadata over time (communities building social information)
    6. Shift to programming (separation of structure and style)

    (Via bokardo)


    Source: http://www.webmasterview.com/design/web_20

  10. problems parsing xml namespaces w/ php5

    Date: 05/06/05 (PHP Community)    Keywords: php, xml

    hi all I am looking for an easy way to parse xml namespaces w/ php. can anyone lead me towards the right direction?

    i'm running php5 and i know about simple_xml but it's not parsing the name spaces.

    many thanks in advance.

    Source: http://www.livejournal.com/community/php/295625.html

  11. Code for Fetching LJ Community Contents through RSS

    Date: 05/09/05 (PHP Community)    Keywords: rss, xml, web

    [Error: Irreparable invalid markup ('') in entry. Owner must fix manually. Raw contents below.]

    I wrote a code for Fetching LJ content of a community. Am using RSS here. I wrote one XML Parser, It displays the entries in proper format (User can modify the code for his/her choicable format). It also displays the user name and userpic of the person who posted the entry in the community, also it counts the number of comments for that post and displays the comment count.
    Also it displays the current music, current mood and the mood icon used for that entry.

    This code will be helpful when someone is designing a website for a community and wants to fetch the LJ contents in the site...

    I've not yet tested the code for all types of design. If anyone can test the code and find the errors and fix them, it'll be helpful for everyone...

    // +----------------------------------------------------------------------+
    // | CommunityLJcatch version 1.1 |
    // +----------------------------------------------------------------------+
    // | This program is free software; you can redistribute it and/or |
    // | modify it under the terms of the GNU General Public License |
    // | as published by the Free Software Foundation; either version 2 |
    // | of the License, or (at your option) any later version. |
    // | |
    // | This program is distributed in the hope that it will be useful, |
    // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
    // | GNU General Public License for more details. |
    // | |
    // | You should have received a copy of the GNU General Public License |
    // | along with this program; if not, write to the Free Software |
    // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
    // | 02111-1307, USA. |
    // | |
    // +----------------------------------------------------------------------+
    // | Author: Sutanu Mandal from SPHINX |
    // | Website: http://www.wearesphinx.net |
    // +----------------------------------------------------------------------+
    // | File: fetch.php |
    // | Description: Contains php code and XML parser to fetch |
    // | Livejournal Entries from Community LJ Page |
    // | Last Update: 22/04/2005 |
    // +----------------------------------------------------------------------+

    // Basic Requirements
    $community="wearesphinx"; // Mention your community name here
    $backend = "http://www.livejournal.com/community/".$community."/data/rss/";

    // End

    // variables needed later
    $insideitem = false;
    $tag = "";
    $title = "";
    $description = "";
    $link = "";

    $mood = "";
    $music = "";
    $comment = "";
    $datetime = "";
    // end

    function startElement($parser, $tagName, $attrs) {

    // The function used when an element is encountered

    global $insideitem, $tag;

    if ($insideitem) {

    $tag = $tagName;

    } elseif ($tagName == "ITEM") {

    $insideitem = true;


    function characterData($parser, $data) {

    // The function used to parse all other data than tags

    global $insideitem, $tag, $title, $description, $link, $mood, $music, $comment, $datetime;

    if ($insideitem) {

    switch ($tag) {
    case "TITLE":
    $title .= $data;
    case "DESCRIPTION":
    $description .= $data;
    case "LINK":
    $link .= $data;
    case "COMMENTS":
    $comment .= $data;
    case "LJ:MUSIC":
    $music .= $data;
    case "LJ:MOOD":
    $mood .= $data;
    case "PUBDATE":
    $datetime .= $data;



    function endElement($parser, $tagName) {

    // This function is used when an end-tag is encountered.

    global $insideitem, $tag, $title, $description, $link, $mood, $music, $comment, $datetime, $community;

    if ($tagName == "ITEM") {

    /*Code for finding the entry ID*/

    // Find the Date and time of Post
    $datearray=preg_split('[ ]',$datetime);
    $title="Nothing to say Baby";

    ", // make our title into an actual link
    htmlspecialchars(trim($title))); // remove html characters from the title

    // Find out the user who made the post

    print "

    $str1=strstr($str1," $pos1=strpos($str1,">");

    // Find out number of comments in that post


    // Continue with the formatting of the entry

    print("Current Mood: $mood&nbsp;$moodpic
    print("Current Music: $music



    ",$description); // Print out the live journal entry # Original

    /* Code for display number of comments, Link to comment page, Edit Entry, Add Memory*/
    printf("$commentcount Comments",trim($link));
    printf("$commentcount Comment",trim($link));
    printf("Permanent Link",trim($link));
    print(",&nbsp;&nbsp;Leave Comments,&nbsp;&nbsp;");


    print ("&nbsp;&nbsp;
    \"Add src=\"http://stat.livejournal.com/img/btn_memories.gif\" />

    printf ("
    \n"); // Make a line inbetween entries.
    $title = $description = $link = $insideitem = $mood = $music = $comment = false;


    // Now to the parsing itself. Starts by creating it:

    $xml_parser = xml_parser_create();

    // Then setup the handlers:

    xml_set_element_handler($xml_parser, "startElement", "endElement");
    xml_set_character_data_handler($xml_parser, "characterData");

    // Open the actual datafile:

    $fp = fopen($backend, "r");

    // Run through it line by line and parse:

    while ($data = fread($fp, 4096)) {
    xml_parse($xml_parser, $data, feof($fp))
    or die(sprintf("XML error: %s at line %d",

    // Close the datafile


    // Free any memmory used



    But in this code the problem is that it doesn't recognise LJ-cut and doesn't do caching.

    If anyone modifies the code and make it efficient then it'll be helpful :)

    Source: http://www.livejournal.com/community/php/296862.html

  12. XML?

    Date: 05/09/05 (Computer Geeks)    Keywords: rss, xml, web

    What's the best - and free - way to add XML syndication feeds to a website?

    I'm working on my own site right now (unfortunately, I can't make the whole thing live until the DNS changes to my GoDaddy domain go through), and my goal is to have three separate blogs through Blogger.com...and I want to display a feed from the two secondary blogs on my front page (like have a section for a secondary blog, containing links and the first few lines from each article in that blog...). I know I can use FeedBurner to convert my Atom XML feeds to RSS, but either way, how do I make my site display the XML information?

    Thanks in advance!

    Source: http://www.livejournal.com/community/computergeeks/680022.html

  13. XSLT Date-Time Formatting

    Date: 05/18/05 (Web Development)    Keywords: xml

    Hi all:

    I am pretty new to XSLT and I am not sure exactly how to do the following.

    I am given a date in an XML feed in the following format:

    Tue, 17 May 2005 13:00:00 GMT

    I need to translate this value using XSLT to something like:

    1:00 PM

    I have been doing some reading and believe that I need to make an xsl:template however this is a bit confusing to me and i'm not really sure how to build one that will do what I need. Any suggestions/examples would be greately appreciated!

    Source: http://www.livejournal.com/community/webdev/200780.html

  14. Bookmarks for web-developers

    Date: 05/24/05 (WebDesign)    Keywords: css, html, xml, web, seo

    The "Bookmarks for web-designers and web-developers" contains over 200 links to resources related to webdesign.


    01. Creativity
    02. CSS techniques and examples
    02 a. CSS techniques
    02 b. Tabs & Navigation Menus
    02 c. CSS- & HTML-Web-Tools
    02 d. CSS/HTML-Specifications
    02 e. Other useful Web-Tools
    03. Web design
    03 a. Written & unwritten rules
    03 b. Color Tools, Mixers etc.
    03 c. Web Design magazines
    03 d. Royalty free photos
    04. Usability
    05. Freelancers resources
    06. Search engines & SEO
    07. Other catalogs
    08. Bookmarks: Maxi version
    Submit a link

    The list is updated once a week and has an XML Feed.

    Source: http://www.livejournal.com/community/webdesign/888530.html

  15. Essential bookmarks for web-developers

    Date: 05/24/05 (Web Development)    Keywords: css, html, xml, web, seo

    The "Bookmarks for web-designers and web-developers" contains over 200 links to resources related to web-design and web-development.


    01. Creativity

    02. CSS techniques and examples

    02 a. CSS techniques
    02 b. Tabs & Navigation Menus
    02 c. CSS- & HTML-Web-Tools
    02 d. CSS/HTML-Specifications
    02 e. Other useful Web-Tools

    03. Web design
    03 a. Written & unwritten rules
    03 b. Color Tools, Mixers etc.
    03 c. Web Design magazines
    03 d. Royalty free photos

    04. Usability

    05. Freelancers resources

    06. Search engines & SEO

    07. Other catalogs

    08. Bookmarks: Maxi version
    Submit a link

    The list is updated once a week and has an XML Feed.

    Source: http://www.livejournal.com/community/webdev/203770.html

  16. PHP and HttpRequest

    Date: 05/26/05 (PHP Community)    Keywords: php, xml, java

    I've been doing a little studying into the javascrip HttpRequest object. In addition to not finding a good tutorial on the system, I haven't found anything about how to use it in combination with PHP.

    The specific problem I have is that I need to send a large block of text to the server in order to get specialized list of data. Most of the examples I see either send the data via GET -- which wouldn't work for this size of data -- or through the use of a small bit of XML. Moreover, I'm not sure how to write the receiving script.

    Can anyone enlighten me, or in the least, point me to a good tutorial?

    Source: http://www.livejournal.com/community/php/300747.html

  17. Microsoft advises IE users to uninstall Netscape 8

    Date: 05/26/05 (Web Technology)    Keywords: software, browser, xml

    Software giant says Netscape's latest browser appears to break the XML rendering capabilities in Internet Explorer.

    Source: http://news.zdnet.com/Microsoft+advises+IE+users+to+uninstall+Netscape+8/2100-9588_22-5721852.html?part=rss&tag=feed&subj=zdnn

  18. XML Encoding

    Date: 05/26/05 (PHP Community)    Keywords: rss, html, xml

    I'm writing a lib to produce RSS/Atom feeds for a site.

    I have the character “ in some stories.

    I have done htmlspecialchars($title), however, this still produces a character that feedvalidator.com don't like in the XML.

    How should I correctly trap/encode this (and other similar) characters?

    Source: http://www.livejournal.com/community/php/301066.html

  19. Slavishly paraphrased from Slashdot...

    Date: 05/29/05 (Mozilla)    Keywords: xml, java

    "Mozilla's Deer Park 1 Alpha RC appears to have extended the Javascript specification. New features include Array object methods "every" (logical AND), "some" (logical OR), "map" (function mapping), and "forEach" (iteration). They also appear to have added native XML support."

    So, what do you all think? I'm just musing here, but since the new array object methods are not part of the ECMAscript specification can we still tout conformance to "just the specification and only the specification" as a Firefox feature? Are these the first steps in the dreaded embrace and extend? Would such superfluous arguments be mitigated if such constructs and methods were enforced as not usable, or maybe just flagged as warnings in the console when called outside of XUL jars?


    Source: http://www.livejournal.com/community/mozilla/286649.html

  20. Any Thunderbird RSS gurus out there?

    Date: 05/31/05 (Mozilla)    Keywords: php, rss, html, xml, web

    I just started using Thunderbird as an RSS reader and I'm noticing strange behavior with my feed. If I load up http://www.perturb.org/rss.php in thunderbird the entries it displays are links to web pages. When I view one of those feeds it shows that entry as it is embeded on the webpage. If I look at one of the entries from http://www.lessig.org/blog/index.xml the entry shows the raw text that's in the RSS feed no HTML requests made.

    Considering the first feed is from my blog, how do I make Thunderbird show the raw content, instead of the HTML. It's exported correctly. Bloglines sees the content just fine. Is there a Thunderbird setting I'm missing?

    Source: http://www.livejournal.com/community/mozilla/287317.html

  21. $str1=strstr($val," $pos1=strpos($str1,'>');
    print "
    echo "
    echo "


    $str1=strstr($content,"Current mood:");
    $pos1=strpos($str1," $pos2=strpos($str1,"
    Previous page  ||  Next page

antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home