Subject: Re: [xsl] csv to xml converter bug From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Fri, 13 Jul 2007 11:10:30 +0100 |
> <xsl:analyze-string select="concat($str, ',')" regex='(("[^"]*")+|[^,]*),'> > <xsl:matching-substring> > <xsl:sequence select='replace(regex-group(1), "^""|""$|("")""", "$1")'/> > </xsl:matching-substring> > </xsl:analyze-string>
Here you have regex='...' and select='...' ; but your HTML page shows regex="..." and select="..." ; which is invalid XML given the quotes in the regular expression.
I had copied the code out of the webpage and saxon won't compile it. I modified the quotes and all workes perfectly!
It's something to be aware of I guess when you are pretty printing XML - the transform won't know which type of quotes were used in the input...unless, possibly using a combination of the input as parsed XML and unparsed-text.
I have been meaning to update Oliver Becker's xml-verbatim.xsl to 2.0, maybe it would be feasible then... (but probably not too enjoyable to code!)
cheers andrew
-- http://andrewjwelch.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] csv to xml converter bug, iwanttokeepanon | Thread | [xsl] 5 column grid sorted by Coun, W Charlton |
RE: [xsl] > replaced by ">", <, Michael Kay | Date | Re: [xsl] > replaced by ">", <, Jethro Borsje |
Month |