[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] difficulty using xsl:analyze-string
Hi all, I'm trying to run a small XSLT 2.0 stylesheet, using Saxon-EE 9.7.0.19 embedded in Oxygen XML Editor. I'm having some difficulty using the xsl:analyze-string instruction. My current XSLT 2.0 transform is, <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="html"/> <xsl:template match="/"> <html> <head> <title>test</title> </head> <body> <xsl:analyze-string select="'hello world\nexperimenting with XSLT\nhow are you'" regex="\n"> <xsl:matching-substring> <br/> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="."/> </xsl:non-matching-substring> </xsl:analyze-string> </body> </html> </xsl:template> </xsl:stylesheet> The above XSLT transform doesn't take any other XML input. I'm current having the above XSLT stylesheet as an input XML (which is a dummy XML input) to the transform. As you can see, the xsl:analyze-string's select attribute has a hard-coded string. I'm expecting an output like following, from the transform, <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>test</title> </head> <body>hello world<br/>experimenting with XSLT<br/>how are you</body> </html> (i.e \n replaced with <br/>) But instead I'm getting following output, <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>test</title> </head> <body>hello world\nexperimenting with XSLT\nhow are you</body> </html> (the input string is not broken as per the semantics of xsl:analyze-string) Any help to resolve this would be great. -- Regards, Mukul Gandhi
|
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
|