You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Dave Connet <co...@entelos.com> on 2001/03/05 19:35:53 UTC

RE: Working with DOM input and output destroyed, XalanSourceTreeP arserLiaison::createDocument has now void argument list.

Try looking at the SimpleTransform sample. I'm using a DOM tree as input
with no problem (but I've never looked at the usage patterns link). There
were a few changes that I had to make in changing from 1.0 to 1.1.

Dave Connet
Entelos, Inc.

> -----Original Message-----
> From: Christian Aberger [mailto:Christian@Aberger.at]
> Sent: Monday, March 05, 2001 5:20 AM
> To: xalan-dev@xml.apache.org
> Subject: Working with DOM input and output destroyed,
> XalanSourceTreeParserLiaison::createDocument has now void 
> argument list.
> 
> 
> Dear Developers !
> 
> http://xml.apache.org/xalan-c/usagepatterns.html#dom 
> describes how to use a
> parsed DOM tree as input to xalan. This worked really fine in 
> version 1.0.
> 
> I am afraid this sample does not work any more with xalan 1.1.
> reasons:
> 1) the sample as described in the link above does not compile any more
> 2) when one changes it to:
> 	XalanSourceTreeDOMSupport		theDOMSupport;
> 	XalanSourceTreeParserLiaison	theParserLiaison(theDOMSupport);
> then createDocument() fails, because
> XalanSourceTreeParserLiaison::createDocument() has a void 
> argument list.
> 
> 
> wfR ChrisA
> 

RE: Working with DOM input and output destroyed, XalanSourceTreeParserLiaison::createDocument has now void argument list.

Posted by Peter Murphy <pe...@fast.fujitsu.com.au>.
> -----Original Message-----
> From: Dave Connet [mailto:connet@entelos.com]
> Sent: Tuesday, March 06, 2001 4:36 AM
> To: 'xalan-dev@xml.apache.org'
> Subject: RE: Working with DOM input and output destroyed,
> XalanSourceTreeParserLiaison::createDocument has now void argument list.
>
>
> Try looking at the SimpleTransform sample. I'm using a DOM tree as input
> with no problem (but I've never looked at the usage patterns link). There
> were a few changes that I had to make in changing from 1.0 to 1.1.
>

Dave, I'm trying to do the same as Christian: take Xerces DOM input into the
XSLTInputSource objects, do XSLT processing, and return Xerces DOM output
from XSLTResultTarget objects.

Unfortunately, I'm not finding the SimpleTransform sample very illuminating.
It shows how to set up the support objects using the XalanSourceTree
classes. However, it doesn't leave me with any method to connect from Xerces
DOM_Document objects to XSLTInputSource objects using the XalanSourceTree
classes, and vice-versa.

Here are two approaches, which I considered, and discarded.

1. I know the XalanSourceTreeParserLiaison class contains the following
code:

--------------------
private:
	// Data members...
	XercesDOMSupport				m_xercesDOMSupport;	// Must be before
m_xercesParserLiaison!!!
	XercesParserLiaison				m_xercesParserLiaison;
--------------------

Unfortunately, they ARE private variables, so that forbids calling
m_xercesParserLiaison.createDocument(domDocument) variable.

2. I also tried to use
XalanSourceTreeParserLiaison.createDocument(domdocumentnode) in the
following snippet:

-------------------------------------
// Create some support objects that are necessary for running the
processor...
XalanSourceTreeDOMSupport		theDOMSupport;
XalanSourceTreeParserLiaison	theParserLiaison(theDOMSupport);
theDOMSupport.setParserLiaison(&theParserLiaison);

// [... Do other setup code out of SimpleTransform...]

DOMParser *dom1 = new DOMParser;
dom1->setDoNamespaces(true);
DOMParser *dom2 = new DOMParser;
dom2->setDoNamespaces(true);
DOM_Document theInputDoc;
DOM_Document theStylesheetDoc;
bool errorsOccured = false;
try
{
    dom1->parse(argv[1]);
    theInputDoc = dom1->getDocument();
    dom2->parse(argv[3]);
    theStylesheetDoc = dom2->getDocument();

/* Assume works out for the sake of this emai.

[...]

}

/* Read in the input and stylesheet as DOM_Document, and convert to
XSLTInputSouce. */

     XalanDocument* xInputDoc =
theParserLiaison.createDocument(theInputDoc);
     XSLTInputSource	theInputSource(xInputDoc);
     XalanDocument* xStylesheetDoc =
theParserLiaison.createDocument(theStylesheetDoc);
     XSLTInputSource	theStylesheetSource(xStylesheetDoc);

-----------------------------------------------------------
When I try to compile it, I get errors like:
-----------------------------------------------------------
SimpleDOMTransform.cpp
D:\XalanAndXerces\xml-xalan\c\samples\SimpleDOMTransform\SimpleDOMTransform.
cpp(145) : error C2660: 'createDocument' : function does not take 1
parameters
D:\XalanAndXerces\xml-xalan\c\samples\SimpleDOMTransform\SimpleDOMTransform.
cpp(147) : error C2660: 'createDocument' : function does not take 1
parameters
Error executing cl.exe.

-----------------------------------------------------------

Davi, could you provide any code samples where you've taken DOM_Document
input, and done Xalan processing on it? I need to do so for my project, but
I'm afraid I'm stumped as to how to do it.

> Dave Connet
> Entelos, Inc.

Regards,
Peter.



RE: Working with DOM input and output destroyed, XalanSourceTreeParserLiaison::createDocument has now void argument list.

Posted by Christian Aberger <Ch...@Aberger.at>.
No, I mean something else. What I mean is the following: You use Xerces to
parse an xml-source file. Or build it in memory like Xerces sample
CreateDomDocument. Then there is the DOM tree in memory (not the sequence of
xml statements as a string, but the tree of DOM_Nodes). This should be then
tranformed by a stylesheet.

As I found the old usage pattern sample works (also multithreaded) if I do
not use XalanSourceTreeDOMSupport and XalanSourceTreeParserLiaison, but the
sample as it is described on the web-page. I was wrong when I supped that I
can simply replace XercesDOMSupport with XalanSourceTreeDOMSupport etc. as
it is the case in other samples.

wfR ChrisA

-----Original Message-----
From: Dave Connet [mailto:connet@entelos.com]
Sent: Montag, 05. März 2001 19:36
To: 'xalan-dev@xml.apache.org'
Subject: RE: Working with DOM input and output destroyed,
XalanSourceTreeParserLiaison::createDocument has now void argument list.


Try looking at the SimpleTransform sample. I'm using a DOM tree as input
with no problem (but I've never looked at the usage patterns link). There
were a few changes that I had to make in changing from 1.0 to 1.1.

Dave Connet
Entelos, Inc.

> -----Original Message-----
> From: Christian Aberger [mailto:Christian@Aberger.at]
> Sent: Monday, March 05, 2001 5:20 AM
> To: xalan-dev@xml.apache.org
> Subject: Working with DOM input and output destroyed,
> XalanSourceTreeParserLiaison::createDocument has now void
> argument list.
>
>
> Dear Developers !
>
> http://xml.apache.org/xalan-c/usagepatterns.html#dom
> describes how to use a
> parsed DOM tree as input to xalan. This worked really fine in
> version 1.0.
>
> I am afraid this sample does not work any more with xalan 1.1.
> reasons:
> 1) the sample as described in the link above does not compile any more
> 2) when one changes it to:
> 	XalanSourceTreeDOMSupport		theDOMSupport;
> 	XalanSourceTreeParserLiaison	theParserLiaison(theDOMSupport);
> then createDocument() fails, because
> XalanSourceTreeParserLiaison::createDocument() has a void
> argument list.
>
>
> wfR ChrisA
>