[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: applying templates to attribute value

Subject: RE: applying templates to attribute value
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 30 Jun 2008 22:32:34 +0100
RE:  applying templates to attribute value
You are trying to match element nodes within the attribute, but there are no
element nodes there, there is only a string containing lexical markup that
would turn into element nodes if it were put through an XML parser. If you
want to treat this string as XML you need to parse it - you could do that in
Saxon using a call on saxon:parse(), but there is no way of doing it within
the standard.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: mark bordelon [mailto:markcbordelon@xxxxxxxxx] 
> Sent: 30 June 2008 20:41
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  applying templates to attribute value
> 
> 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>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.