xml readytheme csv xml
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml readytheme csv xml相关的知识,希望对你有一定的参考价值。
<mvt:assign name="g.new_line" value="asciichar(10)"/>
<mvt:assign name="g.file_path" value="'Merchant5/s01/export/data.csv'" />
<mvt:if expr="NOT fexists(g.file_path)">
File does not exist
<mvt:exit/>
</mvt:if>
<mvt:assign name="g.file_length" value="file_read(g.file_path, 'data', g.file_contents)" />
<mvt:assign name="g.Per_Page" value="1000" />
<mvt:assign name="g.Start_At" value="g.Offset + 1" />
<mvt:assign name="g.Counter" value="g.Start_At" />
<mvt:assign name="g.End_At" value="g.Start_At + g.Per_Page" />
<mvt:assign name="g.current_line_string" value="'initialized'" />
<mvt:while expr="g.current_line_string NE NULL AND g.Counter LE g.End_At ">
<mvt:assign name="g.current_line_string" value="gettoken( g.file_contents, g.new_line, g.Counter )"/>
<mvt:assign name="g.Counter" value="g.Counter + 1" />
<mvt:if expr="len(g.current_line_string) GT 1">
<mvt:assign name="l.settings:data" value="trim(g.current_line_string)" />
<mvt:assign name="l.settings:temp_array" value="miva_array_deserialize(l.settings:data)" />
<mvt:assign name="l.settings:array:name" value="l.settings:temp_array[1]" />
<mvt:assign name="l.settings:array:order" value="l.settings:temp_array[3]" />
<mvt:assign name="l.settings:array:cat_link" value="l.settings:temp_array[4]" />
<mvt:assign name="l.settings:array:prod_link" value="l.settings:temp_array[5]" />
<mvt:assign name="l.settings:array:page_link" value="l.settings:temp_array[6]" />
<mvt:assign name="l.settings:array:other_link" value="l.settings:temp_array[7]" />
<mvt:if expr="l.settings:array:order EQ 1">
<mvt:assign name="l.null" value="miva_array_insert( l.settings:readytheme, l.settings:array, -1 )" />
<mvt:assign name="l.settings:level2" value="0" />
<mvt:elseif expr="l.settings:array:order EQ 2">
<mvt:assign name="l.null" value="miva_array_insert( l.settings:readytheme[miva_array_elements( l.settings:readytheme )]:children, l.settings:array, -1 )" />
<mvt:assign name="l.settings:level2" value="l.settings:level2 + 1" />
<mvt:elseif expr="l.settings:array:order EQ 3">
<mvt:assign name="l.null" value="miva_array_insert( l.settings:readytheme[miva_array_elements( l.settings:readytheme )]:children[l.settings:level2]:children, l.settings:array, -1 )" />
</mvt:if>
</mvt:if>
</mvt:while>
<Module code="readytheme" feature="component">
<NavigationSet_Add>
<Code>main</Code>
<Name>Main Navigation</Name>
<Description>Main Navigation</Description>
<Layout>Horizontal Drop-Down</Layout>
<Items>
<mvt:foreach iterator="theme" array="readytheme">
<Item>
<Active>true</Active>
<Name>&mvt:theme:name;</Name>
<mvt:if expr="l.settings:theme:cat_link">
<Link type="Category">&mvt:theme:cat_link;</Link>
<mvt:elseif expr="l.settings:theme:prod_link">
<Link type="Product">&mvt:theme:prod_link;</Link>
<mvt:elseif expr="l.settings:theme:page_link">
<Link type="Page">&mvt:theme:page_link;</Link>
<mvt:elseif expr="l.settings:theme:other_link">
<Link type="Url">&mvt:theme:other_link;</Link>
</mvt:if>
<mvt:if expr="l.settings:theme:children">
<SubItems>
<mvt:foreach iterator="theme2" array="theme:children">
<mvt:if expr="l.settings:theme2:name">
<Item>
<Active>true</Active>
<Name>&mvt:theme2:name;</Name>
<mvt:if expr="l.settings:theme2:cat_link">
<Link type="Category">&mvt:theme2:cat_link;</Link>
<mvt:elseif expr="l.settings:theme2:prod_link">
<Link type="Product">&mvt:theme2:prod_link;</Link>
<mvt:elseif expr="l.settings:theme2:page_link">
<Link type="Page">&mvt:theme2:page_link;</Link>
<mvt:elseif expr="l.settings:theme2:other_link">
<Link type="Url">&mvt:theme2:other_link;</Link>
</mvt:if>
<mvt:if expr="l.settings:theme2:children">
<SubItems>
<mvt:foreach iterator="theme3" array="theme2:children">
<mvt:if expr="l.settings:theme3:name">
<Item>
<Active>true</Active>
<Name>&mvt:theme3:name;</Name>
<mvt:if expr="l.settings:theme3:cat_link">
<Link type="Category">&mvt:theme3:cat_link;</Link>
<mvt:elseif expr="l.settings:theme3:prod_link">
<Link type="Product">&mvt:theme3:prod_link;</Link>
<mvt:elseif expr="l.settings:theme3:page_link">
<Link type="Page">&mvt:theme3:page_link;</Link>
<mvt:elseif expr="l.settings:theme3:other_link">
<Link type="Url">&mvt:theme3:other_link;</Link>
</mvt:if>
</Item>
</mvt:if>
</mvt:foreach>
</SubItems>
</mvt:if>
</Item>
</mvt:if>
</mvt:foreach>
</SubItems>
</mvt:if>
</Item>
</mvt:foreach>
</Items>
</NavigationSet_Add>
</Module>
以上是关于xml readytheme csv xml的主要内容,如果未能解决你的问题,请参考以下文章