Subject: [xsl] difficulty using xsl:analyze-string From: "Mukul Gandhi gandhi.mukul@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 18 Jul 2018 05:33:53 -0000 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] [ANN] Balisage 2018 Program u, Tommie Usdin btusdin | Thread | Re: [xsl] difficulty using xsl:anal, Liam R. E. Quin liam |
[xsl] [ANN] Balisage 2018 Program u, Tommie Usdin btusdin | Date | Re: [xsl] difficulty using xsl:anal, Liam R. E. Quin liam |
Month |