[jdom-interest] cannot create xmlns namespace?

Phillip Rhodes spamsucks at rhoderunner.com
Sun Jul 21 19:20:40 PDT 2002


Here is the code that will generate the invalid jdom document.  I know I 
probably did something bone-headed...

         Element html = new Element("html");
         Namespace ns2 = 
Namespace.getNamespace("http://www.w3.org/1999/xhtml");
         html.addNamespaceDeclaration(ns2);
         Element head = new Element("head");
         head.addNamespaceDeclaration(ns2);
         html.addContent(head);
         Element title= new Element("title");
         title.addContent("test");
         title.addNamespaceDeclaration(ns2);
         head.addContent(title);

All I want is this:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
</head>
</title>

Thanks!



At 05:00 PM 7/21/2002 -0700, Jason Hunter wrote:
> > Here is what is happening now:
> > <html xmlns="http://www.w3.org/1999/xhtml">
> >     <head xmlns="" xmlns="http://www.w3.org/1999/xhtml">
> >        <title xmlns="" xmlns="http://www.w3.org/1999/xhtml">Test</title>
> >     </head>
>
>That's not valid XML, and I'm surprised XMLOutputter would emit that.
>Could you send some sample code (as simple as possible) that generates
>that document?
>
>-jh-
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com




More information about the jdom-interest mailing list