Click here to Skip to main content
15,915,501 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: echo not working Pin
Graham Breach19-May-11 6:25
Graham Breach19-May-11 6:25 
GeneralRe: echo not working Pin
Steve Harp19-May-11 9:50
Steve Harp19-May-11 9:50 
QuestionE-mail tracking in PHP Pin
ubaidur19-May-11 2:30
ubaidur19-May-11 2:30 
AnswerRe: E-mail tracking in PHP Pin
Gerben Jongerius19-May-11 3:47
Gerben Jongerius19-May-11 3:47 
GeneralRe: E-mail tracking in PHP Pin
ubaidur19-May-11 21:06
ubaidur19-May-11 21:06 
AnswerRe: E-mail tracking in PHP Pin
cjoki25-May-11 5:32
cjoki25-May-11 5:32 
QuestionHow to Compile a .PHP File Pin
Sajju201114-May-11 9:06
Sajju201114-May-11 9:06 
AnswerRe: How to Compile a .PHP File Pin
Luc Pattyn14-May-11 11:09
sitebuilderLuc Pattyn14-May-11 11:09 
QuestionBLDMAKE ERROR: Can't find any RVCT installation. Pin
Raj Aryan 100110-May-11 5:03
Raj Aryan 100110-May-11 5:03 
AnswerRe: BLDMAKE ERROR: Can't find any RVCT installation. Pin
Uilleam23-Jul-11 15:17
Uilleam23-Jul-11 15:17 
QuestionExecuting PHP script without leaving the page Pin
AmbiguousName3-May-11 5:03
AmbiguousName3-May-11 5:03 
AnswerRe: Executing PHP script without leaving the page Pin
enhzflep3-May-11 5:09
enhzflep3-May-11 5:09 
AnswerRe: Executing PHP script without leaving the page PinPopular
enhzflep3-May-11 6:39
enhzflep3-May-11 6:39 
QuestionTo use or not to use Pin
astra.20123-May-11 0:10
astra.20123-May-11 0:10 
QuestionPHP Form help Pin
Dave McCool30-Apr-11 8:54
Dave McCool30-Apr-11 8:54 
AnswerRe: PHP Form help Pin
Peter_in_27801-May-11 4:59
professionalPeter_in_27801-May-11 4:59 
GeneralRe: PHP Form help Pin
Dave McCool1-May-11 5:08
Dave McCool1-May-11 5:08 
Questionthe apache service doesn't start Pin
Farhaneh25-Apr-11 20:10
Farhaneh25-Apr-11 20:10 
AnswerRe: the apache service doesn't start Pin
Gerben Jongerius25-Apr-11 20:41
Gerben Jongerius25-Apr-11 20:41 
QuestionAn XML printer thingy Pin
freeluna22-Apr-11 14:23
professionalfreeluna22-Apr-11 14:23 
Hi All -

After shaking my head with the output of xml.Elementry(root).write(fp), which dumps the entire XML tree structure onto one line, I started doing some research. I checked out prettyprint from effbot.org, which sort of inspired me to write the following.. It handles stand alone XML tags and XML tag pairs, attributes, tag text and tag tails. I hope people find it useful...

import xml.etree.ElementTree as xml


def DumpXMLElem(e,deep=0):
    noneg = 0

    # indent the tag according to the depth in the element tree.

    for i in range(0,deep):
        print '   ',

    # find out if the elment has children or a text field, if so
    # this is part of a tag-pair, otherwise it's a single stand-
    # alone tag.

    c = e.getchildren()
    
    # print the beginning of the open tag
    print '<'+e.tag,

    # print the tag attributes within the opening tag
    for i in e.attrib:
        print ' '+i+"="+e.attrib[i],
    
    # if this is a stand-alone tag (no children and no text)
    # print out the proper tag terminator
 
    if(len(c)==0 and e.text==None):
        print '/>',

        # print the tail, if supplied
        if(e.tail):
            print e.tail
        print ' '
        noneg=1    # flag to avoid printing the closing tag
    else:
        # this is part of a tag pair
        print '>',

    # print the tag's text, usually that stuff between the opening and closing tag.
    if(e.text):
        print e.text,
    # if the element has children, end this line and go process the children.
    if(len(c)>0):
        print ' '
        for s in c:
            DumpXMLElem(s,deep+1)
        # back from dealing with the kids, go line-up the ending tag with the 
        # same indent as the opening tag.
        for i in range(0,deep):
            print '   ',
    # print that ending tag, and any tail that the element had...
    if(noneg==0):
        print '</'+e.tag+'>',
        if(e.tail):
            print e.tail
        print ' '

QuestionClosing a window with button?? Pin
AmbiguousName21-Apr-11 6:00
AmbiguousName21-Apr-11 6:00 
AnswerRe: Closing a window with button?? Pin
Ali Al Omairi(Abu AlHassan)21-Apr-11 15:21
professionalAli Al Omairi(Abu AlHassan)21-Apr-11 15:21 
AnswerRe: Closing a window with button?? Pin
enhzflep3-May-11 6:53
enhzflep3-May-11 6:53 
QuestionHow to open Perl files / Perl Module files in Design Layout Pin
sr15920-Apr-11 19:04
sr15920-Apr-11 19:04 
QuestionFuzzy C Means in PHP Code and My SQL Database, Please Help! Pin
edrianhadinatazz18-Apr-11 19:35
edrianhadinatazz18-Apr-11 19:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.