xsl-list
[Top] [All Lists]

[xsl] applying templates to attribute value

2008-06-30 12:42:37
Hi guys,

Not exactly a newbie anymore, after reading these posts for a while I have 
learned quite a lot, but I have what I feal might have a nagging beginner 
problem that I have not been able to deal with.
Perhaps it has no solution in XSL, but even knowing that would help.

Here is the problem in a nutshell, how can I applying a template to string 
content in an attributes value. My specific digital asset management 
application has HTML formatting in an attribute value that I have to transform 
into fo formating. I have the formatting templates, but I cannot seem to match 
them to the attribute value. Can anyone give me a quick hand?

Thanks in advance.


XML: ==================================

<TEAMS_ASSET_FILE>
   <METADATA>
      <UOIS>
         <GT_ASSET_REQUEST_MD COVERLETTER_TEXT="This is a 
&lt;b&gt;test&lt;/b&gt; of the line break formatting&lt;br /&gt;. Did it work?" 
/>
      </UOIS>
    </METADATA>
</TEAMS_ASSET_FILE>

XSL: ==================================

<xsl:template match="TEAMS_ASSET_FILE">
   <xsl:apply-templates 
select="./METADATA/UOIS/GT_ASSET_REQUEST_MD/@COVERLETTER_TEXT" />
</xsl:template>

<!-- formatting in the block -->
<xsl:template match="//GT_ASSET_REQUEST_MD/@COVERLETTER_TEXT">
  <xsl:apply-templates />
</xsl:template>
<xsl:template match="br">
  <fo:block> </fo:block>
</xsl:template>
<xsl:template match="b">
  <fo:inline font-weight="bold">
    <xsl:apply-templates select="*|text()"/>
  </fo:inline>
</xsl:template>

</xsl:stylesheet>





      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>