[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: String manipulations with quotes
Hi again Betty,
At 06:21 PM 4/10/2003, you wrote: I don't have control over the authoring. The quotes are already embedded in the file. If the XML file has <text>"Oh foo!" said Tonya, as she looked at her list of warnings.</text> and you say <xsl:template match="text"> <xsl:value-of select="translate(.,'"','#')"/> </xsl:template> you should get #Oh foo!# said Tonya, as she looked at her list of warnings. (But note you can't say translate(.,'"','''), since once it is parsed the stylesheet processor still chokes on translate(.,'"',''') -- in a case like that you have to resort to binding the problem character to a variable.) The entity is so the *stylesheet* can be parsed; it still represents the character literal it represents. But in your case I'd simply try: <xsl:variable name="name1"> <xsl:value-of select="substring-after($definition, '"')"/> </xsl:variable> <xsl:variable name="name2"> <xsl:value-of select="substring-before($name1, '"')"/> </xsl:variable> The parser reports the values of the select attributes as, e.g. substring-after($definition, '"') which should be fine. Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|