[Home] [By Thread] [By Date] [Recent Entries]
At 2008-06-30 12:41 -0700, mark bordelon wrote:
Here is the problem in a nutshell, how can I applying a template to string content in an attributes value. Attribute nodes are leaves of the tree. To act on the content you act on the node's value, unlike an element where you push the children at your stylesheet for processing. 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. You are matching the attribute value, you just aren't doing anything with it. XML: ================================== The "./" is redundant above. </xsl:template> The "//" is redundant above. <xsl:apply-templates /> That statement "pushes the children of the node" ... there are no children of the attribute node because it is a leaf in the tree and is attached to an element. As a result, there is nothing added to your result tree. You want <xsl:value-of select="."/> to add the value of the attribute to the result tree. I suspect <xsl:apply-templates/> is sufficient here as that is a synonym for <xsl:apply-templates select="child::node()"/> which is a synonym for <xsl:apply-templates select="*|text()|comment()|processing-instruction"/> I hope this helps. . . . . . . . . . . . Ken -- Upcoming XSLT/XSL-FO hands-on courses: Wellington, NZ 2009-01 World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|

Cart



