[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: OT: ICFP 2001 (xsl solution?)

Subject: Re: OT: ICFP 2001 (xsl solution?)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 27 Jul 2001 18:11:44 +0100
Re:  OT: ICFP 2001 (xsl solution?)
> will 3 lines do:

having got that far i suppose I'd better finish.
a) I missed out a > so that would prepend all digits by x not just those
    in tags.
b) the rules it said to read from stdin and output to stdout


xx.sh
===========

sed  -e "1 s/^/<foo>/"  -e "$ s@\$@</foo>@" -e "s/\\([0-9]>\\)/x\\1/g" > tmp.xml
java com.icl.saxon.StyleSheet  tmp.xml  icfp.xsl


icfp.xsl
==========

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                >

<xsl:output method="xml" omit-xml-declaration="yes" indent="no"/>

<xsl:template match="foo">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>


</xsl:stylesheet>


test file xx.x
===
1

<1>xxx</1>

<b>gg</b>

<9>xxx</9>
===



bash$ cat xx.x | ./xx.sh
===
1

<x1>xxx</x1>

<b>gg</b>

<x9>xxx</x9>
===bash$ 




I suspect that unquoted & are allowed (as no entities except lt and gt)
if so need another sed rule. but that's it from me:-)


David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.