Converting output of "Asset Attributes Fulllog Scalar" to normal parse file tags

I'm trying to look at the "Asset Attributes Fulllog Scalar" logs for a parse file that seems to have developed a bug. But the output is less than pretty and far from readable.

e.g.

"a:253:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:0:"";}i:1;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:9:"exit_area";s:11:"design_area";s:4:"exit";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:0;s:8:"contents";a:1:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:0:"";}}}i:2;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:1:"
";}i:3;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:15:"nested_EES_code";s:11:"design_area";s:12:"nest_content";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}i:4;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:1:"
";}i:5;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:2:{s:7:"id_name";s:15:"simple_edit_EES";s:11:"design_area";s:7:"show_if";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:0;s:8:"contents";a:5:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:5:"
";}i:1;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:2:{s:4:"name";s:9:"condition";s:5:"value";s:16:"simple_edit_mode";}s:9:"operation";s:3:"set";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}i:2;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:9:"
";}i:3;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:0:{}s:9:"operation";s:4:"then";s:16:"self_terminating";b:0;s:8:"contents";a:9:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:765:"

should look like

<MySource_AREA id_name="exit_area" design_area="exit" print="no"></MySource_AREA>
<MySource_AREA id_name="nested_EES_code" design_area="nest_content" print="no" />
<MySource_AREA id_name="simple_edit_EES" design_area="show_if">
    <MySource_SET name="condition" value="simple_edit_mode" />    
    <MySource_THEN> 

Is there something to help make the "Asset Attributes Fulllog Scalar" output more readable?

 

PS: I've written a number of parsers, is there a key/legend so I can write a parser myself? I'm happy to share the resultant code/app.

I'm trying to look at the "Asset Attributes Fulllog Scalar" logs for a parse file that seems to have developed a bug. But the output is less than pretty and far from readable.

e.g.

"a:253:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:0:"";}i:1;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:9:"exit_area";s:11:"design_area";s:4:"exit";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:0;s:8:"contents";a:1:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:0:"";}}}i:2;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:1:"
";}i:3;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:15:"nested_EES_code";s:11:"design_area";s:12:"nest_content";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}i:4;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:1:"
";}i:5;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:2:{s:7:"id_name";s:15:"simple_edit_EES";s:11:"design_area";s:7:"show_if";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:0;s:8:"contents";a:5:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:5:"
";}i:1;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:2:{s:4:"name";s:9:"condition";s:5:"value";s:16:"simple_edit_mode";}s:9:"operation";s:3:"set";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}i:2;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:9:"
";}i:3;a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:0:{}s:9:"operation";s:4:"then";s:16:"self_terminating";b:0;s:8:"contents";a:9:{i:0;a:2:{s:5:"_type";s:4:"HTML";s:8:"contents";s:765:"

should look like

<MySource_AREA id_name="exit_area" design_area="exit" print="no"></MySource_AREA>
<MySource_AREA id_name="nested_EES_code" design_area="nest_content" print="no" />
<MySource_AREA id_name="simple_edit_EES" design_area="show_if">
    <MySource_SET name="condition" value="simple_edit_mode" />    
    <MySource_THEN> 

Is there something to help make the "Asset Attributes Fulllog Scalar" output more readable?

 

PS: I've written a number of parsers, is there a key/legend so I can write a parser myself? I'm happy to share the resultant code/app.

 

Unfortunately, no, I don't think there is any documentation that might help here. If looking at code is fine, you might be able to translate it. The easiest way I can think of would be to create a blank design then try each tag and look at the logs. Hopefully this should get you started:

a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:15:"nested_EES_code";s:11:"design_area";s:12:"nest_content";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}

would translate to

<MySource_AREA id_name="nested_EES_code" design_area="nest_content" print="no" />

so it looks like you have 5 elements:

  1. type: TAG (not sure the implication of this)
  2. attributes: pretty much direct translation from the markup into this blob
  3. operation: area (I assume this means its a MySource_AREA)
  4. self-terminating: TRUE/FALSE (TRUE: <MySource_AREA /> FALSE: <MySource_AREA></MySource_AREA>)
  5. contents: the value inside the tags (this could be content or more tags, my example has none)

Isn't it just using the PHP serialize function? You can paste the code into an online unserialize site and it will at least make it 100 times more readable:

 

http://blog.tanist.co.uk/files/unserialize/

Isn't it just using the PHP serialize function? You can paste the code into an online unserialize site and it will at least make it 100 times more readable:

 

http://blog.tanist.co.uk/files/unserialize/

 

Oh yep, I forgot to mention it.

I tried pasting the output from "Asset Attributes Fulllog Scalar" logs into "Unserializer input" but only came up with "Not a valid input!". I'll have a go at writing an unserialiser myself and see how that goes. Thanks for the pointer.

I tried pasting the output from "Asset Attributes Fulllog Scalar" logs into "Unserializer input" but only came up with "Not a valid input!". I'll have a go at writing an unserialiser myself and see how that goes. Thanks for the pointer.

 

The one you posted doesn't work, but the code that Ben posted does:

a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:15:"nested_EES_code";s:11:"design_area";s:12:"nest_content";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}

Strange that yours would be different...

 

The one you posted doesn't work, but the code that Ben posted does:

a:5:{s:5:"_type";s:3:"TAG";s:10:"attributes";a:3:{s:7:"id_name";s:15:"nested_EES_code";s:11:"design_area";s:12:"nest_content";s:5:"print";s:2:"no";}s:9:"operation";s:4:"area";s:16:"self_terminating";b:1;s:8:"contents";a:0:{}}

Strange that yours would be different...

With serialisation, you need the full string to unserialise otherwise you get an error. The code in the original post has been cut, you can tell by the start and end eg."a:253:{" (an array of 253 elements but only a few are provided) and ""contents";s:765:" (a string of 765 characters is expected after the colon but none provided). The code I posted was directly from a design with one design area (which I used for the example). Hope that helps.