Allow background colour setting by namespace
Posted: Tue Feb 03, 2004 6:06 pm
I've been attempting to amend the XSLT syntax to background highlight the XSLT template code. There seems to be no way to do this, I can only background highlight the specific keywords, not the entire tag that the keyword is in.
What I wanted was to highlight everything that is XSLT template code with a pale yellow background, very similar to the way that netbeans highlight java code embedded in a JSP.
My suggested solution is -
For XML (ie HTML) type syntaxes allow sections in the syn file for namespaces eg
namespace1
xsl
namespace2
xs
In Preferences->DocumentClasses->???->Colors add the same namespaces in the "item" box
If a namespace item is selected then only allow setting of the background colour.
Here is an example script where what you see in bold I would actually like to see with a pale yellow background. Howver the foreground colours I would still like to appear as defined in the syn file for different elements, attributes, quoted strings etc.
<CREATE_PERSONAL_CUSTOMER>
<CLIENT_STUB>
<INDIRECT_IDENTIFY>0</INDIRECT_IDENTIFY>
<STATUS>1</STATUS>
<DIRECT_PHONE>0</DIRECT_PHONE>
<DIRECT_MAIL>0</DIRECT_MAIL>
<DIRECT_FAX>0</DIRECT_FAX>
</CLIENT_STUB>
<PERSONAL_DETAILS>
<TITLE>
<xsl:value-of select="$title" />
</TITLE>
<FNAME>
<xsl:value-of select="$given-name" />
</FNAME>
<MNAME>
<xsl:value-of select="$other-given-name" />
</MNAME>
<SNAME>
<xsl:value-of select="$surname" />
</SNAME>
<SUFFIX>
<xsl:value-of select="$name-suffix" />
</SUFFIX>
<DOB>
<xsl:call-template name="convert-date">
<xsl:with-param name="date" select="$birth-date" />
</xsl:call-template>
</DOB>
<SEX>
<xsl:choose>
<xsl:when test="$gender='F'">1</xsl:when>
<xsl:when test="$gender='M'">2</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</SEX>
</PERSONAL_DETAILS>
</CREATE_PERSONAL_CUSTOMER>
(Sorry about the formatting - [ code ] and [ b ] tags don't work together on this forum)
What I wanted was to highlight everything that is XSLT template code with a pale yellow background, very similar to the way that netbeans highlight java code embedded in a JSP.
My suggested solution is -
For XML (ie HTML) type syntaxes allow sections in the syn file for namespaces eg
namespace1
xsl
namespace2
xs
In Preferences->DocumentClasses->???->Colors add the same namespaces in the "item" box
If a namespace item is selected then only allow setting of the background colour.
Here is an example script where what you see in bold I would actually like to see with a pale yellow background. Howver the foreground colours I would still like to appear as defined in the syn file for different elements, attributes, quoted strings etc.
<CREATE_PERSONAL_CUSTOMER>
<CLIENT_STUB>
<INDIRECT_IDENTIFY>0</INDIRECT_IDENTIFY>
<STATUS>1</STATUS>
<DIRECT_PHONE>0</DIRECT_PHONE>
<DIRECT_MAIL>0</DIRECT_MAIL>
<DIRECT_FAX>0</DIRECT_FAX>
</CLIENT_STUB>
<PERSONAL_DETAILS>
<TITLE>
<xsl:value-of select="$title" />
</TITLE>
<FNAME>
<xsl:value-of select="$given-name" />
</FNAME>
<MNAME>
<xsl:value-of select="$other-given-name" />
</MNAME>
<SNAME>
<xsl:value-of select="$surname" />
</SNAME>
<SUFFIX>
<xsl:value-of select="$name-suffix" />
</SUFFIX>
<DOB>
<xsl:call-template name="convert-date">
<xsl:with-param name="date" select="$birth-date" />
</xsl:call-template>
</DOB>
<SEX>
<xsl:choose>
<xsl:when test="$gender='F'">1</xsl:when>
<xsl:when test="$gender='M'">2</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</SEX>
</PERSONAL_DETAILS>
</CREATE_PERSONAL_CUSTOMER>
(Sorry about the formatting - [ code ] and [ b ] tags don't work together on this forum)