[jdom-interest] cannot create xmlns namespace?

Bradley S. Huffman hip at a.cs.okstate.edu
Sat Jul 20 12:20:37 PDT 2002


I think you want:

    Namespace ns2 = Namespace.getNamespace("http://www.w3.org/1999/xhtml");

Brad

Phillip Rhodes writes:

> Hi everyone.
> I am trying to create an xhtml document with jdom.
> Here is an example fragment of the document that I want to generate in jdom.
> 
> <html xmlns="http://www.w3.org/1999/xhtml">
> 
> I did the following:
> Namespace ns2 = Namespace.getNamespace("xmlns", 
> "http://www.w3.org/1999/xhtml");
> Element html = new Element("html",ns2);
> 
> It errors out when I try to create this namespace because it begins with 
> "xml".
> The specific error is:
> The name "xmlns" is not legal for JDO M/XML Namespace prefixs: Namespace 
> prefixes cannot begin with "xml" in any combination of case. [java] at 
> org.jdom.Namespace.getNamespace(Namespace.java:161) Ruby Test
> 
> Is there a way to generate this element with this namepace?
> 
> If I can do this, great!  But I fear that at this point you are saying, 
> "what the heck do you want to do this for?"
> I am programmatically generating this document as an xhtml file that I will 
> transform into fo using a stylesheet.
> If I don't put this namepace declaration in my html element, the 
> transformation to fo fails.  Here is what I think is the applicable part of 
> the xsl file:
> 
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> xmlns:html="http://www.w3.org/1999/xhtml">
> 
> 
> Thanks.
> 
> 
> 
> 
> _______________________________________________
> 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