Hi,
I have a very simple test Bean, I want to serialize to System.out. Is thos
possible?

I tried it like this:

      QName qname = new QName("TestXMLSerializerQName");
      AttributesImpl attr = new AttributesImpl();
      PrintWriter writer = new java.io.PrintWriter(System.out);

      SerializationContextImpl ctx = new SerializationContextImpl(writer);
      ctx.setSendDecl(true);
      ctx.setPretty(true);


      System.out.println("qname: " + qname.toString());
      System.out.println("attr: " + attr.toString());
      System.out.println("ctx: " + ctx.toString());

      ctx.serialize(qname, attr, new Integer(22));
      ctx.serialize(qname, attr, this);

      writer.close();

I get

<?xml version="1.0" encoding="UTF-8"?>
<TestXMLSerializerQName xsi:type="xsd:int"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>22</TestXMLSerializerQName>

without the "ctx.serialize(qname, attr, this);"-line. Otherwise I get:

java.io.IOException: No serializer found for class
com.triplemind.samples.TestXMLSerializer in registry
[EMAIL PROTECTED]

What to do to avaid this exception?

Regards
Christoph

P.S.: Didn't found anything on the list, perheaps I missed it.



Reply via email to