How to create a default namespace (without a prefix)? To create a namespace with no prefix...
Namespace namespace = Namespace.get( "someURL" ); or with a prefix Namespace namespace2 = Namespace.get( "myPrefix", "someURL" ); James ------- http://radio.weblogs.com/0112098/ ----- Original Message ----- From: Rathore, Ritesh (GECP, TEMP, 096462) To: [EMAIL PROTECTED] Sent: Saturday, February 08, 2003 6:20 AM Subject: [dom4j-dev] How to create a default namespace (without a prefix)? I am creating following XML: <?xml version="1.0" encoding="UTF-8"?> <GetPurchaseOrder xmlns="http://schemas.gecp.com/app1/v1_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.gecp.com/app1/v1_0 http://devserver.com/app1/XMLSchema/v1_0/GetPurchaseOrder.xsd"> <POHeaderId>123456</POHeaderId> <POLineId>12345453</POLineId> <PORevNumber>12345</PORevNumber> </GetPurchaseOrder> Could you please let me know how to add default namespace (xmlns="http://schemas.gecp.com/app1/v1_0" ). I added other namespace and attribute as follows: Namespace ns_xsi = DocumentHelper.createNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance" ) ; getPOElem.add (ns_xsi) ; QName schemaLocQName= new QName("schemaLocation", ns_xsi) ; getPOElem.addAttribute(schemaLocQName, url_1 + " " + url_2 ) ; Thanks Ritesh __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The most comprehensive and flexible code editor you can use. Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. www.slickedit.com/sourceforge _______________________________________________ dom4j-dev mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-dev