[ops-user] pipeline and href / bug with <xform:help>?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[ops-user] pipeline and href / bug with <xform:help>?

marc.natale
Hi,
I've tried to modify the bizdoc NG example, in order not to have always the same "empty-instance.xml" when the user create a new doc, but various files that are already almost full-filled (so they are not empty anymore...). I want the user to precise in the summary-view the path of both the xml file and the xsl file he wants to use. So I've changed:

In new-document-action.xpl:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf=" http://www.orbeon.com/oxf/processors"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>

<p:processor name="oxf:xslt">
<p:input name="config" href="#instance#xpointer(/*/transfo)"/>
<p:input name="data" href="#instance#xpointer(/form/source)"/>
<p:output name="data" id="transfo-result"/>
</p:processor>

<!-- Generate an instance that is empty except for new ids -->
<p:processor name="oxf:unsafe-xslt">
<p:input name="data" href="#transfo-result"/> <!-- <p:input name="data" href="../schema/empty- instance.xml"/> -->
<p:input name="config">
<document-info xsl:version="2.0" xmlns:uuid="java:org.orbeon.oxf.util.UUIDUtils">
<document-id>
<xsl:value-of select="uuid:createPseudoUUID()"/>
</document-id>
<document>
<xsl:copy-of select="/*"/>
</document>
</document-info>
</p:input>
<p:output name="data" ref="data"/>
</p:processor>
</p:config>p:config>
 

So I added in the summary-viex.xsl:
<xforms:instance id="request-instance">
<form xmlns="">
<action/>
<document-id/>
<source/><!--I'll put here the xml file I want to load-->
<transfo/><!--I'll put here the xsl file-->
</form>
</xforms:instance>
and I used 2 inputs to fill the source and transfo tags.
 
The problem is that when I use this, the xsl file is not well understood and an error occurs.
Then, I've tried to keep always the same xsl file by indicating it in the code (href="file.xsl"), but with always the possibility for the user to choose his xml file. In this case, no error is generated, but the xsl file has failed in transforming the xml file, as if the xml file was empty!
I've spent most of my night on it, and I do not know what to try...
 
Thanks,
Marc
 
PS: a former post had been sent to notify a bug with the <xform:help> (it displayed always the same help). It's been fixed but there is still something strange: the position of the help "window" depends on the position of the scroll bar... The more it changes, the more the window of the help is in the top of the screen. Sometimes, the window is even out of the screen... It's not obvious to explain (above all in a foreign language), but if a developper has understood the problem...
 
PPS: I thank all the people (above all Erik) that keep helping young and slow learners like me to design web application thanks to the ops tool.


--
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
Reply | Threaded
Open this post in threaded view
|

Re: [ops-user] pipeline and href / bug with <xform:help>?

Erik Bruchez
Administrator
One thing: when you write:

   #instance#xpointer(/*/transfo)

The resulting document will be of the form:

   <transfo>
     ...
   </transfo>

This is not a correct XSLT stylesheet root. Assuming the stylesheet is
under the <transfo> element, you should write:

   #instance#xpointer(/*/transfo/*[1])

-Erik

Marc Natale wrote:
 > Hi,
 > I've tried to modify the bizdoc NG example, in order not to have always
 > the same "empty-instance.xml" when the user create a new doc, but
 > various files that are already almost full-filled (so they are not empty
 > anymore...). I want the user to precise in the summary-view the path of
 > both the xml file and the xsl file he wants to use. So I've changed:
 >
 > In new-document-action.xpl:
 > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
 >           xmlns:oxf=" http://www.orbeon.com/oxf/processors"
 >           xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 > <http://www.w3.org/1999/XSL/Transform">>
 >
 >     <p:param name="instance" type="input"/>
 >     <p:param name="data" type="output"/>
 >
 > <p:processor name="oxf:xslt">
 > <p:input name="config" href="#instance#xpointer(/*/transfo)"/>
 > <p:input name="data" href="#instance#xpointer(/form/source)"/>
 > <p:output name="data" id="transfo-result"/>
 > </p:processor>
 >
 > <!-- Generate an instance that is empty except for new ids -->
 > <p:processor name="oxf:unsafe-xslt">
 > <p:input name="data" href="#transfo-result"/> <!-- <p:input name="data"
 > href="../schema/empty- instance.xml"/> -->
 > <p:input name="config">
 > <document-info xsl:version="2.0"
 > xmlns:uuid="java:org.orbeon.oxf.util.UUIDUtils">
 > <document-id>
 > <xsl:value-of select="uuid:createPseudoUUID()"/>
 > </document-id>
 > <document>
 > <xsl:copy-of select="/*"/>
 > </document>
 > </document-info>
 > </p:input>
 > <p:output name="data" ref="data"/>
 > </p:processor>
 > </p:config>p:config>
 >
 >
 > So I added in the summary-viex.xsl:
 > <xforms:instance id="request-instance">
 > <form xmlns="">
 > <action/>
 > <document-id/>
 > <source/><!--I'll put here the xml file I want to load-->
 > <transfo/><!--I'll put here the xsl file-->
 > </form>
 > </xforms:instance>
 > and I used 2 inputs to fill the source and transfo tags.
 >
 > The problem is that when I use this, the xsl file is not well understood
 > and an error occurs.
 > Then, I've tried to keep always the same xsl file by indicating it in
 > the code (href="file.xsl"), but with always the possibility for the user
 > to choose his xml file. In this case, no error is generated, but the xsl
 > file has failed in transforming the xml file, as if the xml file was
empty!
 > I've spent most of my night on it, and I do not know what to try...
 >
 > Thanks,
 > Marc
 >
 > PS: a former post had been sent to notify a bug with the <xform:help>
 > (it displayed always the same help). It's been fixed but there is still
 > something strange: the position of the help "window" depends on the
 > position of the scroll bar... The more it changes, the more the window
 > of the help is in the top of the screen. Sometimes, the window is even
 > out of the screen... It's not obvious to explain (above all in a foreign
 > language), but if a developper has understood the problem...
 >
 > PPS: I thank all the people (above all Erik) that keep helping young and
 > slow learners like me to design web application thanks to the ops tool.




--
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
Reply | Threaded
Open this post in threaded view
|

Re: [ops-user] pipeline and href / bug with <xform:help>?

marc.natale
Yeah,
thanks a lot, Erik, but that was not exactly what I meant:
 
Actually, the stylesheet is not really under the <transfo> element, it just his name and his path (for example: ../file1/my_transfo.xsl) that are under <transfo>. So we have something like that:
 <transfo>
    ../file1/my_transfo.xsl
 </transfo>
 
So the difficulty for me is that when I use the href="#instance#xpointer(/*/transfo/*[1])"
I don't want the reference to be interpreted as an xml file, but just as text, so that it could give the same result as if I wrote: href="../file1/my_transfo.xsl", which works well...
 
Marc
 
On 20/08/05, Erik Bruchez <[hidden email]> wrote:
One thing: when you write:

  #instance#xpointer(/*/transfo)

The resulting document will be of the form:

  <transfo>
    ...
  </transfo>

This is not a correct XSLT stylesheet root. Assuming the stylesheet is
under the <transfo> element, you should write:

  #instance#xpointer(/*/transfo/*[1])

-Erik

Marc Natale wrote:

> Hi,
> I've tried to modify the bizdoc NG example, in order not to have always
> the same "empty-instance.xml" when the user create a new doc, but
> various files that are already almost full-filled (so they are not empty
> anymore...). I want the user to precise in the summary-view the path of
> both the xml file and the xsl file he wants to use. So I've changed:
>
> In new-document-action.xpl:
> <p:config xmlns:p=" http://www.orbeon.com/oxf/pipeline"
>           xmlns:oxf=" http://www.orbeon.com/oxf/processors"
>           xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

> <http://www.w3.org/1999/XSL/Transform" >>
>
>     <p:param name="instance" type="input"/>
>     <p:param name="data" type="output"/>
>
> <p:processor name="oxf:xslt">
> <p:input name="config" href="#instance#xpointer(/*/transfo)"/>
> <p:input name="data" href="#instance#xpointer(/form/source)"/>
> <p:output name="data" id="transfo-result"/>
> </p:processor>
>
> <!-- Generate an instance that is empty except for new ids -->
> <p:processor name="oxf:unsafe-xslt">
> <p:input name="data" href="#transfo-result"/> <!-- <p:input name="data"
> href="../schema/empty- instance.xml"/> -->
> <p:input name="config">
> <document-info xsl:version="2.0"
> xmlns:uuid="java:org.orbeon.oxf.util.UUIDUtils ">
> <document-id>
> <xsl:value-of select="uuid:createPseudoUUID()"/>
> </document-id>
> <document>
> <xsl:copy-of select="/*"/>
> </document>
> </document-info>
> </p:input>
> <p:output name="data" ref="data"/>
> </p:processor>
> </p:config>p:config>
>
>
> So I added in the summary-viex.xsl:
> <xforms:instance id="request-instance">
> <form xmlns="">
> <action/>
> <document-id/>
> <source/><!--I'll put here the xml file I want to load-->
> <transfo/><!--I'll put here the xsl file-->
> </form>
> </xforms:instance>
> and I used 2 inputs to fill the source and transfo tags.
>
> The problem is that when I use this, the xsl file is not well understood
> and an error occurs.
> Then, I've tried to keep always the same xsl file by indicating it in
> the code (href="file.xsl"), but with always the possibility for the user
> to choose his xml file. In this case, no error is generated, but the xsl
> file has failed in transforming the xml file, as if the xml file was
empty!

> I've spent most of my night on it, and I do not know what to try...
>
> Thanks,
> Marc
>
> PS: a former post had been sent to notify a bug with the <xform:help>
> (it displayed always the same help). It's been fixed but there is still
> something strange: the position of the help "window" depends on the
> position of the scroll bar... The more it changes, the more the window
> of the help is in the top of the screen. Sometimes, the window is even
> out of the screen... It's not obvious to explain (above all in a foreign
> language), but if a developper has understood the problem...
>
> PPS: I thank all the people (above all Erik) that keep helping young and
> slow learners like me to design web application thanks to the ops tool.





--
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
Reply | Threaded
Open this post in threaded view
|

Re: [ops-user] pipeline and href / bug with <xform:help>?

Alessandro  Vernet
Administrator
--- Marc Natale <[hidden email]> wrote:

> Yeah,
> thanks a lot, Erik, but that was not exactly what I meant:
>  Actually, the stylesheet is not really under the <transfo> element, it
> just
> his name and his path (for example: ../file1/my_transfo.xsl) that are
> under
> <transfo>. So we have something like that:
>  <transfo>
> ../file1/my_transfo.xsl
>  </transfo>
Hi Marc,

Using XPointer will extract a node and feed it to a processor; it won't
interpret the content of that node as a URL, and feed the document at that
URL to the processor. In this case what you need is a URL generator.

Specifically before the XSLT processor, you need to create a configuration
for the URL generator with XSLT based on the content of #instance, then
feed that configuration to the URL generator, and finally connect the URL
generator output to the "config" input of your existing XSLT processor.

Also see the documentation for the URL generator:
http://www.orbeon.com/ops/doc/processors-generators-url

Alex

--
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
Reply | Threaded
Open this post in threaded view
|

Re: [ops-user] pipeline and href / bug with <xform:help>?

marc.natale
Hi,
I have tested what you suggested. It works, but not at all.
This works:
<p:processor name="oxf:url-generator">
<p:input name="config" href="#sortie">
<url>../file/transfo2.xsl</url>
<content-type>application/xml</content-type>
<validating>true</validating>
</p:input>
<p:output name="data" id="xml1"/>
</p:processor>

But this doesn't work:

<p:processor name="oxf:xslt">
<p:input name="data" href="#instance"/>
<p:input name="config">
<config>
<url>../file/transfo2.xsl</url>
<content-type>application/xml</content-type>
<validating>true</validating>
</config>
</p:input>
<p:output name="data" id="sortie"/>
</p:processor>

<p:processor name="oxf:url-generator">
<p:input name="config" href="#sortie"/>
<p:output name="data" id="xml1"/>
</p:processor>

I cannot figure out why because I used a similar code with the
serializer processor and an XSLT one that gives the accurate
configuration...
This is just a test; I know that in this example, there is no point in
choosing the second solution. But I would like to use within the <url>
an xsl transformation...

Any idea?

Thanks,
Marc



--
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
Reply | Threaded
Open this post in threaded view
|

Re: [ops-user] pipeline and href / bug with <xform:help>?

Erik Bruchez
Administrator
Marc Natale wrote:

> Hi,
> I have tested what you suggested. It works, but not at all.
> This works:
> <p:processor name="oxf:url-generator">
> <p:input name="config" href="#sortie">
> <url>../file/transfo2.xsl</url>
> <content-type>application/xml</content-type>
> <validating>true</validating>
> </p:input>
> <p:output name="data" id="xml1"/>
> </p:processor>
A note about the above: you are missing a <config> element around your
<url>, <content-type> etc. The above should read:

<p:processor name="oxf:url-generator">
   <p:input name="config" href="#sortie">
     <config>
       <url>../file/transfo2.xsl</url>
       <content-type>application/xml</content-type>
       <validating>true</validating>
     </config>
   </p:input>
   <p:output name="data" id="xml1"/>
</p:processor>

> But this doesn't work:
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#instance"/>
> <p:input name="config">
> <config>
> <url>../file/transfo2.xsl</url>
> <content-type>application/xml</content-type>
> <validating>true</validating>
> </config>
> </p:input>
> <p:output name="data" id="sortie"/>
> </p:processor>
Here again, some error. You are missing xsl:version="2.0" on the
<config> element, so the XSLT processor will throw an error. This should be:

<p:processor name="oxf:xslt">
   <p:input name="data" href="#instance"/>
   <p:input name="config">
     <config xsl:version="2.0">
       <url>../file/transfo2.xsl</url>
       <content-type>application/xml</content-type>
       <validating>true</validating>
     </config>
   </p:input>
   <p:output name="data" id="sortie"/>
</p:processor>

> <p:processor name="oxf:url-generator">
> <p:input name="config" href="#sortie"/>
> <p:output name="data" id="xml1"/>
> </p:processor>
>
> I cannot figure out why because I used a similar code with the
> serializer processor and an XSLT one that gives the accurate
> configuration...

-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