WMB入门之九:XML 节点全操作

WMB入门之九:XML 节点全操作
Compute节点的ESQL是:
CREATE   COMPUTE  MODULE flow_Compute
    
CREATE   FUNCTION  Main()  RETURNS  BOOLEAN
    
BEGIN
        
--  XML操作示例

        
SET  OutputRoot.XML.employee.(XML.Attribute)id  =   ' 001 ' ;
        
SET  OutputRoot.XML.employee.name  =   ' Felix ' ;
        
SET  OutputRoot.XML.employee.age  =   33 ;

        
SET  OutputRoot.XML.employee.address [ 1 ]   =   ' Dalian 88 ' ;
        
SET  OutputRoot.XML.employee.address [ 2 ]   =   ' Beijing 188 ' ;
        
SET  OutputRoot.XML.employee.address [ 3 ]   =   ' Shanghai 288 ' ;

        
SET  OutputRoot.XML.employee.title.VALUE  =   NULL ;
        
        
SET  OutputRoot.XML.employee.salary VALUE  =   NULL ;

        
SET  OutputRoot.XML.employee.Comments.(XML.Content) = NULL ;

        
RETURN  TRUE;
    
END ;
END  MODULE;

最终得到的XML是:
< employee  id ="001" >< name > Felix </ name >< age > 33 </ age >< address > Dalian 88 </ address >< address > Beijing 188 </ address >< address > Shanghai 288 </ address >< title />< salary ></ salary >< Comments /></ employee >

工程下载:
http://www.blogjava.net/Files/heyang/ESqlTest0921_02.rar

你可能感兴趣的:(WMB入门之九:XML 节点全操作)