commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fasihullah Askiri" <fasihullah.ask...@baypackets.com>
Subject RE: [scxml] adding an xml to the datamodel
Date Fri, 28 Apr 2006 15:01:18 GMT
Do you have the external file as a file, I mean, have you parsed it? if not, you can get the
digester to add the content. For e.g. this is what I do

scenario.xml
------------
<my_data>
<data include="yes" value="afdsdf"/>
</my_data>

When I digest this file, I have a rule which puts it in the datamodel if it sees include=yes.
You will notice that the content is still name,value pair and not an "XML" per se which you
might use to do an Xpath query maybe.

+Fasih


-----Original Message-----
From: Nestor Urquiza [mailto:nestoru@yahoo.com]
Sent: Fri 4/28/2006 7:34 AM
To: Jakarta Commons Users List
Subject: [scxml] adding an xml to the datamodel
 
Hello guys,
Here I am trying to include my external xml file into
the model using the snippet posted by Fasih:

//byteArraySettingsFileContent has the external xml
file content 
Data scenarioData = new Data();
//I need to understand how to set a node here with the
content of the above file.
/* The Fasih sippet was for setting up String
variables:
scenarioData.setName(Constants.SCENARIO_ID_PARAM);
scenarioData.setExpr("the content of the var here");  
         
scxml.setDatamodel(new Datamodel());
scxml.getDatamodel().addData(scenarioData);

Thanks you all,
Nestor

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org






Mime
View raw message