You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by ji...@apache.org on 2004/06/09 16:49:10 UTC

[jira] Closed: (XERCESC-1225) Help in resolving the getElementsByTagName usage...

Message:

   The following issue has been closed.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1225

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1225
    Summary: Help in resolving the getElementsByTagName usage...
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: WON'T FIX

    Project: Xerces-C++
 Components: 
             DOM

   Assignee: 
   Reporter: Anup Mittal

    Created: Wed, 9 Jun 2004 2:50 AM
    Updated: Wed, 9 Jun 2004 7:47 AM
Environment: OpenVMS 7.3-2

Description:
I have written a sample app and wanted to use the Xerces Library.
Requiremnet of the app:
My sample app simply loads the XML file and does parsing.
After loading the file I need to access some memebrs of that XML file.

I have taken reference from the samples given along with the Xerces kit.

With my sample app I was able to load the DOM tree properly.

Now I needed to access one of the memebrs of the XML file.
My piece of code goes like this:

---------------------------------------------------------------
DOMNode *node;
    DOMNodeList *nodeList;
    XMLCh *sEltValue;
   XMLCh *sEltValue1;
   XMLCh tempStr[100];

....XMLString::transcode("ElementName", tempStr, 99);
     printf("tempstr=%s\n",tempStr);
      if((nodeList = doc->getElementsByTagName(tempStr))!=NULL);
       cout << "nodelist1" << nodeList;
         printf("enter into nodelist1=%s\n",nodeList);.....

---------------------------------------------------------------------
Here ElementName is one of the member names of the xml File which is hash defined.(e.g. #define ElementName IPRestriction)

When I try to print tempStr I get the output as "E"(i.e first element of the string ).
(I am not sure what has happned to my IPRestriction hash definition)
And when this tag is given to the doc->getElementsByTagName I get all junk values .

Can somebody explain how XMLString::transcode works and how do I get all the elemnts in the nodelist
e.g I wanted to actually check if a name IPRestriction exists in the xml file and do some processing after that.
But here I am not able to get the node list properly.

Any assistance is greatly appreciated.

Thanks,
Anup





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org