See http://www.dom4j.org/cookbook.html


//w3c to dom4j

import org.sax.Document;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.DOMReader;

public class DOMIntegratorSample {

  /** converts a W3C DOM document into a dom4j document */
  public Document buildDocment(org.w3c.dom.Document domDocument) {
    DOMReader xmlReader = new DOMReader();
    return xmlReader.read(domDocument);
  }
}


//dom4j to w3c import org.w3c.dom.Document;

import org.dom4j.Document;
import org.dom4j.io.DOMWriter;

public class DeployFileLoaderSample {

  private org.dom4j.Document doc;

  public org.w3c.dom.Document transformtoDOM() {
    DOMWriter writer = new DOMWriter();
    return writer.write(this.doc);
  }
}



Maarten Coene wrote:
Hi,
you can use org.dom4j.io.DOMReader for converting w3c Documents to dom4j Documents.
regards,
Maarten


*/"Punnoose, Roshan" <[EMAIL PROTECTED]>/* wrote:

    Hey guys,



    How do you convert from a w3c Node to a dom4j Node? Is there a
    utility class for it in dom4j? Thanks



    **Roshan Punnoose**

    Phone: 301-497-6039



    BEGIN:VCARD
    VERSION:2.1
    N:Punnoose;Roshan
    FN:Punnoose, Roshan
    ADR;WORK:;2115
    LABEL;WORK:2115
    EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
    REV:20050413T183207Z
    END:VCARD

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



--

+------------------------------------------------------------+
| David Lucas                      mailto: ddlucas @ lse.com |
| Lucas Software Engineering, Inc.   (740) 964-6248 Voice    |
| Unix,Java,C++,CORBA,XML,EJB        (614) 668-4020 Mobile   |
| Middleware,Frameworks              (888) 866-4728 Fax/Msg  |
+------------------------------------------------------------+
| GPS Location:  40.0150 deg Lat,  -82.6378 deg Long         |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going."    <><  |
+------------------------------------------------------------+

Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
IMHO="in my humble opinion" IMHC="in my humble conviction"
All trademarks above are those of their respective owners.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to