You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gregor Bornemann <gb...@stardivision.de> on 2000/10/23 09:48:33 UTC

creating XML-Input for Xalan from SAX-Events

Hy,

how can i create the XML-Input for XALAN from SAX-Events ?
My suggestion is it, to use the "FormatterToDOM" to accept the SAX-Events and 
then create a "XSLTInputSource" from the DOM-Document.

But how can i use the "FormatterToDOM" ? He need a XalanDocument (wich is 
virtual) and a XalanElement (for what ?) .

Or is there an other way ?

CU
	Gregor Bornemann

Re: creating XML-Input for Xalan from SAX-Events

Posted by Gregor Bornemann <gb...@stardivision.de>.
Hy,

i've "resolved" the problem :

// ---- setting up some stuff
	FormatterToUnoBridge *fToU;	
	XalanDocument *mDoc;
	mDoc=theParserLiaison->createDocument();
	fToDOM=new FormatterToDOM(mDoc,NULL);
	/*
		-> connecting the FormatterToDOM to the external XMLParser
		    (expat in my 	case)
		-> start Parsing the XML
	*/
// ----- generate the XSLTInputSource for the XML-file (after endDocument 
//	  call from the external parser)
	//create XalanInputSource from the DOM-Tree
	theInputSource=new XSLTTInputSource(
		(XalanNode*)(fToDOM->getDocument())->getDocumentElement());

IMHO this is the only way to generate XML-input for the processor from an 
external XML parser.

CU
	Gregor Bornemann

BTW : comments and suggestions are welcome

Re: creating XML-Input for Xalan from SAX-Events

Posted by Gregor Bornemann <gb...@stardivision.de>.
Am Mon, 23 Okt 2000 schrieben Sie:

> Yes.  In XalanJ1, XSLTProcessor can act directly as a SAX
> DocumentHandler or LexicalHandler which handle events from your SAX
> event generator.  See the Pipe or PureSAX examples.
Ups, sorry i don't wrtote that i use the C++ verion.
IMHO there's no such thing.

CU
	Gregor Bornemann

Re: creating XML-Input for Xalan from SAX-Events

Posted by Gary L Peskin <ga...@firstech.com>.
Gregor Bornemann wrote:
> 
> Hy,
> 
> how can i create the XML-Input for XALAN from SAX-Events ?
> My suggestion is it, to use the "FormatterToDOM" to accept the SAX-Events and
> then create a "XSLTInputSource" from the DOM-Document.
> 
> But how can i use the "FormatterToDOM" ? He need a XalanDocument (wich is
> virtual) and a XalanElement (for what ?) .
> 
> Or is there an other way ?

Yes.  In XalanJ1, XSLTProcessor can act directly as a SAX
DocumentHandler or LexicalHandler which handle events from your SAX
event generator.  See the Pipe or PureSAX examples.

Come back to this list if you have problems with the examples or
specific questions.

Gary