"xml" Snippets


Parse XML

 xml
Created: 1439255534
View "Parse XML"
<!-- Parse XML --> <mvt:assign name="l.settings:xml:string" value="'<response><products><product><productid>5267X</productid></product><product><productid>5853X</productid></product><product><productid>611504</productid></product><product><productid>1689X</productid></product><product><productid>7372</productid></product><product><productid>5545</productid></product><product><productid>53994X</productid></product></products><pageid>res15081017465450701520522</pageid><trackingid>291272663181308</trackingid></response>'" /> <mvt:assign name="l.settings:xml:result" value="xml_parse_var( l.settings:xml:string, l.settings:xml:parsed )" /> <!-- Assign Easier Variable Names --> <mvt:assign name="g.pageid" value="l.settings:xml:parsed:response:tags:pageid[1]:value"/> <mvt:assign name="g.trackingid" value="l.settings:xml:parsed:response:tags:trackingid[1]:value"/> <mvt:assign name="l.settings:products" value="l.settings:xml:parsed:response:tags:products[1]:children"/> <h2>Set Cookies For:</h2> Page Id: &mvte:global:pageid;<br/> Tracking ID: &mvte:global:trackingid;<br/> <h2>Products:</h2> <mvt:foreach array="products" iterator="product"> <mvt:eval expr="l.settings:product:tags:productid[1]:value" /><br> </mvt:foreach> <hr/> <h2>Debuging</h2> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:xml), ',', '<br>'))" />
 

Parse XML

 xml
Created: 1439255453
View "Parse XML"
<!-- Parse XML --> <mvt:assign name="l.settings:xml:string" value="'<response><products><product><productid>5267X</productid></product><product><productid>5853X</productid></product><product><productid>611504</productid></product><product><productid>1689X</productid></product><product><productid>7372</productid></product><product><productid>5545</productid></product><product><productid>53994X</productid></product></products><pageid>res15081017465450701520522</pageid><trackingid>291272663181308</trackingid></response>'" /> <mvt:assign name="l.settings:xml:result" value="xml_parse_var( l.settings:xml:string, l.settings:xml:parsed )" /> <!-- Assign Easier Variable Names --> <mvt:assign name="g.pageid" value="l.settings:xml:parsed:response:tags:pageid[1]:value"/> <mvt:assign name="g.trackingid" value="l.settings:xml:parsed:response:tags:trackingid[1]:value"/> <mvt:assign name="l.settings:products" value="l.settings:xml:parsed:response:children[1]:children"/> <h2>Set Cookies For:</h2> Page Id: &mvte:global:pageid;<br/> Tracking ID: &mvte:global:trackingid;<br/> <h2>Products:</h2> <mvt:foreach array="products" iterator="product"> <mvt:eval expr="l.settings:product:tags:productid[1]:value" /><br> </mvt:foreach> <hr/> <h2>Debuging</h2> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:xml), ',', '<br>'))" />
 

Basket #898

Note: This does not work yet.
Created: 1429560729
View "Basket #898"
<mvt:assign name="g.xml" value="'<Product_Update code=\"sample-product\"><Price>200</Price></Product_Update>'" /> <mvt:do file="g.module_feature_prv_ad" name="g.provision_result" value="PRV_Action_ProvisionStringData( g.xml )" /> &mvte:global:mvdo_error; &mvte:global:xml; <hr> &mvt:global:provision_result;