[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Accessing HTML element attributes from dom_nodeimpl.cpp
From:       "Db Mahendra-a5792c" <a5792c () motorola ! com>
Date:       2007-05-22 10:50:39
Message-ID: 7C57DB58C81FB64CA979EC6C4DB73E7A01D5CEDE () ZMY16EXM67 ! ds ! mot ! com
[Download RAW message or body]

Hi,
 
      Can any one suggest how to access HTML element attributes if we
have corresponding DOM node pointer ? I tried following piece of code
thru ddd debugger to access the element attributes of COL element; but
unfortunately it failed. It is displaying some unreadable characters. 
 
printf  "%s" ,
(this->enclosingBlockFlowOrTableElement())->getAttribute(this->id()).m_s
tring.string().ascii()
 
printf  "%s" ,
(this->enclosingBlockFlowOrTableElement())->getAttribute(this->id()).m_s
tring.string().latin1()
 
printf  "%s" ,
(this->enclosingBlockFlowOrTableElement())->getAttribute(this->id()).m_s
tring.string().data()
 
Note:  In above statements, "this" is a COL Node pointer. (NodeImpl*).
The function enclosingBlockFlowOrTableElement() returns ElementImpl* .
 
Thanks ...
 
Regards,
mdb
 

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Can any one suggest how 
to access HTML element attributes if we have corresponding DOM node pointer ? I 
tried following piece of code thru ddd debugger to access the element attributes 
of COL element; but unfortunately it failed. It is displaying some unreadable 
characters. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=374280310-22052007>printf&nbsp; "%s" , 
(this-&gt;enclosingBlockFlowOrTableElement())-&gt;getAttribute(this-&gt;id()).m_string.string().ascii()</SPAN></FONT></DIV>
 <DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=374280310-22052007><SPAN 
class=374280310-22052007>printf&nbsp; "%s" , 
(this-&gt;enclosingBlockFlowOrTableElement())-&gt;getAttribute(this-&gt;id()).m_string.string().latin1()</SPAN></SPAN></FONT></DIV>
 <DIV><FONT face=Arial size=2><SPAN class=374280310-22052007><SPAN 
class=374280310-22052007></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=374280310-22052007><SPAN 
class=374280310-22052007><SPAN class=374280310-22052007>printf&nbsp; "%s" , 
(this-&gt;enclosingBlockFlowOrTableElement())-&gt;getAttribute(this-&gt;id()).m_string.string().data()</SPAN></SPAN></SPAN></FONT></DIV>
 <DIV><FONT face=Arial size=2><SPAN class=374280310-22052007><SPAN 
class=374280310-22052007><SPAN 
class=374280310-22052007></SPAN></SPAN></SPAN></FONT><FONT face=Arial 
size=2><SPAN class=374280310-22052007><SPAN class=374280310-22052007><SPAN 
class=374280310-22052007></SPAN></SPAN></SPAN></FONT><FONT face=Arial 
size=2><SPAN class=374280310-22052007><SPAN class=374280310-22052007><SPAN 
class=374280310-22052007></SPAN></SPAN></SPAN></FONT><FONT face=Arial 
size=2><SPAN class=374280310-22052007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007><STRONG><U>Note:</U></STRONG>&nbsp; In above 
statements, "this" is a COL Node pointer. (NodeImpl*). The function 
enclosingBlockFlowOrTableElement() returns ElementImpl* .</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=374280310-22052007>Thanks 
...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007>Regards,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007>mdb</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=374280310-22052007></SPAN></FONT>&nbsp;</DIV></BODY></HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic