Re: [Xsltforms-support] Dynamic loading of instance into a model
Brought to you by:
alain-couthures
From: Grégoire C. <gco...@gm...> - 2010-04-19 09:20:24
|
Hello Dhiradj, Dhiradj Badloe a écrit : > Hello, > > I have a question about the dynamic loading of an instance into a model. > Here's in example of my code: > <xf:model id="InlineWerken"> > <xf:instance id="inlinewerken" src="vte_406207_d.xml" /> > </xf:model> > The xml file is read from a local folder. This name of the XML file > will be different every time.(based on exports from another > application). I'm looking for a solution how to dynamically load the > instance in the model. Can someone help or advise me on this? Thanks! I guess you will have to write a simple XQuery (ex: "get_latest_xml_file.xql") which would return the instance to use. Something like : let $file := doc("/db/path_to/vte_406207_d.xml") return $file Then your XForm remains with a static file : <xf:instance id="inlinewerken" src="get_latest_xml_file.xql" /> Now you only have to find how to generate the correct path for the doc() function. And since I don't know how this name is generated, I cannot help. :) Regard, Grégoire |