serialisation of line ends (saxon8 xml output method in xslt)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

serialisation of line ends (saxon8 xml output method in xslt)

David Carlisle

Is it possible to output line ends (which have been normalised
to #10 in the result tree) as #13#10 pairs (MS-DOS style) rather than
as #10 (Unix style)

It shouldn't make any difference, but try telling that that to IE....

It's not vital as I can always run something over the generated files
after running saxon but it would be nice if I could avoid that as
each run of saxon on this application generates a few thousand files and
then trawling back over the directory cleaning up line ends is likely to
take almost as long as the generation step.


David



I'm using saxon B 8.6.1 on Windows XP and

java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: serialisation of line ends (saxon8 xml output method in xslt)

David Carlisle

Just after posting, I thought of this


   <xsl:character-map name="eol">
      <xsl:output-character character="&#10;" string="&#13;&#10;"/>
   </xsl:character-map>

which seems to work (although not fully tested it yet) and it messes up
some of my xsl:message output, but I could probably avoid that by
just using the character map on specific result-document settings.

I had in mind a serialisation option more or less external to the
stylesheet, but I guess this is essentially equivalent?

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: serialisation of line ends (saxon8 xml output method in xslt)

Michael Kay
In reply to this post by David Carlisle
I'll think about making it a serialization option. It should be a lot more
efficient than using a character map.

Michael Kay

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> David Carlisle
> Sent: 06 December 2005 13:30
> To: [hidden email]
> Subject: [saxon] serialisation of line ends (saxon8 xml
> output method in xslt)
>
>
> Is it possible to output line ends (which have been normalised
> to #10 in the result tree) as #13#10 pairs (MS-DOS style) rather than
> as #10 (Unix style)
>
> It shouldn't make any difference, but try telling that that to IE....
>
> It's not vital as I can always run something over the generated files
> after running saxon but it would be nice if I could avoid that as
> each run of saxon on this application generates a few
> thousand files and
> then trawling back over the directory cleaning up line ends
> is likely to
> take almost as long as the generation step.
>
>
> David
>
>
>
> I'm using saxon B 8.6.1 on Windows XP and
>
> java version "1.5.0_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)
>
> ______________________________________________________________
> __________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ______________________________________________________________
> __________
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: serialisation of line ends (saxon8 xml output method in xslt)

David Carlisle

> I'll think about making it a serialization option. It should be a lot more
> efficient than using a character map.

Thanks, incidentally the reason why I need this is that to get mathml
(or svg or ...) to work in IE as well as mozilla/netscape etc you need
to use a MS behavio(u)r active x component referred to by an <object>.

This works fine from an http server but (as from XP SP 2) it does not work
on files read from the filesystem because of the default security
settings for the "local zone".

Typically, an arcane solution is suggested on Microsoft's help database:
you add a comment like
<!-- saved from url=(0014)about:internet -->
and it all works (One suspects that this was originally just a
workaround so cached files worked as if they were being loaded from
their original site, but now it is a "feature".)

I've been going mad trying to work out why sometimes this worked and
sometimes it doesn't, but I've now found out that the line break after
the comment has to be ^M^J (it doesn't matter about any other line
breaks in the file, including the break before the comment, but there
has to be at least that one #13 in the file:-)


Probably you think I had too many mushrooms and am making this all up but...


http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/motw.asp

see it's a feature. (It doesn't mention about the line ends though)


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: serialisation of line ends (saxon8 xml output method in xslt)

Michael Kay
>
> > I'll think about making it a serialization option. It
> should be a lot more
> > efficient than using a character map.
>

I've had a think, and decided against. It's better to use the standard
facility (character maps) rather than using an extension. A character map
containing a single character mapping shouldn't impose too much overhead.

Michael Kay
http://www.saxonica.com/




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: serialisation of line ends (saxon8 xml output method in xslt)

David Carlisle

OK thanks for letting me know, I did use the character map  I posted.
For once ths was really for the day job, not just chatting on xsl-list

rather a lot of xhtml+mathml files generated by saxon:
http://www.nag.co.uk/numeric/CL/nagdoc_cl08/xhtml/mark8.xml
or if you'd rather have html +pdf (also generated by saxon,mostly)
http://www.nag.co.uk/numeric/cl/nagdoc_cl08/html/mark8.html

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help