cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

xMII BLS Usage

Former Member
0 Likes
212

Hi All,

I have a xml file as big as this :-

<?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2007-06-28T15:50:44" EndDate="2007-06-28T15:50:43" StartDate="2007-06-28T14:50:43" Version="11.5.1"><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.REC1" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.REC1"/></Columns><Row><DateTime>2007-06-28T15:50:43</DateTime><Simulation_Items.Bucket_Brigade.REC1>Idle</Simulation_Items.Bucket_Brigade.REC1></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.REC2" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.REC2"/></Columns><Row><DateTime>2007-06-28T15:50:43</DateTime><Simulation_Items.Bucket_Brigade.REC2>Idle</Simulation_Items.Bucket_Brigade.REC2></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.REC3" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.REC3"/></Columns><Row><DateTime>2007-06-28T15:50:43</DateTime><Simulation_Items.Bucket_Brigade.REC3>Running</Simulation_Items.Bucket_Brigade.REC3></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.REC4" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.REC4"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.REC4>Failure</Simulation_Items.Bucket_Brigade.REC4></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.DEC1" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.DEC1"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.DEC1>Running</Simulation_Items.Bucket_Brigade.DEC1></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.DEC2" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.DEC2"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.DEC2>Failure</Simulation_Items.Bucket_Brigade.DEC2></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.DEC3" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.DEC3"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.DEC3>Failure</Simulation_Items.Bucket_Brigade.DEC3></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.DR1" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.DR1"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.DR1>Idle</Simulation_Items.Bucket_Brigade.DR1></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.DR2" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.DR2"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.DR2>Idle</Simulation_Items.Bucket_Brigade.DR2></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.PKG1" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.PKG1"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.PKG1>Running</Simulation_Items.Bucket_Brigade.PKG1></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.PKG2" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.PKG2"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.PKG2>Running</Simulation_Items.Bucket_Brigade.PKG2></Row></Rowset><Rowset><Columns><Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/><Column Description="Bucket brigade item." MaxRange="0" MinRange="0" Name="Simulation_Items.Bucket_Brigade.PKG3" SQLDataType="12" SourceColumn="Simulation Items.Bucket Brigade.PKG3"/></Columns><Row><DateTime>2007-06-28T15:50:44</DateTime><Simulation_Items.Bucket_Brigade.PKG3>Failure</Simulation_Items.Bucket_Brigade.PKG3></Row></Rowset></Rowsets>

I want to retrieve the value of the second item of each {Rowset/Row}

that is, the values of the tag names Simulation_Items.Bucket_Brigade.REC1, Simulation_Items.Bucket_Brigade.REC2, Simulation_Items.Bucket_Brigade.REC3, and so on.

I have put a repeater on the Row, and trying to retrieve the second item, but I am able to get the value of the second item of only the first {Rowset/Row}.

Can anybody please help me with a logic as to how can I get the values of the second item of all the {Rowset/Row}???

Thanks in Advance,

Lipsa.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi Lipsa,

The problem is the second column changes in every rowset. You can pass the second column name dynamically to solve this problem.

If you know xpath you can find better solutions.

The Solution is

1. In the repeater xmlsource.XmlContent{/Rowsets/Rowset}

2. Define a local property to store the second column name.

3. To store the second column name use this xpath expression.

Repeater_0.Output{/Rowset/Columns/Column[2]/@Name}

4. To get the output value use Repeater_0.Output{/Rowset/Row/#Local.<PropertyName>#}

Hope this will help will you.

Regards,

Kishore kumar P.S.

Answers (2)

Answers (2)

0 Likes

Hi Lipsa,

Rick's sugesstion works. To add further to his comments:

1. In the repeater use something like " XmlLoader_0.XmlContent{/Rowsets/Rowset/Row/*[2]} ". This will select all the second child nodes of Row.

2. In the assignment block use this " Repeater_0.Output{/*[1]} ". You cannot node name because it will always return different node names.

Hope this helps.

cheers

Deepak

Former Member
0 Likes

Lipsa,

The sample data your provide appears to be both time-sensitive and include multiple "<Rowset>". I would consider using the Normalize action block (under XML Functions) to merge your rowsets in to a single "<Rowset>". Once this is accomplished then you will have a much easier time using the repeater to evaluate your target data.

Regards,

Michael Teti

Former Member
0 Likes

Hi Michale,

Even you use Normalize action the second column under each row is different. So

The second column name is to be dynamically passed.

Hi Lipsa,

In the solution there is no need to create a local property You can directly use

Repeater_0.Output{/Rowset/Row/#Repeater_0.Output{/Rowset/Columns/Column[2]/@Name}#} .

Assign this to target output.

Regards,

Kishore kumar

Former Member
0 Likes

Assuming that there were no extraneous text nodes or whitespace in the document (which there shouldn't be if it coming from xMII), I think you could also use:

/Rowsets/Rowset/Row /*[2]

- Rick