Hi Colin,
Take a look at this usage pattern:
http://xml.apache.org/xalan-c/usagepatterns.html#xercesdomwrapperparsedsource
Although this shows the old Xerces DOM, you can use with the new one if you
have the latest CVS code.
Dave
|---------+--------------------------->
| | Colin Paul Adams|
| | <[EMAIL PROTECTED]|
| | mon.co.uk> |
| | |
| | 02/02/2003 05:16|
| | AM |
|---------+--------------------------->
>--------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [email protected]
|
| cc: (bcc: David N Bertoni/Cambridge/IBM)
|
| Subject: Cannot read Xerces DOMNode
|
>--------------------------------------------------------------------------------------------------------------------------------|
I am trying to use a Xerces DOMDocument as the input source to a
transform, but I'm getting the error:
Fatal Error at (file <unknown>, line 0, column 0):
An exception occurred! Type:RuntimeException, Message:The primary document
entity could not be opened. Id={null}
I created the XSLTInputSource thus:
XercesParserLiaison the_parser_liaison;
XalanDocument * document = the_parser_liaison.createDocument (
d->get_document () );
source = new XSLTInputSource ( static_cast<XalanNode *>( document ) );
I then pass *source as the first argument to XalanTransformer::transform
(both source and the_parser_liaison are actually private data members
of a separate class. A pointer to the object of this class is passed
as an argument to another function, which in turn calls transform).
I checked that source->getNode()->getNodeType() returns 9 immedialtely
prior to passing it to transform.
--
Colin Paul Adams
Preston Lancashire