Thank you for the prompt
response.
the Unix "\n" appearing inside the comment block or
outside? Inside
-----------------------
I am running on Windows XP.
My original file comment was:
<!—\r\n
comment\r\n
à\r\n
After the file got nodes added
(so it was rewritten) through xmltask, the comment showed as:
<!—\n
comment\n
à\r\n
All the other lines have \r\n as
end-of-line
I noticed that the one causing
this, was the attribute “outputter”.
This problem happens when
outputter is unassigned or it is outputter=”default”.
After I set out outputter="simple:4"
or outputter=”simple”, the line-endings are all OK (\r\n).
BUG: the default outputter is not handling the end-of-line for
comments according to the OS.
So the following xmltask is
working now:
<xmltask
source="${tmp.dir}/ehcache-config.xml"
dest="${tmp.dir}/ehcache-config.xml" encoding="UTF-8" outputter="simple:4">
<paste
path="//cache[last()]" buffer="mergeXml"
position="after"/>
</xmltask>
From: Mark Coffin
[mailto:mcoffin-QV2pfSCQszLMohDmgNdYFA@public.gmane.org]
Sent: Friday, September 03, 2010 6:58 AM
To: Saavedra, Gisella; xmltask-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [Xmltask-users] XML comment line end-of-line
Hi Gisella,
You can probably run the fixcrlf ant task to correct this, info for 1.7 is
here: http://ant.apache.org/manual/Tasks/fixcrlf.html
Which platform did you run the Xmltask on?
Also, are the Unix "\n" appearing inside the comment block or
outside?
For example:
<! -- this is a comment \n
-->
Mark Coffin
mcoffin-QV2pfSCQszLMohDmgNdYFA@public.gmane.org
Phone: 905.632.0864
1.800.668.8486
Fax: 905.632.2605
www.aalsolutions.com
From: Saavedra, Gisella
[mailto:gsaavedra-RVXiXJpdclUAvxtiuMwx3w@public.gmane.org]
Sent: Thursday, September 02, 2010 6:46 PM
To: xmltask-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [Xmltask-users] XML comment line end-of-line
I have two XML files. I am merging data from file 2
into file 1.
In file 1, I have some comments, written in the traditional
way( <!-- comment -->)
When I execute the xmltask, any nodes inserted in my destination
file are OK, although the whole XML contents is rewritten (I could see the
non-wrapping for each node).
But the original comments get the original
“\r\n” end -of -line replaced with “\n” as
per UNIX. All the nodes I added get added with “\r\n” as the
end-of-line.
So, I get all the end of lines as “\r\n”
(Windows) but my comment lines have “\n” (UNIX)
Is this a bug?
What can I do?
Thanks,
Gisella
--------------------
Comments in XML
The syntax for writing comments
in XML is similar to that of HTML.
<!-- This is a comment -->
- CONFIDENTIAL-
This email and any files transmitted with it are confidential, and may also be
legally privileged. If you are not the intended recipient, you may not review,
use, copy, or distribute this message. If you receive this email in error,
please notify the sender immediately by reply email and then delete this email.
****** CONFIDENTIALITY NOTICE ******
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely for the
use of the addressee. If the reader of this message is not the intended
recipient, you are hereby notified that any reading, dissemination,
distribution, copying, or other use of this message or its attachments is
strictly prohibited. If you have received this message in error, please notify
the sender immediately and delete this message from your system. Thank you.