|
| 1 | +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 2 | + <xsl:template match="/*"> |
| 3 | + <html> |
| 4 | + <head> |
| 5 | + <title><xsl:value-of select="@name"/></title> |
| 6 | + </head> |
| 7 | + <body> |
| 8 | + <xsl:apply-templates/> |
| 9 | + </body> |
| 10 | + </html> |
| 11 | + </xsl:template> |
| 12 | + |
| 13 | + <xsl:template match="QCheckBox"> |
| 14 | + <span> |
| 15 | + <xsl:call-template name="style"/> |
| 16 | + <input type="checkbox"> |
| 17 | + <xsl:copy-of select="@elementId"/> |
| 18 | + <xsl:if test="@checked = 'true'"> |
| 19 | + <xsl:attribute name="checked"/> |
| 20 | + </xsl:if> |
| 21 | + </input> |
| 22 | + <span> |
| 23 | + <xsl:value-of select="@text"/> |
| 24 | + </span> |
| 25 | + </span> |
| 26 | + </xsl:template> |
| 27 | + <xsl:template match="QLabel"> |
| 28 | + <span> |
| 29 | + <xsl:copy-of select="@elementId"/> |
| 30 | + <xsl:call-template name="style"/> |
| 31 | + <xsl:value-of select="@text"/> |
| 32 | + </span> |
| 33 | + </xsl:template> |
| 34 | + <xsl:template match="QLineEdit"> |
| 35 | + <input type="text"> |
| 36 | + <xsl:copy-of select="@elementId"/> |
| 37 | + <xsl:call-template name="style"/> |
| 38 | + <xsl:attribute name="value"> |
| 39 | + <xsl:value-of select="@text"/> |
| 40 | + </xsl:attribute> |
| 41 | + <xsl:if test="@enabled = 'false'"> |
| 42 | + <xsl:attribute name="disabled"/> |
| 43 | + </xsl:if> |
| 44 | + </input> |
| 45 | + </xsl:template> |
| 46 | + <xsl:template match="QPushButton|QToolButton"> |
| 47 | + <input type="submit"> |
| 48 | + <xsl:copy-of select="@elementId"/> |
| 49 | + <xsl:call-template name="style"/> |
| 50 | + <xsl:attribute name="value"> |
| 51 | + <xsl:value-of select="@text"/> |
| 52 | + </xsl:attribute> |
| 53 | + </input> |
| 54 | + </xsl:template> |
| 55 | + <xsl:template match="QRadioButton"> |
| 56 | + <span> |
| 57 | + <xsl:call-template name="style"/> |
| 58 | + <input type="radio"> |
| 59 | + <xsl:copy-of select="@elementId"/> |
| 60 | + <xsl:attribute name="name"> |
| 61 | + <xsl:text>parent:</xsl:text> |
| 62 | + <xsl:value-of select="../@elementId"/> |
| 63 | + </xsl:attribute> |
| 64 | + </input> |
| 65 | + <span> |
| 66 | + <xsl:value-of select="@text"/> |
| 67 | + </span> |
| 68 | + </span> |
| 69 | + </xsl:template> |
| 70 | + <xsl:template match="QScrollArea"> |
| 71 | + <div> |
| 72 | + <xsl:copy-of select="@elementId"/> |
| 73 | + <xsl:call-template name="style"/> |
| 74 | + <xsl:apply-templates/> |
| 75 | + </div> |
| 76 | + </xsl:template> |
| 77 | + <xsl:template match="QTextEdit|QPlainTextEdit"> |
| 78 | + <textarea> |
| 79 | + <xsl:copy-of select="@elementId"/> |
| 80 | + <xsl:call-template name="style"/> |
| 81 | + <xsl:if test="@enabled = 'false'"> |
| 82 | + <xsl:attribute name="disabled"/> |
| 83 | + </xsl:if> |
| 84 | + <xsl:value-of select="@plainText"/> |
| 85 | + </textarea> |
| 86 | + </xsl:template> |
| 87 | + <xsl:template match="QWebView"> |
| 88 | + <iframe> |
| 89 | + <xsl:copy-of select="@elementId"/> |
| 90 | + <xsl:call-template name="style"/> |
| 91 | + <xsl:attribute name="src"> |
| 92 | + <xsl:value-of select="@url"/> |
| 93 | + </xsl:attribute> |
| 94 | + </iframe> |
| 95 | + </xsl:template> |
| 96 | + |
| 97 | + <xsl:template name="style"> |
| 98 | + <xsl:attribute name="style"> |
| 99 | + <xsl:if test="@width"> |
| 100 | + <xsl:text>width: </xsl:text><xsl:value-of select="@width"/><xsl:text>;</xsl:text> |
| 101 | + </xsl:if> |
| 102 | + <xsl:if test="@height"> |
| 103 | + <xsl:text>height: </xsl:text><xsl:value-of select="@height"/><xsl:text>;</xsl:text> |
| 104 | + </xsl:if> |
| 105 | + <xsl:if test="@visible = 'false'"> |
| 106 | + <xsl:text>display: none;</xsl:text> |
| 107 | + </xsl:if> |
| 108 | + <xsl:if test="@styleSheet"> |
| 109 | + <xsl:value-of select="@styleSheet"/><xsl:text>;</xsl:text> |
| 110 | + </xsl:if> |
| 111 | + </xsl:attribute> |
| 112 | + </xsl:template> |
| 113 | +</xsl:stylesheet> |
0 commit comments