473,704 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with Carriage Return in XSL 

Pia
Please help! I'm trying to get my xsl to produce 0x0D, not just 0x0A.
Any ideas on how to do this? Right now, if I try the following, my
output only shows 0x0a:

<xsl:variable name="cr" select="'&#xD;' "/>
<xsl:value-of select="$cr"/>
Thank you!
Pia
Jul 20 '05 #1
5 24744
* Pia wrote in comp.text.xml:
Please help! I'm trying to get my xsl to produce 0x0D, not just 0x0A.


There is no reliable way to do that.
Jul 20 '05 #2
Pia
Is there any way to do it at all? What did you mean by "reliable"?
That it depends on the parser? Just curious . . . .

Bjoern Hoehrmann <bj****@hoehrma nn.de> wrote in message news:<40******* *********@news. bjoern.hoehrman n.de>...
* Pia wrote in comp.text.xml:
Please help! I'm trying to get my xsl to produce 0x0D, not just 0x0A.


There is no reliable way to do that.

Jul 20 '05 #3
In article <d9************ **************@ posting.google. com>,
Pia <pi**********@Y ahoo.com> wrote:
Please help! I'm trying to get my xsl to produce 0x0D, not just 0x0A.


XML parsers convert carriage-return to linefeed when they read in a
document, so putting a carriage-return in your XML output doesn't
do much good: it will turn back into linefeed when the XML file is
used.

Why do you want to do this?

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #4

"Richard Tobin" <ri*****@cogsci .ed.ac.uk> wrote in message
news:c0******** ***@pc-news.cogsci.ed. ac.uk...
In article <d9************ **************@ posting.google. com>,
Pia <pi**********@Y ahoo.com> wrote:
Please help! I'm trying to get my xsl to produce 0x0D, not just 0x0A.


XML parsers convert carriage-return to linefeed when they read in a
document, so putting a carriage-return in your XML output doesn't
do much good: it will turn back into linefeed when the XML file is
used.

Why do you want to do this?


He may want to produce non-xml output -- e.g.:
<xsl:output method="text"/>

Mike Kay was explaining long ago that whether to produce &#xD; or not is not
mandated in the XSLT spec and is implementation dependent -- e.g. may depend
on the workings of a specific Java VM, etc.
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
Jul 20 '05 #5
Pia
I want to produce text, that's exactly right. Are you saying I might
be able to use another java vm for a different result? How?


Why do you want to do this?


He may want to produce non-xml output -- e.g.:
<xsl:output method="text"/>

Mike Kay was explaining long ago that whether to produce &#xD; or not is not
mandated in the XSLT spec and is implementation dependent -- e.g. may depend
on the workings of a specific Java VM, etc.
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
29309
by: hb | last post by:
Hi, I need to use MSXML2.DOMDocument in my ASP page. The following is my code: xml.asp: ===== <% dim sx sx="<root><a>text1</a><b>text2</b></root>" dim xd
4
9876
by: Dr. Laurence Leff | last post by:
I am writing a Java program to read in XML file, modify some elements slightly, and then write it out. That XML file is prepared in Docbook. It works fine, except that it is disturbing the carriage returns in places where they have meaning. Attached are a sample input file, the sample output file, and a simplified version of my Java program. My real file, examines certain element's attributes and adds certain elements to the DOM...
3
13418
by: CarlosRivera | last post by:
I am using apache xerces J 2.5.0. I have \r\n feed combinations in the CDATA sections that get converted to \n (or rather \r gets lost. I am using sax parsing. I can see in the buffer that is passed that when I have \n, one character back it has the \r, but the start offset is on the \n. The source is an XML string, so it did not get lost while reading the file. In any case, it seems that it should not be removing the \r in the cdata...
4
18696
by: Josh | last post by:
Hi, I'm using System.Data.DataSet.ReadXml to convert some xml from a webservice to a DataSet. The xml looks like: <?xml version="1.0" encoding="UTF-8"?><root><prioritiesTable><description>blah blah blah blah</description></prioritiesTable></root> The important thing here is the which I beleive should be a single
2
1156
by: Shailendra Batham | last post by:
hi gurus I have a asp.net web services and in that i have a function which returns XmlDocument as the return value, when I test the service it works fine and I can see the XML. When I try to call the XML from asp.net, it does not return XmlDocument and gives me this message Cannot implicitly convert type 'System.Xml.XmlNode' to 'System.Xml.XmlDocument' This is my code XmlDocument xd = new XmlDocument();
3
1264
by: Milsnips | last post by:
hi there, i am currently using the following code to generate an XML object, then save it, then read the contents of the file - but i dont wanna save it, instead read it directly after i;ve created the object.. see below: ------------------------------ Dim w As New XmlTextWriter(Server.MapPath(".") & "\suppliers.xml", System.Text.Encoding.UTF8) w.Formatting = Formatting.Indented w.WriteStartDocument()
5
1420
by: Jim | last post by:
Below is my code, I'm opening an xml file and I have a chat name node within it. By default the node has a value of "mypc" for which I'm replacing and putting in a new value. I don't know if this is the best approach but I'm trying it. I can open the stream fine and replace the text. But when I try to write the stream back, I get an error saying the file is in use by another process. Any ideas? Thanks in advance myStreamReader...
6
4425
by: rellaboyina | last post by:
Dear All, I am having some data which will be stored in XML format and this needs to be parsed using the parser module XML::Parser and XML::Parser::Expat. This data consists of some special characters like "ø, á, í, é, È, ž, ù, ý". But when I try to parse the particular record with these special characters using the method parse(), I got an error "not well-formed (invalid token)". Could anyone please help me out in solving this...
1
10704
by: sandeep kumar shah | last post by:
Hi friends, I have a problem while parsing an xml file. When the value of an attribute contains �D; it gives error but when we use &#xD; it's ok.. Could anyone plz tell me what is the difference between these two. <person name="sandeep �D; kumar"/> //cause error <person name="sandeep &#xD; kumar"/> //ok
0
8766
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8684
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4438
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3134
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.