[jdom-interest] Namespace not supported by SAXParser

John Muhlestein jmuhlestein at i-link.net
Wed Jul 18 10:01:06 PDT 2001

I done what you suggested and I continue to get the same exception. I ran an
XMLOutputter on the Document prior to trying a transformation and this is
the result (which looks good to me):

<?xml version="1.0" encoding="UTF-8"?>


Here is the code snippet that creates the transformer:

Transformer transformer = TransformerFactory.newInstance()
        .newTransformer(new StreamSource(xslUrl));

thanks for the help,

-----Original Message-----
From: Brett McLaughlin [mailto:brett at newInstance.com]
Sent: Tuesday, July 17, 2001 5:56 PM
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Namespace not supported by SAXParser

   Namespace xsi = Namespace.getNamespace("xsi",
   Attribute xsl = new Attribute("noNamespaceSchemaLocation",
"http://devboard/xml/whlsl3.xsd", xsi);
   Element b2belt = new Element("b2b")
     .addContent(new Element("vendor")
       .addContent(new Element("vendorid")
       .addContent(new Element("vendorpwd")
     .addContent(new Element("provision")
       .addContent(new Element("newuser")
         .addContent(new Element("firstname")
         .addContent(new Element("lastname")
         .addContent(new Element("prdcd")
         .addContent(new Element("remoteaddr")
         .addContent(new Element("supplieddid")
         .addContent(new Element("featurelist")
           .addContent(new Element("feature")
           .addContent(new Element("feature")
   originalDoc = new Document(b2belt);

Try and remove the line "b2belt.addNamespaceDeclaration(xsi);". You don't
need to explicitly add any namespaces if elements or attributes in the
document use them, as JDOM handles it all internally. I really don't think
that will make a difference, but it's worth trying.

Additionally, can you try your transform without the stylesheet reference?
It shouldn't be required for the transformation, and it would at least
isolate the trouble spot, right? Once you've done that, let us know the
results, and we'll troubleshoot some more.

Brett McLaughlin
Enhydra Strategist:   http://www.enhydra.org
Lutris Technologies: http://www.lutris.com
O'Reilly Author:       http://www.newInstance.com

To control your jdom-interest membership:

More information about the jdom-interest mailing list