Ticket #1868: CodegenXML.tpl.patch

File CodegenXML.tpl.patch, 2.0 KB (added by janssen, 12 years ago)
  • Compiler/Template/CodegenXML.tpl

     
    3131  let guid = getUUIDStr()
    3232  <<
    3333  <?xml version="1.0" encoding="UTF-8"?>
    34   <OpenModelicaModelDescription>
     34  <OpenModelicaModelDescription
    3535    xmlns:exp="https://svn.jmodelica.org/trunk/XML/daeExpressions.xsd"
    3636    xmlns:equ="https://svn.jmodelica.org/trunk/XML/daeEquations.xsd"
    3737    xmlns:fun="https://svn.jmodelica.org/trunk/XML/daeFunctions.xsd"
    3838    xmlns:opt="https://svn.jmodelica.org/trunk/XML/daeOptimization.xsd"
    3939    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4040    <%modelDescriptionXml(simCode,guid)%>
     41    >
    4142 
    4243    <%vendorAnnotationsXml(simCode)%>
    4344 
     
    255256  case ICONST(__) then integer
    256257  case RCONST(__) then real
    257258  case SCONST(__) then '"<%Util.escapeModelicaStringToXmlString(string)%>"'
    258   case BCONST(__) then 'if bool then "1" else "0"'
     259  case BCONST(__) then (if bool then "1" else "0")
    259260  case ENUM_LITERAL(__) then '<%index%>/*ENUM:<%dotPathXml(name)%>*/'
    260261  else "*ERROR* initial value of unknown type"
    261262end initValXml;
     
    21242125  case e as ICONST(__)          then '<exp:IntegerLiteral><%integer%></exp:IntegerLiteral>'
    21252126  case e as RCONST(__)          then '<exp:RealLiteral><%real%></exp:RealLiteral>'
    21262127  case e as SCONST(__)          then '<exp:StringLiteral><%daeExpSconstXml(string, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)%></exp:StringLiteral>'
    2127   case e as BCONST(__)          then '<exp:BooleanLiteral><%if bool then "1" else "0"%> <exp:BooleanLiteral>'
     2128  case e as BCONST(__)          then '<exp:BooleanLiteral>' + (if bool then "1" else "0") + '</exp:BooleanLiteral>'
    21282129  case e as ENUM_LITERAL(__)    then index
    21292130  case e as CREF(__)            then daeExpCrefRhsXml(e, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
    21302131  case e as BINARY(__)          then daeExpBinaryXml(e, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)