[jdom-interest] Namespace not supported by SAXParser

Brett McLaughlin brett at newInstance.com
Tue Jul 17 16:55:35 PDT 2001


<code>
   Namespace xsi = Namespace.getNamespace("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
   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("NETLINX"))
       .addContent(new Element("vendorpwd")
         .addContent("netlinx")))
     .addContent(new Element("provision")
       .addContent(new Element("newuser")
         .addContent(new Element("firstname")
           .addContent("John"))
         .addContent(new Element("lastname")
           .addContent("Quick"))
         .addContent(new Element("prdcd")
           .addContent("VL1"))
         .addContent(new Element("remoteaddr")
           .addContent("255.255.255.1"))
         .addContent(new Element("supplieddid")
           .addContent("8019694159"))
         .addContent(new Element("featurelist")
           .addContent(new Element("feature")
             .addContent("10"))
           .addContent(new Element("feature")
             .addContent("70")
           )
         )
       )
     );
     b2belt.addNamespaceDeclaration(xsi);
     b2belt.setAttribute(xsl);
   originalDoc = new Document(b2belt);
</code>

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




More information about the jdom-interest mailing list