RE: writing XHTML

"Michael Kay" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <46284935530E4BAD9890D20A647E8A2E@Sealion>
It should be

Namespace.getNamespace("xforms", "http://www.w3.org/2002/xforms");

The "xmlns:" is not part of the namespace prefix.

It's a strange error message though: "Namespace prefixes cannot begin with
"xml" in any combination of case". What the specification actually says is:

<quote>
All other prefixes beginning with the three-letter sequence x, m, l, in any
case combination, are reserved. This means that:

    * users SHOULD NOT use them except as defined by later specifications
    * processors MUST NOT treat them as fatal errors. 
</quote>

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Jabba Laci
> Sent: 12 November 2008 17:41
> To: jdom
> Subject: [jdom-interest] writing XHTML
> 
> Hi,
> 
> I'm new to the list. I've already used JDOM, but now I have a 
> problem where I'd like to ask your help.
> 
> I want to produce XHTML files, more precisely Xforms. Here is 
> a sample:
> 
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:xforms="http://www.w3.org/2002/xforms"
>       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> </html>
> 
> The problem is how to set the xmlns:xforms namespace. I get 
> the following exception:
> 
> Exception in thread "main" org.jdom.IllegalNameException: The 
> name "xmlns:xforms" is not legal for JDOM/XML Namespace 
> prefixs: Namespace prefixes cannot begin with "xml" in any 
> combination of case.
> 
> Here is what I tried:
> 
> Namespace ns;
> this.root = new Element("html");
> // this line below works for "xmlns"
> ns = Namespace.getNamespace("http://www.w3.org/1999/xhtml");
> this.root.setNamespace(ns);
> // problems arise here:
> ns = Namespace.getNamespace("xmlns:xforms", 
> "http://www.w3.org/2002/xforms"); this.root.setNamespace(ns);
> 
> Thanks,
> 
> Laszlo
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@you
> rhost.com

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.