sábado, 9 de maio de 2009

xml - 09 05 09 - 08:47

cImpXMLNavigator &= cImpExch.getNavigator()
cImpXMLNavigator.goToRoot()
bImpXmlRet = cImpXMLNavigator.goToFirstChild()
Loop
If bImpXmlRet <> CPXMLErr:NoError
Break
End
If cImpXMLNavigator.getNodeName() = 'Orders'
cImpXMLNavigator.setXMLExchangeNode()
! Set the node back into the Exchange object
bImpXmlRet = cImpExch.FromXML( cImpWrapperOD )
!And read in the set of OrderDetails for this order
If bImpXmlRet <> CPXMLErr:NoError
Message( 'An Error Occurred while Converting the XML Input. ' &|
'The error returned was: ' & bImpXmlRet,|
'Error Converting XML Output',|
ICON:Hand, BUTTON:OK )
End
End
bImpXmlRet = cImpXMLNavigator.goToNextSibling()
End
cImpExch.Close()

sexta-feira, 8 de maio de 2009

xml - clarion

!After global includes
INCLUDE('ABPRXML.INC'),ONCE
XML XMLGenerator !create an instance of the XMLGenerator class
---
XML.Init('\amarildo\b.XML')
XML.OpenDocument()
XML.SetEncoding('ISO-8859-1')
XML.XMLVersion = '1.0'
XML.SetRootTag('breakfast_menu')
XML.AddComment('The root tag is the first tag in the doc')
XML.AddTag('food','')
XML.AddAttribute('recordNumber','1','food')
XML.AddTag('name','Belgian Waffles',false,'food')
XML.AddTag('price','$5.95',false,'food')
XML.AddTag('description','two of our famous Belgian Waffles with plenty of real maple syrup',false,'food')
XML.AddTag('calories','650',false,'food')
XML.AddTag('food','')
XML.AddAttribute('recordNumber','2','food')
XML.AddTag('name','Strawberry Belgian Waffles',false,'food')
XML.AddTag('price','$7.95',false,'food')
XML.AddTag('description','light Belgian waffles covered with strawberries and whipped cream',false,'food')
XML.AddTag('calories','900',false,'food')
XML.CloseDocument()