[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"?>

<b2b>
  <vendor>
    <vendorid>NETLINX</vendorid>
    <vendorpwd>netlinx</vendorpwd>
  </vendor>
  <provision>
    <newuser>
      <firstname>John</firstname>
      <lastname>Quick</lastname>
      <prdcd>VL1</prdcd>
      <remoteaddr>255.255.255.1</remoteaddr>
      <supplieddid>8019694159</supplieddid>
      <featurelist>
        <feature>10</feature>
        <feature>70</feature>
      </featurelist>
    </newuser>
  </provision>
</b2b>

Here is the code snippet that creates the transformer:

<code>
Transformer transformer = TransformerFactory.newInstance()
        .newTransformer(new StreamSource(xslUrl));
</code>

thanks for the help,
John

-----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


<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

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list