× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Aaron,

I cannot answer all your questions here, but I have done this in my code 
(snippets)

 *  Get the node name                                                   
C                   EVAL      Domstrptr@ = QxmlDOM_Node_getNodeName    
C                                          (nodlstptr@)                
C                   EVAL      element = %str(                          
C                             QxmlDOMString_transcode(Domstrptr@))     
 *                                                                     
C                   CALLP     QxmlDOMString_delete(Domstrptr@)         
  * get value of element or attribute
 C                   Eval      Nodeptr@ = QxmlDOM_Node_getFirstChild   
 C                                        (NodLstPtr@)                 
 C                   Eval      childVal = ParsedVal                    
  *  procedure to getvalue of element or attribute                     

**************************************************************************
  * Parsed Value                                                       
**************************************************************************
 P ParsedVal       B                                                   
  *                                                                    
 D ParsedVal       PI            32                                    
 *
 D ReturnVal       S             32                                    
 *
 C                   Eval      Domstrptr@ =  QxmlDOM_Node_getNodeValue 
 C                                           (Nodeptr@)                
 C                   Eval      ReturnVal = %str(                       
 C                             QxmlDOMString_transcode(Domstrptr@))    
  *                                                                    
 C                   CallP     QxmlDOMString_delete(Domstrptr@)        
  *                                                                    
 C                   Return    ReturnVal                               
  *                                                                    
 P ParsedVal       E              

All the pointers used in my PGM are defined global.

>From my "analysis" of the sample programme with the XML4 parser (alphaworks) I 
>concluded this:
to get a child element's value I need to call _Node_getFirstChild, 
_Node_getNodeValue, string_transcode, pointers required: Domstrptr@, Nodeptr@

to get the child element you use the _Node_getNodeName and string_transcode, 
using the same pointer.

I removed the code that retrieved values like '#text', as I do not need that.

Regards,
Carel Teijgeler.

*********** REPLY SEPARATOR  ***********

On 17-3-03 at 10:32 Bartell, Aaron L. (TC) wrote:

>I have a couple questions.
>
>#1
>When I retrieve the child nodes of a node it puts #text in-between each child 
>node.  For instance, here is what my child node list looks like:
>
>Any idea why this is happening?  It isn't hurting anything other than I have 
>to make another iteration, but I am thinking that is going to add up when I 
>start doing larger XML documents.  This might be related to my second 
>question. . .
>
>#2
>DOM_Node_getNodeValue is not returning the value of the node.  Here is what my 
>code looks like (I have put it into a sub procedure for ease of use).  I know 
>I have a valid node because the ...getNodeName works just fine and I am 
>passing the same node pointer to both API's. **note - I took 'Qxml' off the 
>front of all the IBM API's**




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.