Hi all,
I am trying to use XUpdate to save a new entry in an XML file, I am using a pipeline, which has an input #instance passing the new entry to save. The XU processor is the first to be called inserting the new entry, the output is converted to XML ready and then sent to the file serializer. My problem is that the file serializer leaves the xml file empty even though the input has all the correct data on debug. I have a similar delete pipeline with the same problem. I have tried this in XSLT and it works fine, but requires two processors rather than the one for XU so I'd rather stick with XU if possible, any ideas? [code snippet below] Also does anyone know if its possible to use the oxf: protocal for directory listings? as the directory I'm currently using won't be the same on the server, if not what would be the simplist way to achieve this? Thanks Ryan <!-- Use XU to add new query --> <p:processor name="oxf:xupdate"> <p:input name="other" href="#instance"/> <p:input name="data" href="oxf:xqry.xml"/> <p:input name="config"> <xu:modifications> <xu:insert-before select="/X/xquery[1]"> <xu:element name="xquery"> <queryString><xu:value-of select="document('input:other')/instance/currentXQuery"/></queryString> <createdDate><!--xu:value-of select="current-date-Time()"/--></createdDate> <name><xu:value-of select="document('input:other')/instance/query"/></name> </xu:element> </xu:insert-before> </xu:modifications> </p:input> <p:output name="data" id="save-output" debug="SAVEOUTPUT"/> </p:processor> <p:processor name="oxf:xml-converter"> <p:input name="config"> <config> <encoding>utf-8</encoding> </config> </p:input> <p:input name="data" href="#save-output"/> <p:output name="data" id="converted-output"/> </p:processor> <p:processor name="oxf:file-serializer"> <p:input name="config"> <config> <file>xqry.xml</file> <directory>C:\Documents and Settings\rpuddephatt\My Documents\workspace\ops-peaUtilities\WEB-INF\resources\pages\doXQuery</directory> </config> </p:input> <p:input name="data" href="#converted-output" debug="TEST"/> </p:processor> -- 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 |
Administrator
|
On 11/2/05, Ryan Puddephatt <[hidden email]> wrote:
> Hi all, > I am trying to use XUpdate to save a new entry in an XML file, I am > using a pipeline, which has an input #instance passing the new entry to > save. The XU processor is the first to be called inserting the new > entry, the output is converted to XML ready and then sent to the file > serializer. My problem is that the file serializer leaves the xml file > empty even though the input has all the correct data on debug. I have a > similar delete pipeline with the same problem. I have tried this in XSLT > and it works fine, but requires two processors rather than the one for > XU so I'd rather stick with XU if possible, any ideas? [code snippet below] If it works with XSLT it should just work with XUpdate. Can you attach to your reply the instance data and xqry.xml so I can try to reproduce the problem locally? > Also does anyone know if its possible to use the oxf: protocal for > directory listings? as the directory I'm currently using won't be the > same on the server, if not what would be the simplist way to achieve this? With the directory scanner you can use an oxf: URL. There is more in the directory scanner documentation at the URL below: http://www.orbeon.com/ops/doc/processors-directory-scanner Alex -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Administrator
|
In reply to this post by Ryan Puddephatt
Rayan,
> <p:input name="data" href="oxf:xqry.xml"/> Just a quick note: here you can use just href="xqry.xhtml" instead of href="oxf:xqry.xhtml". If you don't specify a protocol and the path is relative, it will be relative to the location of the current file, in this case your XPL file.a Alex On 11/2/05, Ryan Puddephatt <[hidden email]> wrote: > Hi all, > I am trying to use XUpdate to save a new entry in an XML file, I am > using a pipeline, which has an input #instance passing the new entry to > save. The XU processor is the first to be called inserting the new > entry, the output is converted to XML ready and then sent to the file > serializer. My problem is that the file serializer leaves the xml file > empty even though the input has all the correct data on debug. I have a > similar delete pipeline with the same problem. I have tried this in XSLT > and it works fine, but requires two processors rather than the one for > XU so I'd rather stick with XU if possible, any ideas? [code snippet below] > > Also does anyone know if its possible to use the oxf: protocal for > directory listings? as the directory I'm currently using won't be the > same on the server, if not what would be the simplist way to achieve this? > > Thanks > > Ryan > > <!-- Use XU to add new query --> > <p:processor name="oxf:xupdate"> > <p:input name="other" href="#instance"/> > <p:input name="data" href="oxf:xqry.xml"/> > <p:input name="config"> > <xu:modifications> > <xu:insert-before select="/X/xquery[1]"> > <xu:element name="xquery"> > <queryString><xu:value-of > select="document('input:other')/instance/currentXQuery"/></queryString> > <createdDate><!--xu:value-of > select="current-date-Time()"/--></createdDate> > <name><xu:value-of > select="document('input:other')/instance/query"/></name> > </xu:element> > </xu:insert-before> > </xu:modifications> > </p:input> > <p:output name="data" id="save-output" debug="SAVEOUTPUT"/> > </p:processor> > > <p:processor name="oxf:xml-converter"> > <p:input name="config"> > <config> > <encoding>utf-8</encoding> > </config> > </p:input> > <p:input name="data" href="#save-output"/> > <p:output name="data" id="converted-output"/> > </p:processor> > > <p:processor name="oxf:file-serializer"> > <p:input name="config"> > <config> > <file>xqry.xml</file> > <directory>C:\Documents and Settings\rpuddephatt\My > Documents\workspace\ops-peaUtilities\WEB-INF\resources\pages\doXQuery</directory> > </config> > </p:input> > <p:input name="data" href="#converted-output" debug="TEST"/> > </p:processor> > > > > > > -- > 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 > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
The instance data is as follows: <instance> <name> <select>2</select> </name> <select>1</select> <currentXQuery>for $q in input()/financialHierarchy where tf:getInoId($q) = 2 return $q</currentXQuery> <queryname>Test Name</queryname> <querydescription>Test Description</querydescription> <input/> <html-output>html</html-output> <formatted-output>general</formatted-output> </instance> I have also included the XML file Thanks Ryan Puddephatt Web Developer TFX Group 1 Michaelson Square Livingston West Lothian Scotand EH54 7DP * [hidden email] ( 01506 407 110 7 01506 407 108 -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet Sent: 03 November 2005 04:12 To: [hidden email] Subject: Re: [ops-users] XUpdate and File Serializer Rayan, > <p:input name="data" href="oxf:xqry.xml"/> Just a quick note: here you can use just href="xqry.xhtml" instead of href="oxf:xqry.xhtml". If you don't specify a protocol and the path is relative, it will be relative to the location of the current file, in this case your XPL file.a Alex On 11/2/05, Ryan Puddephatt <[hidden email]> wrote: > Hi all, > I am trying to use XUpdate to save a new entry in an XML file, I am > using a pipeline, which has an input #instance passing the new entry to > save. The XU processor is the first to be called inserting the new > entry, the output is converted to XML ready and then sent to the file > serializer. My problem is that the file serializer leaves the xml file > empty even though the input has all the correct data on debug. I have a > similar delete pipeline with the same problem. I have tried this in XSLT > and it works fine, but requires two processors rather than the one for > XU so I'd rather stick with XU if possible, any ideas? [code snippet > > Also does anyone know if its possible to use the oxf: protocal for > directory listings? as the directory I'm currently using won't be the > same on the server, if not what would be the simplist way to achieve this? > > Thanks > > Ryan > > <!-- Use XU to add new query --> > <p:processor name="oxf:xupdate"> > <p:input name="other" href="#instance"/> > <p:input name="data" href="oxf:xqry.xml"/> > <p:input name="config"> > <xu:modifications> > <xu:insert-before select="/X/xquery[1]"> > <xu:element name="xquery"> > <queryString><xu:value-of > select="document('input:other')/instance/currentXQuery"/></queryString> > <createdDate><!--xu:value-of > select="current-date-Time()"/--></createdDate> > <name><xu:value-of > select="document('input:other')/instance/query"/></name> > </xu:element> > </xu:insert-before> > </xu:modifications> > </p:input> > <p:output name="data" id="save-output" debug="SAVEOUTPUT"/> > </p:processor> > > <p:processor name="oxf:xml-converter"> > <p:input name="config"> > <config> > <encoding>utf-8</encoding> > </config> > </p:input> > <p:input name="data" href="#save-output"/> > <p:output name="data" id="converted-output"/> > </p:processor> > > <p:processor name="oxf:file-serializer"> > <p:input name="config"> > <config> > <file>xqry.xml</file> > <directory>C:\Documents and Settings\rpuddephatt\My > > </config> > </p:input> > <p:input name="data" href="#converted-output" debug="TEST"/> > </p:processor> > > > > > > -- > You receive this message as a subscriber of the [hidden email] > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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 xqry.xml (3K) Download Attachment |
In reply to this post by Alessandro Vernet
>> Also does anyone know if its possible to use the oxf: protocal for
>> directory listings? as the directory I'm currently using won't be the >> same on the server, if not what would be the simplist way to achieve >>this? >With the directory scanner you can use an oxf: URL. There is more in >the directory scanner documentation at the URL below: Sorry I didn't explain myself. I'm using the file-serializer to save the XML file, but I have to specify the full directory where the file is located, this is different on all the servers and on our local machines. With the <directory> element of the config is there anyway to use the oxf protocol or anything similar to request a relative path? Thanks Ryan Puddephatt Web Developer TFX Group 1 Michaelson Square Livingston West Lothian Scotand EH54 7DP * [hidden email] ( 01506 407 110 7 01506 407 108 -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet Sent: 03 November 2005 04:04 To: [hidden email] Subject: Re: [ops-users] XUpdate and File Serializer On 11/2/05, Ryan Puddephatt <[hidden email]> wrote: > Hi all, > I am trying to use XUpdate to save a new entry in an XML file, I am > using a pipeline, which has an input #instance passing the new entry to > save. The XU processor is the first to be called inserting the new > entry, the output is converted to XML ready and then sent to the file > serializer. My problem is that the file serializer leaves the xml file > empty even though the input has all the correct data on debug. I have a > similar delete pipeline with the same problem. I have tried this in XSLT > and it works fine, but requires two processors rather than the one for > XU so I'd rather stick with XU if possible, any ideas? [code snippet Hi Ryan, If it works with XSLT it should just work with XUpdate. Can you attach to your reply the instance data and xqry.xml so I can try to reproduce the problem locally? > Also does anyone know if its possible to use the oxf: protocal for > directory listings? as the directory I'm currently using won't be the > same on the server, if not what would be the simplist way to achieve this? With the directory scanner you can use an oxf: URL. There is more in the directory scanner documentation at the URL below: http://www.orbeon.com/ops/doc/processors-directory-scanner Alex -- 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 |
Administrator
|
Ryan Puddephatt wrote:
>>>Also does anyone know if its possible to use the oxf: protocal for >>>directory listings? as the directory I'm currently using won't be the >>>same on the server, if not what would be the simplist way to achieve >>>this? > > >>With the directory scanner you can use an oxf: URL. There is more in >>the directory scanner documentation at the URL below: > > > Sorry I didn't explain myself. I'm using the file-serializer to save the XML > file, but I have to specify the full directory where the file is located, > this is different on all the servers and on our local machines. With the > <directory> element of the config is there anyway to use the oxf protocol or > anything similar to request a relative path? Java File() object with the content of the <directory> element. So you can use a relative path I think, but it's going to be relative to your VM's current working directly, which won't make much sense. In theory, it would be possible to make it so that you can specify a path relative to the root of your resources, if and only if the resource manager eventually maps to files on disk (resource managers do not necessarily do so, for example your resources may be stored in a relational database!). -Erik -- 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 Ryan Puddephatt
Hello Ryan,
Our system is very file-based and I have also lamented the lack of an ability to have a "myf:" protocol as well as the oxf:, and our environment is much more dynamic that yours since we want to do this on every request. What I have found, and gotten working, though is * there is the concept of current directory, so you can make relative paths to it * your files can be anywhere (your java files need (best) to be inside the war, but your x... files can be anywhere - your deployment just won't be so simple) So you can take concepts like * put your preferred root/path in an xml (parameter) file and load it * create a usable path with a combination of processors (xslt, url-generator) * if necessary store it in a session or request, but more useful might be... * execute a pfc or xpl on this path, which then establishes it as your current path * and from there you can do what you want (using relative paths - yes, risky, easy to make a mistake or break in a future application reorganization, but like I say, working) * and you still have oxf: to refer back to standard files like the epilogue Hope that helps (and no one tells me a future change to the code will break it ;-) Colin On Nov 3, 2005, at 5:45 AM, Ryan Puddephatt wrote: >>> Also does anyone know if its possible to use the oxf: protocal for >>> directory listings? as the directory I'm currently using won't be the >>> same on the server, if not what would be the simplist way to achieve >>> this? > >> With the directory scanner you can use an oxf: URL. There is more in >> the directory scanner documentation at the URL below: > > Sorry I didn't explain myself. I'm using the file-serializer to save > the XML > file, but I have to specify the full directory where the file is > located, > this is different on all the servers and on our local machines. With > the > <directory> element of the config is there anyway to use the oxf > protocol or > anything similar to request a relative path? > > Thanks > > > Ryan Puddephatt > Web Developer > TFX Group > 1 Michaelson Square > Livingston > West Lothian > Scotand > EH54 7DP > > * [hidden email] > ( 01506 407 110 > 7 01506 407 108 > > > -----Original Message----- > From: [hidden email] [mailto:[hidden email]] On Behalf Of > Alessandro > Vernet > Sent: 03 November 2005 04:04 > To: [hidden email] > Subject: Re: [ops-users] XUpdate and File Serializer > > On 11/2/05, Ryan Puddephatt <[hidden email]> wrote: >> Hi all, >> I am trying to use XUpdate to save a new entry in an XML file, I >> am >> using a pipeline, which has an input #instance passing the new entry >> to >> save. The XU processor is the first to be called inserting the new >> entry, the output is converted to XML ready and then sent to the file >> serializer. My problem is that the file serializer leaves the xml file >> empty even though the input has all the correct data on debug. I have >> a >> similar delete pipeline with the same problem. I have tried this in >> XSLT >> and it works fine, but requires two processors rather than the one for >> XU so I'd rather stick with XU if possible, any ideas? [code snippet > below] > > Hi Ryan, > > If it works with XSLT it should just work with XUpdate. Can you attach > to your reply the instance data and xqry.xml so I can try to reproduce > the problem locally? > >> Also does anyone know if its possible to use the oxf: protocal for >> directory listings? as the directory I'm currently using won't be the >> same on the server, if not what would be the simplist way to achieve >> this? > > With the directory scanner you can use an oxf: URL. There is more in > the directory scanner documentation at the URL below: > > http://www.orbeon.com/ops/doc/processors-directory-scanner > > Alex > > > > > -- > 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 |
Administrator
|
In reply to this post by Ryan Puddephatt
Hi Ryan,
I see that the input of your XUpdate is xqry.xml and that you are serializing data in the same file. The fact that XPL is a pipelining language means that multiple operations in the pipeline can potentially be executed in parallel. So it might be the case that the XUpdate is still reading from the xqry.xml when data arrives to the file serializer which is trying to write in the same file. Can you use a different file name for serialization and see if you still have this problem? Alex On 11/3/05, Ryan Puddephatt <[hidden email]> wrote: > Hi Alex, > > The instance data is as follows: > > <instance> > <name> > <select>2</select> > </name> > <select>1</select> > <currentXQuery>for $q in input()/financialHierarchy where > tf:getInoId($q) = 2 return $q</currentXQuery> > <queryname>Test Name</queryname> > <querydescription>Test Description</querydescription> > <input/> > <html-output>html</html-output> > <formatted-output>general</formatted-output> > </instance> > > I have also included the XML file > > Thanks > > Ryan Puddephatt > Web Developer > TFX Group > 1 Michaelson Square > Livingston > West Lothian > Scotand > EH54 7DP > > * [hidden email] > ( 01506 407 110 > 7 01506 407 108 > > -----Original Message----- > From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro > Vernet > Sent: 03 November 2005 04:12 > To: [hidden email] > Subject: Re: [ops-users] XUpdate and File Serializer > > Rayan, > > > <p:input name="data" href="oxf:xqry.xml"/> > > Just a quick note: here you can use just href="xqry.xhtml" instead of > href="oxf:xqry.xhtml". If you don't specify a protocol and the path is > relative, it will be relative to the location of the current file, in > this case your XPL file.a > > Alex > > On 11/2/05, Ryan Puddephatt <[hidden email]> wrote: > > Hi all, > > I am trying to use XUpdate to save a new entry in an XML file, I am > > using a pipeline, which has an input #instance passing the new entry to > > save. The XU processor is the first to be called inserting the new > > entry, the output is converted to XML ready and then sent to the file > > serializer. My problem is that the file serializer leaves the xml file > > empty even though the input has all the correct data on debug. I have a > > similar delete pipeline with the same problem. I have tried this in XSLT > > and it works fine, but requires two processors rather than the one for > > XU so I'd rather stick with XU if possible, any ideas? [code snippet > below] > > > > Also does anyone know if its possible to use the oxf: protocal for > > directory listings? as the directory I'm currently using won't be the > > same on the server, if not what would be the simplist way to achieve this? > > > > Thanks > > > > Ryan > > > > <!-- Use XU to add new query --> > > <p:processor name="oxf:xupdate"> > > <p:input name="other" href="#instance"/> > > <p:input name="data" href="oxf:xqry.xml"/> > > <p:input name="config"> > > <xu:modifications> > > <xu:insert-before select="/X/xquery[1]"> > > <xu:element name="xquery"> > > <queryString><xu:value-of > > select="document('input:other')/instance/currentXQuery"/></queryString> > > <createdDate><!--xu:value-of > > select="current-date-Time()"/--></createdDate> > > <name><xu:value-of > > select="document('input:other')/instance/query"/></name> > > </xu:element> > > </xu:insert-before> > > </xu:modifications> > > </p:input> > > <p:output name="data" id="save-output" debug="SAVEOUTPUT"/> > > </p:processor> > > > > <p:processor name="oxf:xml-converter"> > > <p:input name="config"> > > <config> > > <encoding>utf-8</encoding> > > </config> > > </p:input> > > <p:input name="data" href="#save-output"/> > > <p:output name="data" id="converted-output"/> > > </p:processor> > > > > <p:processor name="oxf:file-serializer"> > > <p:input name="config"> > > <config> > > <file>xqry.xml</file> > > <directory>C:\Documents and Settings\rpuddephatt\My > > > Documents\workspace\ops-peaUtilities\WEB-INF\resources\pages\doXQuery</direc > tory> > > </config> > > </p:input> > > <p:input name="data" href="#converted-output" debug="TEST"/> > > </p:processor> > > > > > > > > > > > > -- > > 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 > > > > > > > > > -- > Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > > > > > -- > 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 > > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |