The first node you get is Administrate
then a text node for the carriage return
then the <CreateUser> node
then a text node for the carriage return.

if you want to go deep and get the user name an password,
do a recursive function and explore the internal nodes.

note that you should explore each node based on its type.

look at the domprint tutorial for an example of recursive
exploration code.

Olivier Schmitt

-----Original Message-----
From: Aniruddha Shevade [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 3:03 PM
To: [EMAIL PROTECTED]
Subject: xerces1-4: What is wrong in this code ?


When I am using xerces to parse the following xml docuemnt

<Administrate SOAP-ENC:arrayType="ur-type[1]">
<CreateUser>
  <User>
    <Name>user1</Name>
    <Password>user1</Password>
  </User>
</CreateUser>
</Administrate>

I retrieve the <Administrate> node and then the following code
DOM_NodeList operList = adminRequestNode.getChildNodes() ;
for( unsigned int numop = 0; numop < operList.getLength(); numop ++)
        {

     // Retrieve each Request. Each Request is a child node of the
BatchRequestNode
     DOM_Node operNode = operList.item(numop);

        l_nodeName = operNode.getNodeName().transcode() ;
        l_nodeValue = operNode.getNodeValue().transcode() ;

        printf(" Node Name: %s", l_nodeName );
        printf(" Node Value:%s " , l_nodeValue ;

        delete[] l_nodeName;
        delete[] l_nodeValue;
        }

I get the following result
  Node Name: Administrate   Node Value
  Node Name: #text Node Value:
  Node Name: CreateUser   Node Value
  Node Name: #text Node Value:

 I would have expected just CreateUser to show up .  I do not understand
why
it should even print the Administrate node
And what are these dummy nodes #text ?
  What do I have to do if I am just interested in getting the CreateUser
Node ?

Any help is appreciated

Thanks
Aniruddha



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to