<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-33074681.post115693307120378741..comments</id><updated>2007-11-04T14:28:05.491+01:00</updated><title type='text'>Comments on Nightly thoughts: Type-preserving copy in XSLT 2.0</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fgeorges.blogspot.com/feeds/115693307120378741/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33074681/115693307120378741/comments/default'/><link rel='alternate' type='text/html' href='http://fgeorges.blogspot.com/2006/08/type-preserving-copy-in-xslt-20.html'/><author><name>Florent Georges</name><uri>http://www.blogger.com/profile/18018229770454570703</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-33074681.post-115888719133612518</id><published>2006-09-22T03:06:00.000+02:00</published><updated>2006-09-22T03:06:00.000+02:00</updated><title type='text'>Hi Dimitre  Thanks for your comment.  I agree the ...</title><content type='html'>Hi Dimitre&lt;BR/&gt;&lt;BR/&gt;  Thanks for your comment.&lt;BR/&gt;&lt;BR/&gt;  I agree the name of f:copy-with-type-1() is not the better name I ever found for a function.  I named it in part after the ELisp &lt;I&gt;de-facto&lt;/I&gt; convention for utility routines, and in part because it is the implementation of f:copy-with-type() for a single item as argument.&lt;BR/&gt;&lt;BR/&gt;  The order of the xsl:when clauses is clearly important.  They are generated by data/func-copy-make-whens.xsl from data/xs-simple-types.xml (note the hierarchical relation between the types), and you can see the result in data/func-copy-whens.xml. I guess (I hope) this kind of relation could be infered from XML Schemas, but I didn't write such a generator yet.&lt;BR/&gt;&lt;BR/&gt;  About your second comment, I'm a little bit septic.  The first point is that the result of calling a function could be verry different if the type of the argument is not preserved.  It is more true for nodes, but it is still true for atomic items.&lt;BR/&gt;&lt;BR/&gt;  The second point is that the user will choose if he needs an exact type-preserving copy for user-defined simple types. If he doesn't, he'll just use the builtin implementation (the only one we can provide, only aware about the standard simple types).  If he does, he'll can provide a custom resolving function (maybe generated).&lt;BR/&gt;&lt;BR/&gt;  The user will can register a default resolving function, but also provide different resolving functions at several call points of f:copy-with-type(), as an additional argument.&lt;BR/&gt;&lt;BR/&gt;  But all of this still needs to be proved by an implementation...&lt;BR/&gt;&lt;BR/&gt;  Thanks a lot.  Regards,&lt;BR/&gt;&lt;BR/&gt;--drkm</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33074681/115693307120378741/comments/default/115888719133612518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33074681/115693307120378741/comments/default/115888719133612518'/><link rel='alternate' type='text/html' href='http://fgeorges.blogspot.com/2006/08/type-preserving-copy-in-xslt-20.html?showComment=1158887160000#c115888719133612518' title=''/><author><name>Florent Georges</name><uri>http://www.blogger.com/profile/18018229770454570703</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06611310841100987503'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://fgeorges.blogspot.com/2006/08/type-preserving-copy-in-xslt-20.html' ref='tag:blogger.com,1999:blog-33074681.post-115693307120378741' source='http://www.blogger.com/feeds/33074681/posts/default/115693307120378741' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-33074681.post-115887531211779762</id><published>2006-09-21T23:48:00.000+02:00</published><updated>2006-09-21T23:48:00.000+02:00</updated><title type='text'>Hi Florent,This exploration of type-preserving cop...</title><content type='html'>Hi Florent,&lt;BR/&gt;&lt;BR/&gt;This exploration of type-preserving copy is very useful.&lt;BR/&gt;&lt;BR/&gt;I have just the following comments:&lt;BR/&gt;&lt;BR/&gt;1. In the code of f:copy-with-type-1() (maybe you can think of a name that is more easy to remember?) the order of the &amp;lt;xsl:when&gt; instructions is very important.&lt;BR/&gt;&lt;BR/&gt;The only correct ordering is from more specific (derived) types to their base types.&lt;BR/&gt;&lt;BR/&gt;Any violation of this ordering will produce unwanted results, for example an xs:integer could be typed as xs:decimal.&lt;BR/&gt;&lt;BR/&gt;2. My second comment is about the user-defined simple types.&lt;BR/&gt;&lt;BR/&gt;Maybe we are paying too much attention to this problem. Instead of trying to correctly discover such user-defined types, it would be better to impose the restriction that simple-typed arguments of first-class functions must be only of the standard simple types.&lt;BR/&gt;&lt;BR/&gt;THis is not a big restriction. If a user-defined type was really required for an argument, the function code can immediately apply the necessary constructor to the standard-typed argument and thus obtain the user-defined typed value.&lt;BR/&gt;&lt;BR/&gt;THank you for your work in this area. It has been pleasure to read.&lt;BR/&gt;&lt;BR/&gt;Cheers,&lt;BR/&gt;Dimitre Novatchev</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33074681/115693307120378741/comments/default/115887531211779762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33074681/115693307120378741/comments/default/115887531211779762'/><link rel='alternate' type='text/html' href='http://fgeorges.blogspot.com/2006/08/type-preserving-copy-in-xslt-20.html?showComment=1158875280000#c115887531211779762' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://fgeorges.blogspot.com/2006/08/type-preserving-copy-in-xslt-20.html' ref='tag:blogger.com,1999:blog-33074681.post-115693307120378741' source='http://www.blogger.com/feeds/33074681/posts/default/115693307120378741' type='text/html'/></entry></feed>