[prev in list] [next in list] [prev in thread] [next in thread]
List: xalan-c-users
Subject: RE: create a DOMNode from XalanNode
From: "Ashay Shende" <ashende () cisco ! com>
Date: 2003-07-22 12:47:55
[Download RAW message or body]
Hi Daniel,
For converting a xalan node to a xerces DOMNode, the XercesDocumentWrapper
API has a mapNode function which is not there for the
XercesDOMWraperParsedSource (if i am correct).
So what I do is:
XPathEvaluator::initialize();
XPathEvaluator theEvaluator;
XercesDOMSupport theDOMSupport;
XercesDocumentWrapper theWrapper(theXercesDoc,
false,false,false);//theXerecesDoc is of type DOMDocument
XalanNode* xalContextNode = theWrapper.getDocumentElement();
NodeRefList resultNodeList = theEvaluator.selectNodeList(theDOMSupport,
xalContextNode, XalanDOMString(XPathExpr.data(),XPathExpr.size()).c_str());
DOMNode* xerNode = (DOMNode*)(theWrapper.mapNode(resultNodeList.item(0)));
Hope this helps...
Ashay
-----Original Message-----
From: Gröndal Daniel [mailto:daniel.grondal@rfv.sfa.se]
Sent: Tuesday, July 22, 2003 5:21 PM
To: xalan-c-users@xml.apache.org
Subject: create a DOMNode from XalanNode
Hi!!
I have a DOMtree in memory which I use with Xalan for xPath evaluations like
this:
// create DOM tree 'doc' and use it for other things.
//...
XPathEvaluator::initialize();
XPathEvaluator eval;
XercesDOMSupport domsupport;
XercesParserLiaison parserLiaison;
const XercesDOMWrapperParsedSource parsedSource(doc parserLiaison,
domsupport);
XalanDocument* xalanDoc= parsedSource.getDocument();
XalanElement* rootElement= xalanDoc>getDocumentElement();
XalanNode* node = eval.selectSingleNode(domsupport,rootElement,
XalanDOMString(xpath.c_str()).c_str());
This should give me a pointer to one node, a XalanNode. I need to return a
DOMNode from the function. Is that possible and in that case, how do I do
that?
//daniel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic