What's the default directory for the file-serializer?
I have a xpl file located in C:\eclipse-workspace\orbeon\WEB-INF\resources\ddi\user but I have to use a fullpath to write to the underlying data folder <config> <directory>C:\eclipse-workspace\orbeon\WEB-INF\resources\ddi\user\data</directory> <file>user_<xsl:value-of select="/user/username"/>.xml</file> <content-type>text/xml</content-type> </config> The following always give me a error like: "Directory 'data' is not a directory or is not writeable." <directory>data</directory> <directory>./data</directory> <directory>oxf:ddi/user/data</directory> Note that oxf:ddi/user/data works fine with the directory scanner. thanks *P -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Pascal,
Not sure where the default directory is on Windows (on Mac and I assume other unix platforms it is the user's home directory), but you can just leave the directory empty and then search for the serialized file. The issue with serializer not being able to use the "oxf:" protocol-specified directories was recently discussed here. I sure could use that functionality as well. A. On Mar 11, 2006, at 11:23 AM, Pascal Heus wrote: > What's the default directory for the file-serializer? > I have a xpl file located in > C:\eclipse-workspace\orbeon\WEB-INF\resources\ddi\user but I have to > use > a fullpath to write to the underlying data folder > <config> > > <directory>C:\eclipse-workspace\orbeon\WEB- > INF\resources\ddi\user\data</directory> > <file>user_<xsl:value-of select="/user/username"/>.xml</file> > <content-type>text/xml</content-type> > </config> > > The following always give me a error like: "Directory 'data' is not a > directory or is not writeable." > <directory>data</directory> > <directory>./data</directory> > <directory>oxf:ddi/user/data</directory> > > Note that oxf:ddi/user/data works fine with the directory scanner. > > thanks > *P > > > > > -- > You receive this message as a subscriber of the > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Actually, I think there is a workaround for this problem.
First use a directory scanner with <base-directory>oxf:/ddi/user/data</base-directory> and then pick the full system path in the resulting /directory/@path attribute Will test this later... *P Alexander Zatko wrote: Pascal, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Alexander Žaťko
Alex:
Below example code for using oxf: with the file-serializer Hope it will have direct directly supported. </p> <!-- 1. get the directory full path --> <p:processor name="oxf:directory-scanner"> <p:input name="config"> <config> <!-- *** this is the directory for which you need the full pathname *** --> <base-directory>oxf:/ddi/user/data</base-directory> <include>dummy.txt</include> </config> </p:input> <p:output name="data" id="directory"/> </p:processor> <!-- 2. build file serializer config --> <p:processor name="oxf:xslt"> <p:input name="data" href="#directory"/> <p:input name="config"> <xsl:stylesheet version="2.0"> <xsl:template match="/"> <config> <!-- *** use the full path from the directory-scanner *** --> <directory><xsl:value-of select="/directory/@path"/></directory> <file>myfile.xml</file> <content-type>text/xml</content-type> </config> </xsl:template> </xsl:stylesheet> </p:input> <p:output name="data" id="serializer-config"/> </p:processor> <!-- 3. Format the file for serializer --> <p:processor name="oxf:xml-converter"> <p:input name="config"> <config> <encoding>utf-8</encoding> </config> </p:input> <p:input name="data" href="#source"/> <p:output name="data" id="file"/> </p:processor> <!-- 4. serialize the file --> <p:processor name="oxf:file-serializer"> <p:input name="config" href="#serializer-config"/> <p:input name="data" href="#file"/> </p:processor> Alexander Zatko wrote: Pascal, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Cool. This can be placed into an xpl file that can be called from any
other xpl file using the pipeline processor in order to avoid repeating this processor collection where the enhanced serializer functionality is needed. Thanks A. On Mar 12, 2006, at 8:52 AM, Pascal Heus wrote: > Alex: > Below example code for using oxf: with the file-serializer > Hope it will have direct directly supported. > </p> > > <!-- 1. get the directory full path --> > <p:processor name="oxf:directory-scanner"> > <p:input name="config"> > <config> > <!-- *** this is the directory for which you need the > full pathname *** --> > <base-directory>oxf:/ddi/user/data</base-directory> > <include>dummy.txt</include> > </config> > </p:input> > <p:output name="data" id="directory"/> > </p:processor> > > <!-- 2. build file serializer config --> > <p:processor name="oxf:xslt"> > <p:input name="data" href="#directory"/> > <p:input name="config"> > <xsl:stylesheet version="2.0"> > <xsl:template match="/"> > <config> > <!-- *** use the full path from the directory-scanner > *** --> > <directory><xsl:value-of > select="/directory/@path"/></directory> > <file>myfile.xml</file> > <content-type>text/xml</content-type> > </config> > </xsl:template> > </xsl:stylesheet> > </p:input> > <p:output name="data" id="serializer-config"/> > </p:processor> > > <!-- 3. Format the file for serializer --> > <p:processor name="oxf:xml-converter"> > <p:input name="config"> > <config> > <encoding>utf-8</encoding> > </config> > </p:input> > <p:input name="data" href="#source"/> > <p:output name="data" id="file"/> > </p:processor> > > <!-- 4. serialize the file --> > <p:processor name="oxf:file-serializer"> > <p:input name="config" href="#serializer-config"/> > <p:input name="data" href="#file"/> > </p:processor> > > > Alexander Zatko wrote:Pascal, >> >> Not sure where the default directory is on Windows (on Mac and I >> assume other unix platforms it is the user's home directory), but you >> can just leave the directory empty and then search for the serialized >> file. >> >> The issue with serializer not being able to use the "oxf:" >> protocol-specified directories was recently discussed here. I sure >> could use that functionality as well. >> >> A. >> >> >> On Mar 11, 2006, at 11:23 AM, Pascal Heus wrote: >> >>> What's the default directory for the file-serializer? >>> I have a xpl file located in >>> C:\eclipse-workspace\orbeon\WEB-INF\resources\ddi\user but I have >>> to use >>> a fullpath to write to the underlying data folder >>> <config> >>> >>> >>> <directory>C:\eclipse-workspace\orbeon\WEB- >>> INF\resources\ddi\user\data</directory> >>> <file>user_<xsl:value-of select="/user/username"/>.xml</file> >>> <content-type>text/xml</content-type> >>> </config> >>> >>> The following always give me a error like: "Directory 'data' is not >>> a >>> directory or is not writeable." >>> <directory>data</directory> >>> <directory>./data</directory> >>> <directory>oxf:ddi/user/data</directory> >>> >>> Note that oxf:ddi/user/data works fine with the directory scanner. >>> >>> thanks >>> *P >>> >>> >>> >>> >>> -- >>> You receive this message as a subscriber of the >>> [hidden email] mailing list. >>> To unsubscribe: mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> ObjectWeb mailing lists service home page: >>> http://www.objectweb.org/wws >> >> >> >> >> -- >> You receive this message as a subscriber of the >> [hidden email] mailing list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> ObjectWeb mailing lists service home page: >> http://www.objectweb.org/wws >> > > > -- > You receive this message as a subscriber of the > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |