更改字体粗细

发布于 2025-01-07 14:51:53 字数 3839 浏览 0 评论 0原文

我对 xsl 非常陌生,有点迷失...

如果满足条件,如何简单地更改一行字段的字体粗细?该条件基于多项选择字段。我怎样才能得到正确的值?使用 contains() 方法?

你能给我举个例子吗?

提前致谢 !

编辑1。

<XmlDefinition>
            <View Name="{F8A953EA-F74C-4F70-99C2-2239531D137E}" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="Tous les mails" Url="/Dossier/Forms/Tous.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/dlicon.png">
                <Query>
                    <OrderBy>
                        <FieldRef Name="Date" Ascending="FALSE"/>
                    </OrderBy>
                </Query>
                <ViewFields>
                    <FieldRef Name="DocIcon"/>
                    <FieldRef Name="LinkFilenameNoMenu"/>
                    <FieldRef Name="Type"/>
                    <FieldRef Name="Dossier"/>
                    <FieldRef Name="Dossier_x003a_N_x00b0__x002f_Dossier"/>
                    <FieldRef Name="Date"/>
                    <FieldRef Name="EmailSender"/>
                    <FieldRef Name="EmailTo"/>
                    <FieldRef Name="EmailCc"/>
                    <FieldRef Name="FileSizeDisplay"/>
                    <FieldRef Name="CaThermique"/>
                    <FieldRef Name="etat_ca_chauffage"/>
                    <FieldRef Name="CaElectricite"/>
                    <FieldRef Name="etat_ca_electricite"/>
                    <FieldRef Name="Notifie_a"/>
                    <FieldRef Name="Created"/>
                    <FieldRef Name="Author"/>
                    <FieldRef Name="Dossier_x003a_lien_dossier"/>
                    <FieldRef Name="EmailSubject"/>
                </ViewFields>
                <RowLimit Paged="TRUE">30</RowLimit>
                <Aggregations Value="Off"/>
                <ViewStyle ID="17"/>
                <Toolbar Type="Standard"/>
            </View>
        </XmlDefinition>

编辑2。

<xsl:template match="FieldRef[@Name='LinkFilenameNoMenu']" name="LinkFilenameNoMenu.LinkFilenameNoMenu" mode="Computed_LinkFilename_body" ddwrt:tag="a" ddwrt:dvt_mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
      <xsl:param name="thisNode" select="."/>
      <xsl:param name="ShowAccessibleIcon" select="0"/>
      <xsl:param name="folderUrlAdditionalQueryString"/>
      <xsl:param name="IncludeOnClick" select="1"/>
      <div class="ligneBellucci">
      <a onfocus="OnLink(this)" href="{$thisNode/@FileRef}" onmousedown="return VerifyHref(this,event,'{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@serverurl.progid}')"
           onclick="return DispEx(this,event,'TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}')">
          <xsl:value-of disable-output-escaping="yes" select="$thisNode/@EmailSubject" />               
    </a>
      </div> 
       <xsl:if test="$thisNode/@Created_x0020_Date.ifnew='1'">
        <xsl:call-template name="NewGif.LinkFilenameNoMenu">
          <xsl:with-param name="thisNode" select="$thisNode"/>
      </xsl:call-template>          
      </xsl:if>

基本上,如果“etat_ca_chauffage”等于某个值,则所有字段都应以粗体显示...

I'm very very new to xsl and a bit lost...

How can I simply change the font weight of a line of fields if a condition is met? The condition is based on a multiple choice field. How can I get the proper value? With the contains() method?

Could you give me examples?

Thanks in advance !

Edit 1.

<XmlDefinition>
            <View Name="{F8A953EA-F74C-4F70-99C2-2239531D137E}" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="Tous les mails" Url="/Dossier/Forms/Tous.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/dlicon.png">
                <Query>
                    <OrderBy>
                        <FieldRef Name="Date" Ascending="FALSE"/>
                    </OrderBy>
                </Query>
                <ViewFields>
                    <FieldRef Name="DocIcon"/>
                    <FieldRef Name="LinkFilenameNoMenu"/>
                    <FieldRef Name="Type"/>
                    <FieldRef Name="Dossier"/>
                    <FieldRef Name="Dossier_x003a_N_x00b0__x002f_Dossier"/>
                    <FieldRef Name="Date"/>
                    <FieldRef Name="EmailSender"/>
                    <FieldRef Name="EmailTo"/>
                    <FieldRef Name="EmailCc"/>
                    <FieldRef Name="FileSizeDisplay"/>
                    <FieldRef Name="CaThermique"/>
                    <FieldRef Name="etat_ca_chauffage"/>
                    <FieldRef Name="CaElectricite"/>
                    <FieldRef Name="etat_ca_electricite"/>
                    <FieldRef Name="Notifie_a"/>
                    <FieldRef Name="Created"/>
                    <FieldRef Name="Author"/>
                    <FieldRef Name="Dossier_x003a_lien_dossier"/>
                    <FieldRef Name="EmailSubject"/>
                </ViewFields>
                <RowLimit Paged="TRUE">30</RowLimit>
                <Aggregations Value="Off"/>
                <ViewStyle ID="17"/>
                <Toolbar Type="Standard"/>
            </View>
        </XmlDefinition>

Edit 2.

<xsl:template match="FieldRef[@Name='LinkFilenameNoMenu']" name="LinkFilenameNoMenu.LinkFilenameNoMenu" mode="Computed_LinkFilename_body" ddwrt:tag="a" ddwrt:dvt_mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
      <xsl:param name="thisNode" select="."/>
      <xsl:param name="ShowAccessibleIcon" select="0"/>
      <xsl:param name="folderUrlAdditionalQueryString"/>
      <xsl:param name="IncludeOnClick" select="1"/>
      <div class="ligneBellucci">
      <a onfocus="OnLink(this)" href="{$thisNode/@FileRef}" onmousedown="return VerifyHref(this,event,'{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@serverurl.progid}')"
           onclick="return DispEx(this,event,'TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}')">
          <xsl:value-of disable-output-escaping="yes" select="$thisNode/@EmailSubject" />               
    </a>
      </div> 
       <xsl:if test="$thisNode/@Created_x0020_Date.ifnew='1'">
        <xsl:call-template name="NewGif.LinkFilenameNoMenu">
          <xsl:with-param name="thisNode" select="$thisNode"/>
      </xsl:call-template>          
      </xsl:if>

Basically if "etat_ca_chauffage" equals a certain value, all the fields should be in bold...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

永不分离 2025-01-14 14:51:53

例如

<xsl:template match="**YOUR CONDITION GOES HERE **">
    <xsl:apply-templates select="@*"/>
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    <xsl:apply-templates select="*"/>
</xsl:template>

<xsl:template match="@* | node()">
    <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
</xsl:template>

E.g.

<xsl:template match="**YOUR CONDITION GOES HERE **">
    <xsl:apply-templates select="@*"/>
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    <xsl:apply-templates select="*"/>
</xsl:template>

<xsl:template match="@* | node()">
    <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
</xsl:template>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文