You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Shirish Kulkarni <sh...@yahoo.com> on 2003/06/28 15:07:01 UTC

Use of XercesDocumentBridge

Hi, 

I am trying to use XercesDocumentBridge to be able to
access the Xerces DOM tree using Xalan APIs 

At the end of the mail is a simple API, I am trying. 

I am always getting xalan_node returned as NULL. Any
ideas, what is going wrong in my code ? 

Another query about constructor for
XercesDocumentBridge, what is the purpose and
significance of theNumber ? ( description in the
header file says - the Number of Document ) 

Regards, 
Shirish

MyXmlElemNodeSearch ( DOM_Document xerces_node, char *
node_name,
        char * node_attribute, int * node_found )

{

  XercesDocumentBridge * my_xerces_bridge =
        new XercesDocumentBridge( xerces_node, 1,
true, true );

  const DOM_Node xerces_child_node =
xerces_node.getFirstChild();

  XalanNode * xalan_node = my_xerces_bridge->mapNode(
xerces_child_node );

  const XalanDOMString
       
theSelectNodeName(XALAN_STATIC_UCODE_STRING(node_name));
  const XalanDOMString
       
theAttributeName(XALAN_STATIC_UCODE_STRING(node_attribute));

  XalanDOMString theXPathString =
FindNodeAndGetAttributeValue(  xalan_node,
                theSelectNodeName,
                theAttributeName);


  if ( theXPathString != NULL )
  {
    *node_found = 1;
  }
  else
  {
    *node_found = 0;
  }

}


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com