It seems that when the argument does not match any path (on disk or in the collections), its content is taken as xml :

 

  fn:doc(‘<root/>’) à <root/>

 

De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] De la part de Hans-Juergen Rennau
Envoyé : vendredi 13 décembre 2013 13:41
À : basex-talk@mailman.uni-konstanz.de
Objet : [basex-talk] fn:doc("c:/...")

 

Dear BaseX team,

 

I'm a little confused by the behavior of the fn:doc function:

 

doc('/c:/projects/foo.xml')

 

yields this error msg:

    [FODC0002] Line 1: No text allowed before root element.

 

Whereas these work:


doc('c:/projects/foo.xml')

doc('file://c:/projects/foo.xml')

 

Is this a bug or a feature? At any rate the error msg is confusing.

 

I've used the latest snapshot (20131211.173706).

 

Kind regards,

Hans-Juergen