From: Adam R. <ad...@ex...> - 2009-10-13 21:21:28
|
If I may offer my thoughts - xmldb:document() is a bad thing! For many reasonse - 1) It has often been confusing in the past for users to choose whether to use doc() or document() - hence its deprecation. Many chose document() by accident because of its more logical name! 2) Its name implies that it might be like the document() function in XSLT, however it is not. 3) Its not portable. 4) I believe that we should provide the tools to build applications and not the entire kitchen sink - this applies to XQuery functions as well. Similarly, it really saddens me when you see many variants of a singular named function that takes various combinations of different args when just one or two functions would do. If you need a function like xmldb:document() may I recommend the following - declare function local:documents($document-uris as xs:string+) { for $document-uri in $document-uris return doc($document-uri) }; So I would suggest that the xmldb:document() function has been recently deprecated for several good reasons, and I have yet to see a good argument for changing that... 2009/10/13 Loren Cahlander <lor...@gm...> > I just finished having a chat with Thomas and discovered the following: > In MarkLogic, they deviated from the XQuery spec for the fn:doc() function > and it operates as if it were xmldb:document(). > > > http://developer.marklogic.com/pubs/4.1/apidocs/SequenceBuiltins.html#fn:doc > > > I am now suggesting that we do the following: > > 1. Undeprecate xmldb:document() for the 1.4 release > 2. Lobby for the XQuery spec for fn:doc() to be altered to match the > functionality of xmldb:document() and to match how MarkLogic is treating the > function. > 1. http://www.w3.org/TR/xpath-functions/#func-doc > 3. If we are successful in changing the spec, > 1. Change fn:doc() to match the new spec > 2. mark xmldb:document() as deprecated for the 1.5/1.6 release and > remove it in 1.7/1.8 release > > > Loren Cahlander > Enterprise Architect > Syntactica <http://www.syntactica.com/> > > On Oct 13, 2009, at 10:07 AM, Loren Cahlander wrote: > > Here is the function documentation for the deprecated xmldb:document() > and fn:doc() > > xmldb:document() can return multiple documents with a single call and > fn:doc() can only return one document at a time. I do see Thomas' point. > Should we undeprecate xmldb:document()? > > xmldb > ------------------------------ > http://exist-db.org/xquery/xmldb > A module for database manipulation functions. > document > ------------------------------ > xmldb:document($document-uris as xs:string+, ...) *node()** > Returns the documents $document-uris in the input sequence. Collection > URIs can be specified either as a simple collection path or an XMLDB URI.If > the input sequence is empty, the function will load all documents in the > database. > $document-uris The document URIs > ------------------------------ > Returns the documents > ------------------------------ > Deprecated: See the standard fn:doc() function This function could be > removed at anytime during the 1.5 development and will be removed in the 1.6 > release. > ------------------------------ > http://www.w3.org/2005/xpath-functions > A module with the XQuery/XPath Core Library Functions > doc > ------------------------------ > doc($document-uri as xs:string?)* node()?* > Returns the document node of $document-uri. Resource URIs can be > specified either as a simple collection path, an XMLDB URI or any URI. > $document-uri The document URI > ------------------------------ > Returns the document node of $document-uri > > On Oct 13, 2009, at 09:40 AM, Adam Retter wrote: > > Perhaps you can explain what are you trying to do? and we can explain > a simple way of doing it with the other function(s)... > > > 2009/10/13 Thomas White <tho...@gm...>: > > I am trying to understand the reasons for making xmldb:document depreciated > > and candidate to be removed in 1.6 release. > > xmldb:document is a very convenient method to load multiple documents with > a > > single command. Why remove something that is good and saves lines of code? > > > Any comments? > > > Regards, > > Thomas > > > > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > > is the only developer event you need to attend this year. Jumpstart your > > developing skills, take BlackBerry mobile applications to market and stay > > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference > > _______________________________________________ > > Exist-open mailing list > > Exi...@li... > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > > > > -- > Adam Retter > > eXist Developer > { United Kingdom } > ad...@ex... > irc://irc.freenode.net/existdb > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > > > > -- Adam Retter eXist Developer { United Kingdom } ad...@ex... irc://irc.freenode.net/existdb |