Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2003, 11:35 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Output a newline entity reference

Hi,

I want to output an entity reference (newline) in a resulting xml file

<Data>entity#10;reference</Data>

I try to output this entity reference with a special template containing:
<xsl:text disable-output-escaping>entity&amp;#10;reference</xsl:text>

But the XSL processor actually puts a new line in the output and the resulting document is:

<Data>entity
reference</Data>

How can i do ?

Thanks for your help

 
Old September 29th, 2003, 01:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, your xsl tag isn't valid XML, technically. Each attribute must be a name/value pair. You only have a name.

<xsl:text disable-output-escaping="yes">...</xsl:text>

would be the 'correct' way to do this.

Fair warning, though -- I've had problems with disable-output-escaping before. I've written stylesheets that worked great with saxon but didn't work with other xslt processors, namely the sablotron processor that ships with PHP.

Good luck, let us know if it doesn't work!

Take care,

Nik
http://www.bigaction.org/
 
Old September 30th, 2003, 02:15 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, and thanks for your reply...

I only forgot the ="yes" in my posting but i putted it in the code and it works as i explained, that is outputs a real newline character

Regards

 
Old September 30th, 2003, 12:09 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Perhaps you need to use CDATA:

<Data><![CDATA[entity#10;reference]]></Data>

That should leave everything inside of it as-is.

Peter
 
Old October 1st, 2003, 01:37 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

No...
The file i want to generate is a XML Spreadsheet file.
First Excel does not recognize CDATA sections
Second, my problème is only to generate in the output file the character sequence. In a CDATA sequence or not

Regards






Similar Threads
Thread Thread Starter Forum Replies Last Post
character entity into numeric character entity srkumar XSLT 1 November 22nd, 2007 04:53 AM
xsl:output with encoding and UPPER case entity ROCXY XSLT 1 April 19th, 2007 08:20 AM
Inserting 'NewLine' in output mphare XSLT 3 February 22nd, 2007 07:18 PM
Difference between Entity and Entity type arshad mahmood C++ Programming 0 May 8th, 2004 12:34 AM
entity references not preserved in XML Output srivalli9 J2EE 0 November 14th, 2003 05:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.