Of course we need a generalized output mechanism, but it need not be
complicated.
A simple analog to the InputStream should be sufficient I think.
Something along the lines of
class OutputStream
{
public:
virtual int WriteBytes( XMLCh* , int n) = 0;
};
should be sufficient shouldnt it ?
>
>
>
> The problem is that if we write this functionality, it will have to use
> some output mechanism. If that's not the mechanism you want to use, you're
> kind of stuck. I'll be looking at providing something very soon, but in
the
> end it will probably require you to provide the actual target output
stream
> or file or whatever. But, at least we'll do the iteration, the optional
> stuff like char refs, etc... Probably it will be based on the tree walker,
> and will do all the grunt work up to actually writing out a character or
> string, at which point your plugged in handler will do the actual writing.
>
> ----------------------------------------
> Dean Roddey
> Software Weenie
> IBM Center for Java Technology - Silicon Valley
> [EMAIL PROTECTED]
>
>
>
> "David A. Lee" <[EMAIL PROTECTED]> on 03/07/2000 10:54:25 AM
>
> Please respond to [EMAIL PROTECTED]
>
> To: <[EMAIL PROTECTED]>
> cc:
> Subject: Re: BaseMarkupSerializer/XMLSerializer - C++ Anyone ?
>
>
>
>
> Any idea if this object will be provided in the C++ XERCES-C ?
> I'm now using code coppied from DOMPrint ... but really am supprised
> its not a supplied class instead of just code in the sample.
>
>
>
> > The documentation is really sparse on this so maybe I'm just using it in
> > a way which is not intended but it appears to me that using the same
> > serializer for more than one document fails.
> >
> > XMLSerializer serializer = new XMLSerializer(System.out, null);
> > System.out.println("Doc1:");
> > serializer.serialize(doc1);
> > System.out.println("Doc2:");
> > serializer.serialize(doc2);
> >
> > gives:
> >
> > Doc1:
> > <?xml version="1.0"?>
> > <el1><el1.2/></el1>
> > Doc2:
> > <el2><el1.1 a1="v1" a2="v2"><el1.1.1/></el1.1></el2>
> >
> > The XML declaration is missing in the second output.
> > To make this work I have to patch BaseMarkupSerializer.java like this:
> >
> > diff -c -r1.11 BaseMarkupSerializer.java
> > *** BaseMarkupSerializer.java 2000/02/23 21:41:18 1.11
> > --- BaseMarkupSerializer.java 2000/03/06 23:46:49
> > ***************
> > *** 416,421 ****
> > --- 416,422 ----
> > if ( _writer == null )
> > throw new IllegalStateException( "SER002 No writer
> > supplied for serializer" );
> > try {
> > + reset();
> > startDocument();
> > } catch ( SAXException except ) { }
> > serializeNode( doc );
> >
> > Again, I'm not sure this is a valid use of it though, so I'm not sure
> > it's ok to commit my changes.
> > --
> > Arnaud Le Hors - IBM Cupertino, XML Technology Group
> >
> >
>
>
>
>
>