Hi Mick,
The problem is with this line in your code:
XercesDOMSupport theDOMSupport();
According to the C++ standard, this is a declaration of a function called
theDOMSupport which takes no parameters and returns a XercesDOMSupport
instance by value. It does not define a XercesDOMSupport instance.
The fix is to remove the parentheses:
XercesDOMSupport theDOMSupport;
You have the same problem with the next line:
XercesParserLiaison theParserLiaison();
Hope that helps!
Dave
mick
<[EMAIL PROTECTED] To:
xalan-c-users@xml.apache.org
ws.com> cc: (bcc: David N
Bertoni/Cambridge/IBM)
Subject:
XercesDOMWrapperParsedSource
05/30/2003 11:13
AM
Please respond
to mickh
Hi,
I'm writing an application that generates a query result as a
DOMDocument using Xerces. I need to be able to transform the Document
into alternative formats, which I want to do using Xalan and an XSL
template.
I'm starting off just writing a simple transformer program to test my
XSL's on. I first tried to backtrace from the
XalanTransformer::transform method, trying to use a
XercesDocumentWrapper as input but that didn't want to work so I went
back to the usage guide and re-worked the example there. I came up with:
/* parsing stuff...*/
DOMDocument* doc = parser->getDocument();
XercesDOMSupport theDOMSupport();
XercesParserLiaison theParserLiaison();
XercesDOMWrapperParsedSource parsedSource(doc2, theParserLiaison,
theDOMSupport, XalanDOMString());
XSLTInputSource xsl(argv[2]);
XSLTResultTarget res(cout);
XalanTransformer* xtran = new XalanTransformer();
int success = xtran->transform(parsedSource, xsl, res);
This gets me:
transformer.cpp:52: no matching function for call to `
xalanc_1_5::XercesDOMWrapperParsedSource::XercesDOMWrapperParsedSource(
xalanc_1_5::DOMDocument_Type*&, xalanc_1_5::XercesParserLiaison (&)(),
xalanc_1_5::XercesDOMSupport (&)(), xalanc_1_5::XalanDOMString)'
candidates
are:
xalanc_1_5::XercesDOMWrapperParsedSource::XercesDOMWrapperParsedSource(const
xalanc_1_5::XercesDOMWrapperParsedSource&)
XalanTransformer/XercesDOMWrapperParsedSource.hpp:130:
xalanc_1_5::XercesDOMWrapperParsedSource::XercesDOMWrapperParsedSource(const
xalanc_1_5::DOMDocument_Type*, xalanc_1_5::XercesParserLiaison&,
xalanc_1_5::XercesDOMSupport&, const xalanc_1_5::XalanDOMString& =
XalanDOMString())
XalanTransformer/XercesDOMWrapperParsedSource.hpp:116:
xalanc_1_5::XercesDOMWrapperParsedSource::XercesDOMWrapperParsedSource(const
xalanc_1_5::DOM_Document_Type&, xalanc_1_5::XercesParserLiaison&,
xalanc_1_5::XercesDOMSupport&, const xalanc_1_5::XalanDOMString& =
XalanDOMString())
Trust me, I feel embarassed posting a compile question, but I can't see
what I'm doing wrong. The obvious candidates are the DOMDocument_Type,
but I've tried casting that with no success, and the XalanDOMString, but
I've tried ommitting it and supplying a blank as seen here and neither
solves the problem.
I'm using xalan 1.5 and xerces 2.2.0, compiling with gcc 3.2 on linux.
Can anyone see what I'm doing wrong? All help is much appreciated.
Cheers,
Mick