def test():
    print 'testing source code syntax'
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    di = doc._get_implementation()
    doc2 = implementation.createHTMLDocument('The Title')
    import xml.dom.ext
    xml.dom.ext.PrettyPrint(doc2)
    return 1
def test():
    print 'testing source code syntax'
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    di = doc._get_implementation()
    doc2 = implementation.createHTMLDocument('The Title')
    import xml.dom.ext
    xml.dom.ext.PrettyPrint(doc2)
    return 1
Example #3
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLFormElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('Form')

    print 'testing get/set'

    testAttribute(f,'name')
    testAttribute(f,'acceptCharset')
    testAttribute(f,'action')
    testAttribute(f,'encType')
    testAttribute(f,'target')
    f._set_method("TEST")
    rt = f._get_method()
    if rt != "Test":
        error('get/set of method failed')

    print 'get/sets work'
    print 'test getElements'
    i = doc.createElement('IsIndex')
    f.appendChild(i)
    hc = f._get_elements()
    if hc.length != 1:
        error('getElements failed')
    if f._get_length() != 1:
        error('getLength failed')
    print 'getElements works'
Example #4
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTableCellElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    c = doc.createElement('TD')

    print 'testing get/set'
    testAttribute(c,'abbr');
    testAttribute(c,'axis');
    testAttribute(c,'bgColor');
    testAttribute(c,'ch');
    testAttribute(c,'chOff');
    testIntAttribute(c,'colSpan');
    testAttribute(c,'headers');
    testAttribute(c,'height');
    testIntAttribute(c,'noWrap');
    testIntAttribute(c,'rowSpan');
    testAttribute(c,'width');
    print 'get/set works'
    c._set_align('left')
    rt = c._get_align()
    if rt != 'Left':
        error('get/set align failed')
    c._set_vAlign('top')
    rt = c._get_vAlign()
    if rt != 'Top':
        error('get/set align failed')
    c._set_scope('colgroup')
    rt = c._get_scope()
    if rt != 'Colgroup':
        error('get/set align failed')
Example #5
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLIFrameElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('IFrame')

    print 'testing get/set'
    testAttribute(f,'height');
    testAttribute(f,'longDesc');
    testAttribute(f,'marginHeight');
    testAttribute(f,'marginWidth');
    testAttribute(f,'src');
    testAttribute(f,'width');
    f._set_align('left')
    rt = f._get_align()
    if rt != 'Left':
        error('get/set of align failed')
    f._set_frameBorder('left')
    rt = f._get_frameBorder()
    if rt != 'Left':
        error('get/set of frameBorder failed')
    f._set_scrolling('auto')
    rt = f._get_scrolling()
    if rt != 'Auto':
        error('get/set of scrolling failed')

    print 'get/set works'
Example #6
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLIFrameElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('IFrame')

    print 'testing get/set'
    testAttribute(f, 'height')
    testAttribute(f, 'longDesc')
    testAttribute(f, 'marginHeight')
    testAttribute(f, 'marginWidth')
    testAttribute(f, 'src')
    testAttribute(f, 'width')
    f._set_align('left')
    rt = f._get_align()
    if rt != 'Left':
        error('get/set of align failed')
    f._set_frameBorder('left')
    rt = f._get_frameBorder()
    if rt != 'Left':
        error('get/set of frameBorder failed')
    f._set_scrolling('auto')
    rt = f._get_scrolling()
    if rt != 'Auto':
        error('get/set of scrolling failed')

    print 'get/set works'
Example #7
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLFormElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('Form')

    print 'testing get/set'

    testAttribute(f, 'name')
    testAttribute(f, 'acceptCharset')
    testAttribute(f, 'action')
    testAttribute(f, 'encType')
    testAttribute(f, 'target')
    f._set_method("TEST")
    rt = f._get_method()
    if rt != "Test":
        error('get/set of method failed')

    print 'get/sets work'
    print 'test getElements'
    i = doc.createElement('IsIndex')
    f.appendChild(i)
    hc = f._get_elements()
    if hc.length != 1:
        error('getElements failed')
    if f._get_length() != 1:
        error('getLength failed')
    print 'getElements works'
Example #8
0
 def initState(self, ownerDoc=None, charset=''):
     self._ownerDoc = ownerDoc or implementation.createHTMLDocument('')
     self._charset = charset or DEFAULT_CHARSET
     self.rootNode = self._ownerDoc.createDocumentFragment()
     self._stack = [self.rootNode]
     self._hasHtml = 0
     return
Example #9
0
 def initState(self, ownerDoc=None, charset=''):
     self._ownerDoc = ownerDoc or implementation.createHTMLDocument('')
     self._charset = charset or DEFAULT_CHARSET
     self.rootNode = self._ownerDoc.createDocumentFragment()
     self._stack = [self.rootNode]
     self._hasHtml = 0
     return
Example #10
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLImageElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    i = doc.createElement('IMG')

    print 'testing get/set'
    testAttribute(i, 'lowSrc')
    testAttribute(i, 'alt')
    testAttribute(i, 'border')
    testAttribute(i, 'height')
    testAttribute(i, 'hspace')
    testIntAttribute(i, 'isMap')
    testAttribute(i, 'longDesc')
    testAttribute(i, 'src')
    testAttribute(i, 'useMap')
    testAttribute(i, 'vspace')
    testAttribute(i, 'width')

    i._set_align('left')
    rt = i._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
Example #11
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTableCellElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    c = doc.createElement('TD')

    print 'testing get/set'
    testAttribute(c, 'abbr')
    testAttribute(c, 'axis')
    testAttribute(c, 'bgColor')
    testAttribute(c, 'ch')
    testAttribute(c, 'chOff')
    testIntAttribute(c, 'colSpan')
    testAttribute(c, 'headers')
    testAttribute(c, 'height')
    testIntAttribute(c, 'noWrap')
    testIntAttribute(c, 'rowSpan')
    testAttribute(c, 'width')
    print 'get/set works'
    c._set_align('left')
    rt = c._get_align()
    if rt != 'Left':
        error('get/set align failed')
    c._set_vAlign('top')
    rt = c._get_vAlign()
    if rt != 'Top':
        error('get/set align failed')
    c._set_scope('colgroup')
    rt = c._get_scope()
    if rt != 'Colgroup':
        error('get/set align failed')
Example #12
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLObjectElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    o = doc.createElement('OBJECT')

    print 'testing get/set'
    testAttribute(o, 'code')
    testAttribute(o, 'archive')
    testAttribute(o, 'border')
    testAttribute(o, 'codeBase')
    testAttribute(o, 'codeType')
    testAttribute(o, 'data')
    testIntAttribute(o, 'declare')
    testAttribute(o, 'height')
    testAttribute(o, 'hspace')
    testAttribute(o, 'standby')
    testIntAttribute(o, 'tabIndex')
    testAttribute(o, 'type')
    testAttribute(o, 'useMap')
    testAttribute(o, 'vspace')
    testAttribute(o, 'width')
    o._set_align('left')
    rt = o._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
Example #13
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLImageElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    i = doc.createElement('IMG')

    print 'testing get/set'
    testAttribute(i,'lowSrc')
    testAttribute(i,'alt')
    testAttribute(i,'border')
    testAttribute(i,'height')
    testAttribute(i,'hspace')
    testIntAttribute(i,'isMap')
    testAttribute(i,'longDesc')
    testAttribute(i,'src')
    testAttribute(i,'useMap')
    testAttribute(i,'vspace')
    testAttribute(i,'width')

    i._set_align('left')
    rt = i._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
Example #14
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLInputElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('Form')

    text = doc.createElement('Input')
    text.setAttribute('TYPE','TEXT')

    radio = doc.createElement('Input')
    radio.setAttribute('TYPE','RADIO')

    image = doc.createElement('Input')
    image.setAttribute('TYPE','IMAGE')

    f.appendChild(text)
    f.appendChild(radio)
    f.appendChild(image)

    print 'testing generic get/set functions'
    testAttribute(text,'defaultValue')
    testAttribute(text,'accept')
    testAttribute(text,'accessKey')
    testAttribute(text,'alt')
    testAttribute(text,'name')
    testAttribute(text,'size')
    testAttribute(image,'src')
    testAttribute(text,'useMap')
    testAttribute(text,'value')

    text._set_align('left')
    rt = text._get_align()
    if rt != 'Left':
        error('get/set of align failed')

    if image._get_type() != 'Image':
        error('get of type failed')

    print 'get/set works'

    print 'testing int Attributes'
    testIntAttribute(radio,'defaultChecked');
    testIntAttribute(radio,'checked');
    testIntAttribute(radio,'disabled');
    testIntAttribute(text,'maxLength');
    testIntAttribute(text,'readOnly');
    testIntAttribute(text,'tabIndex');

    print 'Int get/sets work'

    print "testing cloneNode"
    i2 = radio.cloneNode(0);
    if i2._get_defaultChecked() != radio._get_defaultChecked():
        error('cloneNode failed to copy defaultChecked')
    i3 = text.cloneNode(0)
    if i3._get_defaultValue() != text._get_defaultValue():
        error('cloneNode failed to copy defaultValue')
    print 'cloneNode works'
Example #15
0
def test():
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    print 'Testing source code syntax'
    from xml.dom.html import HTMLLinkElement

    l = doc.createElement('LINK')

    print 'testing get/set of attributes'

    if l._get_disabled() != 0:
        error('get disabled failed for false')

    l._set_disabled(0)

    if l._get_disabled() != 0:
        error('get disabled failed for false')

    l._set_disabled(1)

    if l._get_disabled() != 1:
        error('get/set disabled failed for true')

    l._set_charset('TEST')
    if l._get_charset() != 'TEST':
        error('get/set failed for CharSet')

    l._set_href('TEST')
    if l._get_href() != 'TEST':
        error('get/set failed for href')

    l._set_hreflang('EN')
    if l._get_hreflang() != 'EN':
        error('get/set failed for hrefLang')

    l._set_media('TEST')
    if l._get_media() != 'TEST':
        error('get/set failed for MEDIA')

    l._set_rel('TEST')
    if l._get_rel() != 'TEST':
        error('get/set failed for REL')

    l._set_rev('TEST')
    if l._get_rev() != 'TEST':
        error('get/set failed for Rev')

    l._set_target('TEST')
    if l._get_target() != 'TEST':
        error('get/set failed for TARGET')

    l._set_type('TEST')
    if l._get_type() != 'TEST':
        error('get/set failed for TYPE')

    print 'get/set works'
Example #16
0
def test():
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    print 'Testing source code syntax'
    from xml.dom.html import HTMLLinkElement

    l = doc.createElement('LINK')

    print 'testing get/set of attributes'

    if l._get_disabled() != 0:
        error('get disabled failed for false');

    l._set_disabled(0)

    if l._get_disabled() != 0:
        error('get disabled failed for false');

    l._set_disabled(1);

    if l._get_disabled() != 1:
        error('get/set disabled failed for true');

    l._set_charset('TEST');
    if l._get_charset() != 'TEST':
        error('get/set failed for CharSet');

    l._set_href('TEST');
    if l._get_href() != 'TEST':
        error('get/set failed for href');

    l._set_hreflang('EN');
    if l._get_hreflang() != 'EN':
        error('get/set failed for hrefLang');

    l._set_media('TEST');
    if l._get_media() != 'TEST':
        error('get/set failed for MEDIA');

    l._set_rel('TEST');
    if l._get_rel() != 'TEST':
        error('get/set failed for REL');

    l._set_rev('TEST');
    if l._get_rev() != 'TEST':
        error('get/set failed for Rev');

    l._set_target('TEST');
    if l._get_target() != 'TEST':
        error('get/set failed for TARGET');

    l._set_type('TEST');
    if l._get_type() != 'TEST':
        error('get/set failed for TYPE')

    print 'get/set works'
Example #17
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMenuElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('MENU')

    print 'testing get/set'
    testIntAttribute(m, 'compact')
    print 'get/set works'
Example #18
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLQuoteElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('BlockQuote');

    print 'testing get/set'
    testAttribute(b,'cite');
    print 'get/set works'
Example #19
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMenuElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('MENU')

    print 'testing get/set'
    testIntAttribute(m,'compact')
    print 'get/set works'
Example #20
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLPreElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    p = doc.createElement('PRE')

    print 'testing get/set'
    testIntAttribute(p, 'width')
    print 'get/set works'
Example #21
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLQuoteElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    q = doc.createElement('Q')

    print 'testing get/set'
    testAttribute(q,'cite')
    print 'get/set works'
Example #22
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLPreElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    p = doc.createElement('PRE')

    print 'testing get/set'
    testIntAttribute(p,'width')
    print 'get/set works'
Example #23
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLDListElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    d = doc.createElement('DL')

    print 'testing get and set'
    testIntAttribute(d,'compact')
    print 'get/set works'
Example #24
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLModElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('ins')

    print 'testing get/set'
    testAttribute(m, 'cite')
    testAttribute(m, 'dateTime')
    print 'get/set works'
Example #25
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLModElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('ins')

    print 'testing get/set'
    testAttribute(m,'cite')
    testAttribute(m,'dateTime')
    print 'get/set works'
Example #26
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBaseElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('Base')

    print 'testing get/set attributes'
    testAttribute(b,'href')
    testAttribute(b,'target')
    print 'get/set works'
Example #27
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLFrameSetElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('FrameSet')

    print 'testing get/set'
    testAttribute(f, 'cols')
    testAttribute(f, 'rows')
    print 'get/set works'
Example #28
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLFrameSetElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('FrameSet')

    print 'testing get/set'
    testAttribute(f,'cols')
    testAttribute(f,'rows')
    print 'get/set works'
Example #29
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBaseElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('Base')

    print 'testing get/set attributes'
    testAttribute(b, 'href')
    testAttribute(b, 'target')
    print 'get/set works'
Example #30
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBaseFontElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('BaseFont')

    print 'testing get/set'
    testAttribute(b,'color');
    testAttribute(b,'face');
    testAttribute(b,'size');
    print 'get/set works'
Example #31
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLLabelElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    l = doc.createElement('LABEL')

    print 'testing get/set attributes'

    testAttribute(l, 'accessKey')
    testAttribute(l, 'htmlFor')
    print 'get/set works'
Example #32
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLLabelElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    l = doc.createElement('LABEL')

    print 'testing get/set attributes'

    testAttribute(l,'accessKey')
    testAttribute(l,'htmlFor')
    print 'get/set works'
Example #33
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBaseFontElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('BaseFont')

    print 'testing get/set'
    testAttribute(b, 'color')
    testAttribute(b, 'face')
    testAttribute(b, 'size')
    print 'get/set works'
Example #34
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHeadElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('Head')

    print 'testing get/set profile'
    h._set_profile('PROFILE')
    if h._get_profile() != 'PROFILE':
        error('get/set profile failed')
    print 'get/set profile works'
Example #35
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHeadElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('Head')

    print 'testing get/set profile'
    h._set_profile('PROFILE')
    if h._get_profile() != 'PROFILE':
        error('get/set profile failed')
    print 'get/set profile works'
Example #36
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLLIElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    l = doc.createElement('LI')

    print 'testing get/set'

    testAttribute(l,'type')
    testIntAttribute(l,'value')

    print 'get/set works'
Example #37
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTitleElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    t = doc.createElement('TITLE')

    print 'test get/set text'

    t._set_text('TEST');
    if t._get_text() != 'TEST':
        error('get/set text failed');
    print 'text works'
Example #38
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHeadingElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('H1')

    print 'testing get/set'
    h._set_align('left')
    rt = h._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
Example #39
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHeadingElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('H1')

    print 'testing get/set'
    h._set_align('left')
    rt = h._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
Example #40
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTitleElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    t = doc.createElement('TITLE')

    print 'test get/set text'

    t._set_text('TEST')
    if t._get_text() != 'TEST':
        error('get/set text failed')
    print 'text works'
Example #41
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMetaElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('META')

    print 'testing get/set of attributes'

    testAttribute(m, 'content')
    testAttribute(m, 'httpEquiv')
    testAttribute(m, 'scheme')

    print 'get/set works'
Example #42
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMetaElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('META')

    print 'testing get/set of attributes'

    testAttribute(m,'content')
    testAttribute(m,'httpEquiv')
    testAttribute(m,'scheme')

    print 'get/set works'
Example #43
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBRElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('BR');

    print 'testing get/set'
    b._set_clear('left')
    rt = b._get_clear()
    if rt != 'Left':
        error('get/set clear failed')

    print 'get/set works'
Example #44
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBRElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('BR')

    print 'testing get/set'
    b._set_clear('left')
    rt = b._get_clear()
    if rt != 'Left':
        error('get/set clear failed')

    print 'get/set works'
Example #45
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLButtonElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('Button');

    print 'testing get/set attributes'

    testAttribute(b,'accessKey');
    testIntAttribute(b,'disabled');
    testAttribute(b,'name');
    testIntAttribute(b,'tabIndex');
    testAttribute(b,'value');
    print 'get/sets works'
Example #46
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMapElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('MAP')
    a = doc.createElement('AREA')

    print "testing get/set"
    m.appendChild(a);
    print "get Areas"
    as = m._get_areas()

    if as[0].nodeName != a.nodeName:
        error('getAreas failed')
Example #47
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLLegendElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    l = doc.createElement('LEGEND')

    print 'testing get/set'
    testAttribute(l,'accessKey')

    l._set_align('left')
    rt = l._get_align()
    if rt != 'Left':
        error('get/set of align failed')
    print 'get/set works'
Example #48
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLUListElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    u = doc.createElement('UL')

    print 'testing get/set'
    testIntAttribute(u, 'compact')

    u._set_type('ordered')
    rt = u._get_type()
    if rt != 'Ordered':
        error('get/set of type failed')
    print 'get/set works'
Example #49
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLParamElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    p = doc.createElement('PARAM')

    print "testing get/set"

    testAttribute(p,'type')
    testAttribute(p,'value')
    p._set_valueType('object')
    rt = p._get_valueType()
    if rt != 'Object':
        error('get/set valueType failed')
    print "get/sets work"
Example #50
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLScriptElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    s = doc.createElement('SCRIPT')

    print "testing get/set"

    testAttribute(s,'text')
    testAttribute(s,'charset')
    testAttribute(s,'src')
    testAttribute(s,'type')
    testIntAttribute(s,'defer')

    print "get/sets work"
Example #51
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLParamElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    p = doc.createElement('PARAM')

    print "testing get/set"

    testAttribute(p, 'type')
    testAttribute(p, 'value')
    p._set_valueType('object')
    rt = p._get_valueType()
    if rt != 'Object':
        error('get/set valueType failed')
    print "get/sets work"
Example #52
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBodyElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    b = doc.createElement('Body')

    print 'testing get/set '
    testAttribute(b, 'aLink')
    testAttribute(b, 'background')
    testAttribute(b, 'bgColor')
    testAttribute(b, 'link')
    testAttribute(b, 'text')
    testAttribute(b, 'vLink')
    print 'get/set works'
Example #53
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLBodyElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    b = doc.createElement('Body');

    print 'testing get/set '
    testAttribute(b,'aLink');
    testAttribute(b,'background');
    testAttribute(b,'bgColor');
    testAttribute(b,'link');
    testAttribute(b,'text');
    testAttribute(b,'vLink');
    print 'get/set works'
Example #54
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHRElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('HR')

    print 'testing get/set'
    h._set_align('left')
    rt = h._get_align()
    if rt != 'Left':
        error('get/set align failed')
    testIntAttribute(h,'noShade')
    testAttribute(h,'size')
    testAttribute(h,'width')
    print 'get/set works'
Example #55
0
def test():
    print "testing source code syntax"
    from xml.dom.html import HTMLUListElement
    from xml.dom import implementation

    doc = implementation.createHTMLDocument("Title")
    u = doc.createElement("UL")

    print "testing get/set"
    testIntAttribute(u, "compact")

    u._set_type("ordered")
    rt = u._get_type()
    if rt != "Ordered":
        error("get/set of type failed")
    print "get/set works"
Example #56
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLScriptElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    s = doc.createElement('SCRIPT')

    print "testing get/set"

    testAttribute(s, 'text')
    testAttribute(s, 'charset')
    testAttribute(s, 'src')
    testAttribute(s, 'type')
    testIntAttribute(s, 'defer')

    print "get/sets work"