Need help in getting common DOM API to work

Grettings, all -
I'm up against the wall. I have spend a lot of time trying to get Common DOM API to work to no avial. So far I tried it with Netscape 6.2.3, Mozilla 1.0 and MSIE 6. My problem is that while I get non-null Document, all calls on it return null. Here is the code snippet I have:
public class Foo extends Applet {
Applet m_appletThis;
StringBuffer m_sbuf;
public void init() {
m_appletThis = this;
m_sbuf = new StringBuffer();
addItem("initializing... ");
try {
JSObject jsWin = JSObject.getWindow(this);
JSObject jsDoc = (JSObject)jsWin.getMember("document");
String sName = (String)jsDoc.getMember("name");
Object oLocation = (JSObject)jsDoc.getMember("location");
addItem("location=" + oLocation);
String sTitle = (String)jsDoc.getMember("title");
addItem("title=" + sTitle);
addItem("initialized! ");
catch (JSException e) {
e.printStackTrace();
public void start() {
addItem("starting... ");
DOMService ds = null;
try {
ds = DOMService.getService(this);
String sTitle = (String)ds.invokeAndWait(new DOMAction() {
public Object run(DOMAccessor da) {
Document doc = da.getDocument(m_appletThis);
return doc.getNodeValue();
addItem(sTitle);
// let's try again
Document doc = (Document)ds.invokeAndWait(new DOMAction() {
public Object run(DOMAccessor da) {
Document doc;
NamedNodeMap nnm;
Node node;
doc = (Document)da.getDocument(m_appletThis);
nnm = doc.getAttributes();
NodeList nl = doc.getChildNodes();
if (null == nl)
addItem("no children!");
else
for (int i = 0; i < nl.getLength(); i++) {
node = nl.item(i);
addItem((null == node) ?
("no node" + i) : node.getNodeName());
if (null == nnm)
addItem("no attribs!");
else {
node = nnm.getNamedItem("location");
if (null == node)
addItem("no node!");
else
addItem(node.getNodeValue());
return doc;
catch (DOMUnsupportedException e1) {
e1.printStackTrace();
catch (DOMAccessException e2) {
e2.printStackTrace();
addItem("started! ");
public void stop() {
addItem("stopping... ");
public void destroy() {
addItem("preparing for unloading...");
void addItem(String newWord) {
System.out.println(newWord);
m_sbuf.append(newWord + "\r\n");
repaint();
public void paint(Graphics g) {
Dimension dim = getSize();
//Draw a Rectangle around the applet's display area.
g.drawRect(0, 0, dim.width - 1, dim.height - 1);
//Draw the current string inside the rectangle.
g.drawString(m_sbuf.toString(), 5, 15);
This produces the following output:
initializing...
location=file:///foo.bar.html
title=
initialized!
starting...
null
no children!
no attribs!
started!
As starting/started lines show all of my attempts to get access to browsers DOM fail.
I will really appreciate any advice you can provide. Thanks in advance.
- Andrew

hi,
i desperately tried similar things and, after studying some forum entries, it seems to me that common dom DOES NOT WORK...
sorry for us, but bugparade promises to fix that in 1.4.2 (somewhen in 2003 :-( )
if you need dom-access try jsobject or the ibm directDOM-technology, that seems to work much better..
greets,
dirk

Similar Messages

  • Need help in getting proposed approvers for a work item

    Hi All,
        We are trying to get the proposed approvers and the actual approver details for a particular work item.
    Before the work item is actioned we are able to see all the proposed agents for that particular work item.
    But once that work item is actioned then only the agen who has actioned on the work item is appearing in the list. All other agents are not appearing.
    For this we are using the FM BBP_WFL_DIN_APPR_WORKFLOW_GET.
    We have also tried some other FM's and tables, but none of them were helpfull.
    Please let us know if you know any table or FM or class which we can use to get these details.
    Scenario:
    Work Item: 12345    
    Before action on the work item
    Possible(Proposed) agents: Agent 1, Agent 2, Agent 3.
    Actual Agent: blank
    What we want, after action on the work item if "Agent 2" acts on that item.
    Possible(Proposed) agents: Agent 1, Agent 2, Agent 3.
    Actual Agent: Agent 2
    But what we are get is:
    Possible(Proposed) agents: Agent 2.
    Actual Agent: Agent 2
    Thanks a lot.
    Regards,
    Kranthi.

    Hi,
    What did you draw those lines with ???? Just a drawLine() command ????
    If so, it is very difficult to track the exact mouse coordinates that correspond to a click at a particular place and then place an 'X' or an 'O' there !!!!
    Try implementing it with 9 Buttons placed at those specific positions. In this case, it will be very simple to track the user's input when he clicks on any of those buttons...the implementation will become really simpler.
    Check it out !

  • Need help in getting Shares between two Macs working again

    Hi,
    having upgraded my late 2009 Mini and mid-2010 MacBook to Lion, everything appears to be running just fine thus far – except for one item: Before the upgrade, I had set up both computers to be listed in the Shares section in Finder, so as to allow swapping files back and forth. This does not seem to be working as it did before any longer. I did manage to access the MB from the Mini once earlier today, but haven't been able to make this permanent.
    As the Mini does not support AirDrop (as of yet anyway), this option is no alternative for me, so I'd be very glad if any of you could help me out here.
    Many thanks in advance .

    You can re-download purchased apps for free:
    http://support.apple.com/kb/ht2519

  • Need help in getting 'RoleApprover' and 'Manager of RoleApprover'

    We are developing a Custom Role Approval Process using SOA composite.
    A manager or a delegated admin will be raising a Role Approval request for a beneficiary. We need to assign the Approval task to beneficiaries' manager or Role Approver.
    If the RoleApprover does not Approve the task in stipulated time, the task needs to get escalated to RoleApprover's manager.
    I'm new to OIM APIs, i was folllowing the tutorial "developing_oim_custom_approval_process_for_role_request.pdf". This needs an user defined field 'RoleApprover' created in the Role request form. We cannot create user defined field in the role request form.
    I need help in getting the 'RoleApprover' and the 'Manager of RoleApprover' programmatically.
    Payload from the OIM Approval request follows:
    <ns2:process>
    <RequestID>176</RequestID>
    <RequestModel>Assign Roles</RequestModel>
    <RequestTarget>Onhand Quantity</RequestTarget>
    <RequesterDetails>
    <FirstName>Steve</FirstName>
    <LastName>Waugh</LastName>
    <Login>STEVEWAUGH</Login>
    <DisplayName>Steve Waugh</DisplayName>
    <ManagerLogin>XELSYSADM</ManagerLogin>
    <OrganizationName>Test</OrganizationName>
    <Email>[email protected]</Email>
    <Status>Active</Status>
    <XellerateType>End-User</XellerateType>
    <UserType>Full-Time</UserType>
    <Role>ALL USERS</Role>
    <Role>Primavera P6 - Global</Role>
    <Role>iProcurement Catalog Administrator</Role>
    <Role>Onhand Quantity</Role>
    <Role>Test Purchasing Super User</Role>
    <Role>Test Delegated Administrator</Role>
    <Role>HELPDESK ADMINISTRATORS</Role>
    <Role>Test e-Commerce Gateway Super User</Role>
    <Role>eBusiness Finance</Role>
    <Role>Test Line Manager</Role>
    <Role>Test_ApplicationApprover</Role>
    </RequesterDetails>
    <BeneficiaryDetails>
    <FirstName>David</FirstName>
    <LastName>Boon</LastName>
    <Login>DAVIDBOON</Login>
    <DisplayName>David Boon</DisplayName>
    <ManagerLogin>STEVEWAUGH</ManagerLogin>
    <OrganizationName>TestCO</OrganizationName>
    <Email>[email protected]</Email>
    <Status>Active</Status>
    <XellerateType>End-User</XellerateType>
    <UserType>Full-Time</UserType>
    <Role>ALL USERS</Role>
    <Role>Hyperion</Role>
    <Role>Test Purchasing Administrator</Role>
    <Role>Test Internet Expenses Audit Manager</Role>
    <Role>Test Internet Expenses Auditor</Role>
    </BeneficiaryDetails>
    <ObjectDetails>
    <name>Test Onhand Quantity</name>
    <attributes/>
    </ObjectDetails>
    <url>
    http://host:port/workflowservice/CallbackService
    </url>
    <OtherDetails/>
    </ns2:process>
    Edited by: rajesh on Feb 13, 2011 9:00 AM

    Choose Xerces2.4 to serialize the DOM object is an option.
    javac XercesTest.java -classpath xmlParserAPIs.jar;xercesImpl.jar;.
    java -classpath xmlParserAPIs.jar;xercesImpl.jar;. XercesTest test.xml
    below is the source file: XercesTest.java
    //JAXP
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    //APACHE SERIALIZE FUNCTION
    import org.apache.xml.serialize.*;
    class XercesTest
    public static void main(String[] args) throws Exception
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse( new File( args[0] ) );
    File f = new File( "copy_of_"+ args[0] );
    OutputFormat format = new OutputFormat("xml","UTF-8",true ) ;
    FileOutputStream fout = new FileOutputStream( f );
    XMLSerializer ser = new XMLSerializer(fout, format );
    ser.serialize( doc );
    maybe it's helpful
    land

  • Why is the "Common DOM API" not included in main JDK1.4 / JAXP1.1 packages?

    Hi,
    It's good the core XML DOM is implemented in Java, and even better that this is to become integrated into JDK1.4. However, I don't understand why the JDK1.4 / JAXP 1.1 only includes the "org.w3c.dom" package and not the other DOM packages ("org.w3c.dom.events", etc. such as those implemented in Xerces or those that appear in the Common DOM API).
    Can anyone explain how to use this functionality (all DOM APIs) using JAXP 1.1 or JDK 1.4 ? Or must I stick to including the Apache implementation?
    Some useful references:
    http://java.sun.com/j2se/1.4/docs/guide/plugin/dom/index.html
    http://xml.apache.org/xerces-j/
    Hopefully someone can explain this a bit more to me...
    Thanks,
    Chris

    I am curious for the answer to this as well... I have been using Java SDK 1.3.1 with Apache's xerces 2.0.0-beta4, and am now trying to upgrade to SDK 1.4 with xerces 2.0.0..
    Also, what about package org.w3c.dom.ranges? Does anyone know if this an Apache-defined package, or is it a standard w3c one (in which case, why is it not part of the Common DOM API set)?
    Thanks for any help!

  • Hi need help on getting customer open  items

    hi all,
    i need help regarding getting open items for customers in the previous
    ie. if i give current date,
    i want to get the open items for past 30 days from current date
    help me to get this ...
    thanks a lot
    regards,
    selvi

    or else ,
    use table BSID.
    Regards
    Peram

  • I need help in getting my Iphone 3gs unfrozen

    Need help in getting my Iphone 3gs unfrozen. The apple logo is shown yet it will not restart. Suggestions?

    Hi,
    Try here >  iPhone and iPod touch: Frozen and unresponsive

  • I need help in getting my software options in CS5 Photoshop Student version. We have registered the product but don't have print preview or Adjust Auto Levels for example?

    I need help in getting my software options in CS5 Photoshop Student version. We have registered the product but don't have print preview or Adjust Auto Levels for example?

    <moved from Downloading, Installing, Setting Up to Photoshop General Discussion>

  • I need help in getting my reponses

    I need help in getting my responses back, or I am sending out the form wrong and people aren't getting it. Either way I need help, as I am getting very frustrated.  Thanks Dori

    <moved from Downloading, Installing, Setting Up to Photoshop General Discussion>

  • Sign in told my firefox out of date did try to do upgrade but could not need help to get my sign in workin email

    sign in told my firefox is out of date. did try to do the upgrade but could not do
    need help to get my sign in working

    Kathleen Beal/funstarling please respond in https://support.mozilla.org/en-US/questions/982953

  • I changed my password i forgot what it is need help to get back in

    i need help i changed my passwordand i forgot it now i need help to get back in it keeps saying disabled?? help me plz

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                          
    If recovery mode does not work try DFU mode.                         
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings         
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • The basic sliders disappeared. Including the Exposure, Contrast, Highlights, Shadows, Whites, Blacks, Clarity and Vibrance Sliders are no longer available. I need help to get them back

    The basic sliders disappeared. Including the Exposure, Contrast, Highlights, Shadows, Whites, Blacks, Clarity and Vibrance Sliders are no longer available. I need help to get them back on the program. 
    I can't figure out where the sliders went and how to put them back on. Anyone have any suggestions?
    Thanks

    In Lightroom, go to the Window menu, select Panels, select Basic

  • TS1363 i need help to get out of recovery mode

    i need help to get out of recovery mode

    To get the phone out of recovery mode you will need to connect it to a computer with iTunes installed on it and restore it.

  • My mom and I both have iphone5 but when I send her messages they aren't blue but any other iphone I text is blue I need help to get that fixed

    My mom and I both have iphone5 but when I send her messages they aren't blue but any other iphone I text is blue I need help to get that fixed

    Both of you need to have iMessage activated, and both have to have active Internet connection for iMessage. Are you both using the same Apple ID? Are you using the phone number or Apple ID for messages?

  • HT4199 I need help with getting my printer to print, PLEASE.

    I need help with getting my printer to print, Please.

    What have you done so far?
    I suggest you connect it via a usb  cable first.  Once you get the printer working, move to wifi.  You will have to use an existing printer usb cable or purchase a cable.  Be sure to get the correct cable.  Ask for help.
    The warrenty indicates there is phone support.  Give HP a call.
    Warranty
    One-year limited hardware warranty; 24-hour, 7 days a week phone support
    Robert

Maybe you are looking for

  • Exporting using Compressor failed, and other awekward issues with FCP

    Hi FCP gurus! I need your help! Everytime I try to export using compressor, my submission fails. I even try a sequence a exported as m2v on Monday, but today is not working. Compressor will some times say "Unable to view preview, FCP is busy". When I

  • INF Install failure for Windows 7

    While tring to do Disc Cleanup I continue to get this error: Error unregistering the OCS C:Windows\system32\20-20Technologies\3D Viewer\v5.0.94.0\2020Player_WEB_5_0_94_o.dllINF Install failure. Reason:  Access is denied I am using Windows 7 32 bit sy

  • E4200 - Has to be Reset each few days.

    my E4200 v1 has to be reset each few days is that normal? Seems not

  • My dock icon missing?

    My Excel for Mac dock icon is missing.  The space or gap is there and I am able to open the app, except that for some reason there is no icon.  All the other Office for Mac app like Windows and Power Point are good.  I restarted and the icon is still

  • Finder cant be opened

    Whenever I click on finder, nothing happens. When i try to access finder using "open in finder" under the download stack, it gives me the dialog box saying "The application finder cannot be opened" giving me the error code -600. Here is some stuff I