Difference between revisions of "XML DECODE()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
{{YLM to do}}
 
 
 
==Purpose==
 
==Purpose==
Return a decoded character string containing XML as an object
+
Return a character string containing XML decoded as an object
  
  
Line 10: Line 8:
  
 
==See Also==
 
==See Also==
[[:Category:Messaging|Messaging Functions]], [[MQCLOSE()]], [[MQCREATE()]], [[MQCURMSGS()]], [[MQOPEN()]],  [[MQSEND()]], [[MQRECEIVE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]]
+
[[:Category:Messaging|Messaging Functions]], [[MQCLOSE()]], [[MQCREATE()]], [[MQCURMSGS()]], [[MQOPEN()]],  [[MQSEND()]], [[MQRECEIVE()]], [[MQUNLINK()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]]
  
  
 
==Description==
 
==Description==
The XML_DECODE() function returns the decoded character string containing XML, <expC1>, as an object.
+
The XML_ENCODE() function is used to encode an object as a character string containing XML for use with the messaging functions to pass objects between processes.  The XML_DECODE() function returns the received XML character string, <expC1>, decoded back into an object. The optional character expression <expC1> is the XML root tag name. The optional character expression <expC2> is the XML row tag name. 
  
  
Line 25: Line 23:
 
       // retrieve message
 
       // retrieve message
 
       m_message = mqreceive(m_mqdes)
 
       m_message = mqreceive(m_mqdes)
           // decode the XML message into a dynamic array
+
           // decode the XML message into an object/dynamic array
 
           m_objmessage = xml_decode(m_message)
 
           m_objmessage = xml_decode(m_message)
 
           // process the message
 
           // process the message

Latest revision as of 10:11, 5 July 2011

Purpose

Return a character string containing XML decoded as an object


Syntax

XML_DECODE(<expC1> [, <expC2>, <expC3>])


See Also

Messaging Functions, MQCLOSE(), MQCREATE(), MQCURMSGS(), MQOPEN(), MQSEND(), MQRECEIVE(), MQUNLINK(), XML_ENCODE(), XML_GATHER(), XML_SCATTER()


Description

The XML_ENCODE() function is used to encode an object as a character string containing XML for use with the messaging functions to pass objects between processes. The XML_DECODE() function returns the received XML character string, <expC1>, decoded back into an object. The optional character expression <expC1> is the XML root tag name. The optional character expression <expC2> is the XML row tag name.


Example

// Proccess the message queue
do while .t.
   // Check for new messages
   do while (mqcurmsgs(m_mqdes) > 0)
       // retrieve message
       m_message = mqreceive(m_mqdes)
           // decode the XML message into an object/dynamic array
           m_objmessage = xml_decode(m_message)
           // process the message
       mq_process_message(m_objmessage, m_message)
   enddo
   sleep 1
enddo


Products

Recital, Recital Server