svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 3229 c5be4fd425e7
parent 3222 6adeeb16ac3e
child 3238 8a9d4c794cba
child 3240 5f756332ada1
equal deleted inserted replaced
3228:80f96db773bd 3229:c5be4fd425e7
   205                     <xsl:text> has wrong syntax of path section </xsl:text>
   205                     <xsl:text> has wrong syntax of path section </xsl:text>
   206                     <xsl:value-of select="$pathminmax"/>
   206                     <xsl:value-of select="$pathminmax"/>
   207                   </xsl:message>
   207                   </xsl:message>
   208                 </xsl:when>
   208                 </xsl:when>
   209               </xsl:choose>
   209               </xsl:choose>
   210               <xsl:choose>
   210               <xsl:if test="$indexed_hmitree">
   211                 <xsl:when test="regexp:test($path,'^\.[a-zA-Z0-9_]+$')">
   211                 <xsl:choose>
   212                   <xsl:attribute name="type">
   212                   <xsl:when test="regexp:test($path,'^\.[a-zA-Z0-9_]+$')">
   213                     <xsl:text>PAGE_LOCAL</xsl:text>
   213                     <xsl:attribute name="type">
   214                   </xsl:attribute>
   214                       <xsl:text>PAGE_LOCAL</xsl:text>
   215                 </xsl:when>
       
   216                 <xsl:when test="regexp:test($path,'^[a-zA-Z0-9_]+$')">
       
   217                   <xsl:attribute name="type">
       
   218                     <xsl:text>HMI_LOCAL</xsl:text>
       
   219                   </xsl:attribute>
       
   220                 </xsl:when>
       
   221                 <xsl:otherwise>
       
   222                   <xsl:variable name="item" select="$indexed_hmitree/*[@hmipath = $path]"/>
       
   223                   <xsl:variable name="pathtype" select="local-name($item)"/>
       
   224                   <xsl:if test="$pathminmaxcount = 3 and not($pathtype = 'HMI_INT' or $pathtype = 'HMI_REAL')">
       
   225                     <xsl:message terminate="yes">
       
   226                       <xsl:text>Widget id:</xsl:text>
       
   227                       <xsl:value-of select="$id"/>
       
   228                       <xsl:text> label:</xsl:text>
       
   229                       <xsl:value-of select="$label"/>
       
   230                       <xsl:text> path section </xsl:text>
       
   231                       <xsl:value-of select="$pathminmax"/>
       
   232                       <xsl:text> use min and max on non mumeric value</xsl:text>
       
   233                     </xsl:message>
       
   234                   </xsl:if>
       
   235                   <xsl:if test="count($item) = 1">
       
   236                     <xsl:attribute name="index">
       
   237                       <xsl:value-of select="$item/@index"/>
       
   238                     </xsl:attribute>
   215                     </xsl:attribute>
       
   216                   </xsl:when>
       
   217                   <xsl:when test="regexp:test($path,'^[a-zA-Z0-9_]+$')">
   239                     <xsl:attribute name="type">
   218                     <xsl:attribute name="type">
   240                       <xsl:value-of select="$pathtype"/>
   219                       <xsl:text>HMI_LOCAL</xsl:text>
   241                     </xsl:attribute>
   220                     </xsl:attribute>
   242                   </xsl:if>
   221                   </xsl:when>
   243                 </xsl:otherwise>
   222                   <xsl:otherwise>
   244               </xsl:choose>
   223                     <xsl:variable name="item" select="$indexed_hmitree/*[@hmipath = $path]"/>
       
   224                     <xsl:variable name="pathtype" select="local-name($item)"/>
       
   225                     <xsl:if test="$pathminmaxcount = 3 and not($pathtype = 'HMI_INT' or $pathtype = 'HMI_REAL')">
       
   226                       <xsl:message terminate="yes">
       
   227                         <xsl:text>Widget id:</xsl:text>
       
   228                         <xsl:value-of select="$id"/>
       
   229                         <xsl:text> label:</xsl:text>
       
   230                         <xsl:value-of select="$label"/>
       
   231                         <xsl:text> path section </xsl:text>
       
   232                         <xsl:value-of select="$pathminmax"/>
       
   233                         <xsl:text> use min and max on non mumeric value</xsl:text>
       
   234                       </xsl:message>
       
   235                     </xsl:if>
       
   236                     <xsl:if test="count($item) = 1">
       
   237                       <xsl:attribute name="index">
       
   238                         <xsl:value-of select="$item/@index"/>
       
   239                       </xsl:attribute>
       
   240                       <xsl:attribute name="type">
       
   241                         <xsl:value-of select="$pathtype"/>
       
   242                       </xsl:attribute>
       
   243                     </xsl:if>
       
   244                   </xsl:otherwise>
       
   245                 </xsl:choose>
       
   246               </xsl:if>
   245             </path>
   247             </path>
   246           </xsl:if>
   248           </xsl:if>
   247         </xsl:for-each>
   249         </xsl:for-each>
   248       </widget>
   250       </widget>
   249     </xsl:if>
   251     </xsl:if>
       
   252   </xsl:template>
       
   253   <xsl:template mode="genlabel" match="arg">
       
   254     <xsl:text>:</xsl:text>
       
   255     <xsl:value-of select="@value"/>
       
   256   </xsl:template>
       
   257   <xsl:template mode="genlabel" match="path">
       
   258     <xsl:text>@</xsl:text>
       
   259     <xsl:value-of select="@value"/>
       
   260     <xsl:if test="string-length(@min)&gt;0 or string-length(@max)&gt;0">
       
   261       <xsl:text>:</xsl:text>
       
   262       <xsl:value-of select="@min"/>
       
   263       <xsl:text>:</xsl:text>
       
   264       <xsl:value-of select="@max"/>
       
   265     </xsl:if>
       
   266   </xsl:template>
       
   267   <xsl:template mode="genlabel" match="widget">
       
   268     <xsl:text>HMI:</xsl:text>
       
   269     <xsl:value-of select="@type"/>
       
   270     <xsl:apply-templates mode="genlabel" select="arg"/>
       
   271     <xsl:apply-templates mode="genlabel" select="path"/>
   250   </xsl:template>
   272   </xsl:template>
   251   <xsl:variable name="_parsed_widgets">
   273   <xsl:variable name="_parsed_widgets">
   252     <widget type="VarInitPersistent">
   274     <widget type="VarInitPersistent">
   253       <arg value="0"/>
   275       <arg value="0"/>
   254       <path value="lang"/>
   276       <path value="lang"/>