xml - Where is the extra space coming from? (XSLT) -


i'm generating hyperlinks xslt , keep getting spaces @ end of linked words.

my xml looks this:

the last word needs <url id="1">link</url>. 

the link concatenated, using @id. here's xslt:

<xsl:template match="//url">     <a href="../mainsite.html{@id}"><xsl:copy-of select="."/></a> </xsl:template> 

for reason, generates link on word 'link', adds space after it, though there no space between url tags.

if switch out xsl:copy-of plain string problem goes away. eg:

<xsl:template match="//url">     <a href="../mainsite.html{@id}">string</a> </xsl:template> 

where on earth space coming from? it's driving me mad, because link that's followed punctuation looks screwy. should looking @ track down problem?

thank can help.

<xsl:template match="//url">     <a href="../mainsite.html{@id}"><xsl:copy-of select="."/></a> </xsl:template> 

for reason, generates link on word 'link', adds space after it

the problem using:

<xsl:copy-of select="."/> 

where should using:

<xsl:value-of select="."/>  

and since stylesheet evidently set indent output, end with:

the last word needs <a href="../mainsite.html1">       <url id="1">link</url>    </a> 

the browser ignores non-html tags , renders line breaks spaces.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -