Subject: [xsl] Problems generating a link in HTML output From: "Doug Metcalfe-White" <doug_metcalfe-white@xxxxxxxxxxxx> Date: Tue, 11 Jun 2002 11:26:55 -0700 |
Hi all, I am attempting to generate HTML from an XML source. Needless to say, links will be an important part of the output. While I can generate the links, I am getting a strange formatting to the inline links. For example, my desired output is: <p>The first rule of flying is that your number of take-offs should always equal your number of <a href="landing.html">landings</a>.</p> What I am getting is: <p>The first rule of flying is that your number of take-offs should always equal your number of landings.<a href="landing.html">landings</a></p> The XML source is: <concept> <para>The first rule of flying is that your number of take-offs should always equal your number of <link href="landing.html">landings</link>.</para> </concept> The file validates, so I'm only including an example of the troublesome bit. The XSLT file looks like this: <xsl:template match="concept"> <xsl:apply-templates select="concept_title"/> <xsl:for-each select="para"> <p><xsl:value-of select="."/> <xsl:apply-templates select="link"/> </p> </xsl:for-each> <xsl:apply-templates select="list"/> <xsl:apply-templates select="table"/> </xsl:template> <!-- The following generates exactly what I want.--> <xsl:template match="link"> <a> <xsl:attribute name="href"> <xsl:value-of select="@href"/> </xsl:attribute> <xsl:value-of select="."/> </a> </xsl:template> The problem seems to be with the lines transforming the <para> element. I have tried a couple of different approaches and this one has gotten me closest to my desired output. I can't figure out how to change them to get what I want. I have only begun to scratch the surface of XSLT and XPath so it won't surprise me it the answer is found in some function I'm unfamiliar with. Your advice and ideas are greatly appreciated. I am processing the files using Instant Saxon 6.4.4. Thanks, Doug Metcalfe-White XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How do insert after a lin, Andrew Welch | Thread | [xsl] Removing Newlines, Greg Kushmerek |
Re: [xsl] XSL special chars output , Mike Brown | Date | RE: [xsl] Problems generating a lin, Dudley, Mark |
Month |