|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
I get a ton of 
 in my xslt output. Doesnt' seem to hurt anything but can anyone explain why they are there?
Thanks
Jason
|
|
 Rank: Aficionado
Joined: 7/19/2006 Posts: 174 Location: NYC
|
Those are carriage return/line feed characters.
- Mark
|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
Why are they in my output? They are right in the middle of lines....not where they would normally be found. And they're not in the source.
Jason
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 820 Location: Århus, Denmark
|
Can you give an example of the surrounding xslt? I've seen someone using this to get rid of it: Code: <xsl:value-of select="translate(ContentArea, '

	', '')" disable-output-escaping="yes" />
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 820 Location: Århus, Denmark
|
hmm... there should be some 

	 instead of the linebreaks in the code :-)
|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
yes, that is the weird part, I don't have them in the source code. It seems to be only where I use a cdata. This code: Code: <a> <xsl:attribute name="id"> <xsl:value-of select="concat($sMenuName,'link')"/> </xsl:attribute> <xsl:attribute name="class"> <![CDATA[main]]> </xsl:attribute> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(./data[@alias='menuInternalURL'])"/> </xsl:attribute> <xsl:value-of select="@nodeName"/> </a>
Outputs: Code: <a id="eventslink" class="
 main
 " href="events.aspx">EVENTS</a>
The value in cdata (<![CDATA[main]]>) is not cut-n-paste from elsewhere so I know there are no stray characters. This is just a small example, it seems anywhere I have a cdata, I get the 
 characters. There is no disable-output-escaping on a cdata . Thanks
Jason
|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
yes, that is the weird part, I don't have them in the source code. It seems to be only where I use a cdata. This code: Code: <a> <xsl:attribute name="id"> <xsl:value-of select="concat($sMenuName,'link')"/> </xsl:attribute> <xsl:attribute name="class"> <![CDATA[main]]> </xsl:attribute> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(./data[@alias='menuInternalURL'])"/> </xsl:attribute> <xsl:value-of select="@nodeName"/> </a>
Outputs: Code: <a id="eventslink" class="
 main
 " href="events.aspx">EVENTS</a>
The value in cdata (<![CDATA[main]]>) is not cut-n-paste from elsewhere so I know there are no stray characters. This is just a small example, it seems anywhere I have a cdata, I get the 
 characters. There is no disable-output-escaping on a cdata . Thanks
Jason
|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
yes, that is the weird part, I don't have them in the source code. It seems to be only where I use a cdata. This code: Code: <a> <xsl:attribute name="id"> <xsl:value-of select="concat($sMenuName,'link')"/> </xsl:attribute> <xsl:attribute name="class"> <![CDATA[main] ]> </xsl:attribute> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(./data[@alias='menuInternalURL'])"/> </xsl:attribute> <xsl:value-of select="@nodeName"/> </a>
Outputs: Code: <a id="eventslink" class="
 main
 " href="events.aspx">EVENTS</a>
The value in cdata (<![CDATA[main] ]>) is not cut-n-paste from elsewhere so I know there are no stray characters. This is just a small example, it seems anywhere I have a cdata, I get the 
 characters. There is no disable-output-escaping on a cdata . Thanks
Jason
|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
That output should look like this:
<a id="eventslink" class="
 main
 " href="events.aspx">EVENTS</a>
also, I know there shouldn't be an extra space between the ]] on a cdata but the forum editor won't let me submit with a properly formed cdata....even within the code block.
Jason
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,076 Location: Charleston, West Virginia, United States
|
I think this is the answer you are looking for... http://neehouse.com/code/xslt/cdata_string_output.aspx
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,076 Location: Charleston, West Virginia, United States
|
I re-read that and see that was not the answer. In your XSLT, remove the carriage returns from the class attribute, and see if those characters disappear. Code:<xsl:attribute name="class"><![CDATA[main] ]></xsl:attribute>
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
Rank: Aficionado
Joined: 7/19/2006 Posts: 182 Location: Pittsburgh, Pennsylvania, USA
|
That was it exactly!!! Too simple...don't I feel stoopid:blush:
Thanks
Jason
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,076 Location: Charleston, West Virginia, United States
|
Well, it is annoying that xslt sometimes includes the CRLF and sometimes does not, especially when your use to structure in your code. Glad to help..
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
|
Guest |