Hi Paul,
I don't use a xsl file. I do pretty much the same
as in the XPathWrapper example (I can't use the
XPathEvaluator interface 'cause I'm stuck with
version 1.1 of Xalan).
Here are my code snippets
1. I try to create a mapper between a xerces dom document and a xalan
representation
(As far as I understand is creates XercesParserLiaison->createDocument a
proxy
between the xerces and the xalan representation)
...
XercesDOMSupport* fDOMSupport;
XercesParserLiaison* fXercesParserLiaison;
...
// setup mapping xerces <-> xalan
// fDocument is a xerces dom document
fDOMSupport = new XercesDOMSupport();
if( fDOMSupport ){
fXercesParserLiaison = new XercesParserLiaison(
*fDOMSupport );
if( fXercesParserLiaison ){
fXalanDocument =
fXercesParserLiaison->createDocument( fDocument );
}
}
...
2. I setup the xpath processor
(As far as I understand is XercesDocumentBridge needed to map from a
xalan node
to the original xerces node)
...
XercesDocumentBridge* fXercesDocumentBridge;
XPathEnvSupport* fXPathEnvSupport;
XObjectFactory* fXObjectFactory;
XPathExecutionContext* fXPathExecutionContext;
...
// setup xpath
fXPathEnvSupport = new XPathEnvSupportDefault();
if( fXPathEnvSupport ){
fXObjectFactory = new XObjectFactoryDefault();
if( fXObjectFactory ){
fXPathExecutionContext = new
XPathExecutionContextDefault(
*fXPathEnvSupport,
*fDOMSupport,
*fXObjectFactory );
fXercesDocumentBridge =
fXercesParserLiaison->mapDocument( fXalanDocument );
}
}
...
3. Now I try to execute the xpath expression
std::string expression contains the xpath expression and the error
I get if I execute this is 'illegal axis name'
...
XObject* xobject;
XPath xpath;
XPathProcessorImpl xpathprocessor;
ElementPrefixResolverProxy prefixResolver(
fXalanDocument->getDocumentElement(),
*fXPathEnvSupport,
*fDOMSupport );
xpathprocessor.initXPath( xpath,
TranscodeFromLocalCodePage( expression.c_str() ),
prefixResolver,
*fXPathEnvSupport);
const XObjectPtr theResult(
xpath.execute( (XalanNode*)(
fXalanDocument->getDocumentElement() ),
prefixResolver,
*fXPathExecutionContext));
...
Michael
> -----Urspr�ngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 10. September 2001 16:04
> An: [EMAIL PROTECTED]
> Betreff: Re: AW: 'illegal axis name' when using the xpath processor
>
>
>
> Michael,
>
> Can you provide the xsl/xml files you are using, that generates this
> error.
>
> Paul
>
>
>
>
> Michael
>
> Baumg�rtner To:
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> <mib@webde-ag. cc: (bcc: Paul
> Dick/CAM/Lotus)
> de> Subject: AW:
> 'illegal axis name' when using the xpath processor
>
>
> 09/10/2001
>
> 05:21 AM
>
> Please respond
>
> to xalan-dev
>
>
>
>
>
>
>
>
>
> I'm using Xerces-C++ and Xalan-C++
>
> > -----Urspr�ngliche Nachricht-----
> > Von: Michael Baumg�rtner [mailto:[EMAIL PROTECTED]]
> > Gesendet: Montag, 10. September 2001 09:36
> > An: 'Xalan-Dev (E-Mail)'
> > Betreff: 'illegal axis name' when using the xpath processor
> >
> >
> > Hi List,
> >
> > I'm using Xerces to parse a xml document into a dom tree
> > und try to select nodes using the xpath processor of xalan.
> > I've got this working with Xerces 1.2 and Xalan 0.4.
> > But since we've switched to Xerces 1.4 and Xalan 1.1 I got
> > an 'illegal axis name' error while executing any xpath
> > expression. I've altered the code to fit the changed api
> > of the xalan xpath processor, but somthing must be going wrong.
> >
> > Does anyone have a working example of parsing an xml document
> > with Xerces and executing a xpath expression with Xalan on the
> > dom?
> >
> > Thanks
> > Michael
> >
> > --
> > "Die Welt ist eine Kom�die f�r den, der denkt,
> > eine Trag�die f�r den der f�hlt."
> > Horace Walpole
> >
> >
>
>
>
>
smime.p7s