Transforming instance using XSLT

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

Transforming instance using XSLT

Richard Braman
Message
Now that I am back into XPL (now that most of my Xforms controls are done for 1040EZ, except a few bugs)
My learning cure is back to steep.
I want to call  xpl pipeline to convert my xforms instance into a text file using the following xslt on my instance and return the rsults as in a window, or better yet prmot the user to save them on a trigger.
 
I am not sure where to put my xslt.
 
I am still also having problems serializing instance and using upload controls.

 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>
    <xsl:template match="//form">
    <xsl:for-each select="*/*[. != '']">
  [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
  <xsl:value-of select="."/> 
  </xsl:for-each>
   </xsl:template>
</xsl:stylesheet>
</p:config>
 
how would i go about doing this?
 
My gues would be to enclose the
 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 


--
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: Transforming instance using XSLT

Alessandro  Vernet
Administrator
Hi Richard,

1) In XForms, you can execute a <xforms:submission replace="all"
action="someURI"/>. This will make a request at someURI.
2) Then in the page-flow.xml, you have a <page path-info="someURI"
view="your-file.xsl">. This will run your-file.xsl.
3) In your-file.xsl, use doc('input:instance') to have access to the
submitted instance and generate the page you want based on the
submitted instance.

So actually, you don't even need XPL in this case.

Alex

On 3/6/06, Richard Braman <[hidden email]> wrote:

>
> Now that I am back into XPL (now that most of my Xforms controls are done
> for 1040EZ, except a few bugs)
> My learning cure is back to steep.
> I want to call  xpl pipeline to convert my xforms instance into a text file
> using the following xslt on my instance and return the rsults as in a
> window, or better yet prmot the user to save them on a trigger.
>
> I am not sure where to put my xslt.
>
> I am still also having problems serializing instance and using upload
> controls.
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="text"/>
>     <xsl:template match="//form">
>     <xsl:for-each select="*/*[. != '']">
>   [<xsl:value-of select="substring-after(name(.),'SEQ')
> "/>]
>   <xsl:value-of select="."/>
>   </xsl:for-each>
>    </xsl:template>
> </xsl:stylesheet>
> </p:config>
>
> how would i go about doing this?
>
> My gues would be to enclose the
>
>
>
> Richard Braman
> mailto:[hidden email]
> 561.748.4002 (voice)
>
> http://www.taxcodesoftware.org
> Free Open Source Tax Software
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: Transforming instance using XSLT

Richard Braman
Hi Alex

Where do I put the doc('input:instance')
In the stylesheet

I know this doesn't work:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="doc('input:instance')//form">
                <xsl:for-each select="*/*[. != '']">
         [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

Richard

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Thursday, March 09, 2006 8:07 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Hi Richard,

1) In XForms, you can execute a <xforms:submission replace="all"
action="someURI"/>. This will make a request at someURI.
2) Then in the page-flow.xml, you have a <page path-info="someURI"
view="your-file.xsl">. This will run your-file.xsl.
3) In your-file.xsl, use doc('input:instance') to have access to the
submitted instance and generate the page you want based on the submitted
instance.

So actually, you don't even need XPL in this case.

Alex

On 3/6/06, Richard Braman <[hidden email]> wrote:
>
> Now that I am back into XPL (now that most of my Xforms controls are
> done for 1040EZ, except a few bugs) My learning cure is back to steep.
> I want to call  xpl pipeline to convert my xforms instance into a text
file

> using the following xslt on my instance and return the rsults as in a
> window, or better yet prmot the user to save them on a trigger.
>
> I am not sure where to put my xslt.
>
> I am still also having problems serializing instance and using upload
> controls.
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="text"/>
>     <xsl:template match="//form">
>     <xsl:for-each select="*/*[. != '']">
>   [<xsl:value-of select="substring-after(name(.),'SEQ')
> "/>]
>   <xsl:value-of select="."/>
>   </xsl:for-each>
>    </xsl:template>
> </xsl:stylesheet>
> </p:config>
>
> how would i go about doing this?
>
> My gues would be to enclose the
>
>
>
> Richard Braman
> mailto:[hidden email]
> 561.748.4002 (voice)
>
> http://www.taxcodesoftware.org
> Free Open Source Tax Software
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: Transforming instance using XSLT

Richard Braman
Obviously that wont work because match="<pattern" ok.  So I tried:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="/">
                <xsl:for-each select="doc('input:instance')/f1040ez/*">
                         [<xsl:value-of
select="substring-after(name(.),'SEQ') "/>]
                         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

And it doesn't bomb but doesn't output anything.  Getting closer.

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Friday, March 10, 2006 10:00 AM
To: [hidden email]
Subject: RE: [ops-users] Transforming instance using XSLT


Hi Alex

Where do I put the doc('input:instance')
In the stylesheet

I know this doesn't work:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="doc('input:instance')//form">
                <xsl:for-each select="*/*[. != '']">
         [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

Richard

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Thursday, March 09, 2006 8:07 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Hi Richard,

1) In XForms, you can execute a <xforms:submission replace="all"
action="someURI"/>. This will make a request at someURI.
2) Then in the page-flow.xml, you have a <page path-info="someURI"
view="your-file.xsl">. This will run your-file.xsl.
3) In your-file.xsl, use doc('input:instance') to have access to the
submitted instance and generate the page you want based on the submitted
instance.

So actually, you don't even need XPL in this case.

Alex

On 3/6/06, Richard Braman <[hidden email]> wrote:
>
> Now that I am back into XPL (now that most of my Xforms controls are
> done for 1040EZ, except a few bugs) My learning cure is back to steep.
> I want to call  xpl pipeline to convert my xforms instance into a text
file

> using the following xslt on my instance and return the rsults as in a
> window, or better yet prmot the user to save them on a trigger.
>
> I am not sure where to put my xslt.
>
> I am still also having problems serializing instance and using upload
> controls.
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="text"/>
>     <xsl:template match="//form">
>     <xsl:for-each select="*/*[. != '']">
>   [<xsl:value-of select="substring-after(name(.),'SEQ')
> "/>]
>   <xsl:value-of select="."/>
>   </xsl:for-each>
>    </xsl:template>
> </xsl:stylesheet>
> </p:config>
>
> how would i go about doing this?
>
> My gues would be to enclose the
>
>
>
> Richard Braman
> mailto:[hidden email]
> 561.748.4002 (voice)
>
> http://www.taxcodesoftware.org
> Free Open Source Tax Software
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: Resolved: Transforming instance using XSLT

Richard Braman
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="/">
                <xsl:for-each
select="doc('input:instance')/form/f1040ez/*">
                         [<xsl:value-of
select="substring-after(name(.),'SEQ') "/>]
                         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Friday, March 10, 2006 4:18 PM
To: [hidden email]
Subject: RE: [ops-users] Transforming instance using XSLT


Obviously that wont work because match="<pattern" ok.  So I tried:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="/">
                <xsl:for-each select="doc('input:instance')/f1040ez/*">
                         [<xsl:value-of
select="substring-after(name(.),'SEQ') "/>]
                         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

And it doesn't bomb but doesn't output anything.  Getting closer.

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Friday, March 10, 2006 10:00 AM
To: [hidden email]
Subject: RE: [ops-users] Transforming instance using XSLT


Hi Alex

Where do I put the doc('input:instance')
In the stylesheet

I know this doesn't work:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="doc('input:instance')//form">
                <xsl:for-each select="*/*[. != '']">
         [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

Richard

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Thursday, March 09, 2006 8:07 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Hi Richard,

1) In XForms, you can execute a <xforms:submission replace="all"
action="someURI"/>. This will make a request at someURI.
2) Then in the page-flow.xml, you have a <page path-info="someURI"
view="your-file.xsl">. This will run your-file.xsl.
3) In your-file.xsl, use doc('input:instance') to have access to the
submitted instance and generate the page you want based on the submitted
instance.

So actually, you don't even need XPL in this case.

Alex

On 3/6/06, Richard Braman <[hidden email]> wrote:
>
> Now that I am back into XPL (now that most of my Xforms controls are
> done for 1040EZ, except a few bugs) My learning cure is back to steep.

> I want to call  xpl pipeline to convert my xforms instance into a text
file

> using the following xslt on my instance and return the rsults as in a
> window, or better yet prmot the user to save them on a trigger.
>
> I am not sure where to put my xslt.
>
> I am still also having problems serializing instance and using upload
> controls.
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="text"/>
>     <xsl:template match="//form">
>     <xsl:for-each select="*/*[. != '']">
>   [<xsl:value-of select="substring-after(name(.),'SEQ')
> "/>]
>   <xsl:value-of select="."/>
>   </xsl:for-each>
>    </xsl:template>
> </xsl:stylesheet>
> </p:config>
>
> how would i go about doing this?
>
> My gues would be to enclose the
>
>
>
> Richard Braman
> mailto:[hidden email]
> 561.748.4002 (voice)
>
> http://www.taxcodesoftware.org
> Free Open Source Tax Software
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: Almost Resolved: Transforming instance using XSLT

Richard Braman
Well almost, the first time I did it it worked.  But then I hit it again
a couple minutes later and now it does XML
even though xsl:output method = "text".  AHHHHHHHH.

I also noticed that it was not converting &#xa0; to a non breaking space
in xalan the  way it was in MSXML.



-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Friday, March 10, 2006 4:21 PM
To: [hidden email]
Subject: RE: [ops-users] Resolved: Transforming instance using XSLT


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="/">
                <xsl:for-each
select="doc('input:instance')/form/f1040ez/*">
                         [<xsl:value-of
select="substring-after(name(.),'SEQ') "/>]
                         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Friday, March 10, 2006 4:18 PM
To: [hidden email]
Subject: RE: [ops-users] Transforming instance using XSLT


Obviously that wont work because match="<pattern" ok.  So I tried:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="/">
                <xsl:for-each select="doc('input:instance')/f1040ez/*">
                         [<xsl:value-of
select="substring-after(name(.),'SEQ') "/>]
                         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

And it doesn't bomb but doesn't output anything.  Getting closer.

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Friday, March 10, 2006 10:00 AM
To: [hidden email]
Subject: RE: [ops-users] Transforming instance using XSLT


Hi Alex

Where do I put the doc('input:instance')
In the stylesheet

I know this doesn't work:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://www.w3.org/2002/xforms">
        <xsl:output method="text"/>
        <xsl:template match="doc('input:instance')//form">
                <xsl:for-each select="*/*[. != '']">
         [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
         <xsl:value-of select="."/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>

Richard

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Thursday, March 09, 2006 8:07 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Hi Richard,

1) In XForms, you can execute a <xforms:submission replace="all"
action="someURI"/>. This will make a request at someURI.
2) Then in the page-flow.xml, you have a <page path-info="someURI"
view="your-file.xsl">. This will run your-file.xsl.
3) In your-file.xsl, use doc('input:instance') to have access to the
submitted instance and generate the page you want based on the submitted
instance.

So actually, you don't even need XPL in this case.

Alex

On 3/6/06, Richard Braman <[hidden email]> wrote:
>
> Now that I am back into XPL (now that most of my Xforms controls are
> done for 1040EZ, except a few bugs) My learning cure is back to steep.

> I want to call  xpl pipeline to convert my xforms instance into a text
file

> using the following xslt on my instance and return the rsults as in a
> window, or better yet prmot the user to save them on a trigger.
>
> I am not sure where to put my xslt.
>
> I am still also having problems serializing instance and using upload
> controls.
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="text"/>
>     <xsl:template match="//form">
>     <xsl:for-each select="*/*[. != '']">
>   [<xsl:value-of select="substring-after(name(.),'SEQ')
> "/>]
>   <xsl:value-of select="."/>
>   </xsl:for-each>
>    </xsl:template>
> </xsl:stylesheet>
> </p:config>
>
> how would i go about doing this?
>
> My gues would be to enclose the
>
>
>
> Richard Braman
> mailto:[hidden email]
> 561.748.4002 (voice)
>
> http://www.taxcodesoftware.org
> Free Open Source Tax Software
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Transforming instance using XSLT

Alessandro  Vernet
Administrator
In reply to this post by Richard Braman
Richard,

The <xsl:output method="text"/> can cause some problem. When you use
the XSLT processor with XPL, it is assumed that you will generate XML.
If you want to transform XML into text, you might want to look at the
Text converter.

http://www.orbeon.com/ops/doc/processors-converters

Also, to see what you have in input:instance, you can use
<xsl:message><xsl:copy-of
select="doc('input:instance')"/></xsl:message>, which will log the
instance.

Alex

On 3/10/06, Richard Braman <[hidden email]> wrote:

> Obviously that wont work because match="<pattern" ok.  So I tried:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xforms="http://www.w3.org/2002/xforms">
>         <xsl:output method="text"/>
>         <xsl:template match="/">
>                 <xsl:for-each select="doc('input:instance')/f1040ez/*">
>                          [<xsl:value-of
> select="substring-after(name(.),'SEQ') "/>]
>                          <xsl:value-of select="."/>
>                 </xsl:for-each>
>         </xsl:template>
> </xsl:stylesheet>
>
> And it doesn't bomb but doesn't output anything.  Getting closer.
>
> -----Original Message-----
> From: Richard Braman [mailto:[hidden email]]
> Sent: Friday, March 10, 2006 10:00 AM
> To: [hidden email]
> Subject: RE: [ops-users] Transforming instance using XSLT
>
>
> Hi Alex
>
> Where do I put the doc('input:instance')
> In the stylesheet
>
> I know this doesn't work:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xforms="http://www.w3.org/2002/xforms">
>         <xsl:output method="text"/>
>         <xsl:template match="doc('input:instance')//form">
>                 <xsl:for-each select="*/*[. != '']">
>          [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
>          <xsl:value-of select="."/>
>                 </xsl:for-each>
>         </xsl:template>
> </xsl:stylesheet>
>
> Richard
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Thursday, March 09, 2006 8:07 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> Hi Richard,
>
> 1) In XForms, you can execute a <xforms:submission replace="all"
> action="someURI"/>. This will make a request at someURI.
> 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> view="your-file.xsl">. This will run your-file.xsl.
> 3) In your-file.xsl, use doc('input:instance') to have access to the
> submitted instance and generate the page you want based on the submitted
> instance.
>
> So actually, you don't even need XPL in this case.
>
> Alex
>
> On 3/6/06, Richard Braman <[hidden email]> wrote:
> >
> > Now that I am back into XPL (now that most of my Xforms controls are
> > done for 1040EZ, except a few bugs) My learning cure is back to steep.
> > I want to call  xpl pipeline to convert my xforms instance into a text
> file
> > using the following xslt on my instance and return the rsults as in a
> > window, or better yet prmot the user to save them on a trigger.
> >
> > I am not sure where to put my xslt.
> >
> > I am still also having problems serializing instance and using upload
> > controls.
> >
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >   <xsl:output method="text"/>
> >     <xsl:template match="//form">
> >     <xsl:for-each select="*/*[. != '']">
> >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > "/>]
> >   <xsl:value-of select="."/>
> >   </xsl:for-each>
> >    </xsl:template>
> > </xsl:stylesheet>
> > </p:config>
> >
> > how would i go about doing this?
> >
> > My gues would be to enclose the
> >
> >
> >
> > Richard Braman
> > mailto:[hidden email]
> > 561.748.4002 (voice)
> >
> > http://www.taxcodesoftware.org
> > Free Open Source Tax Software
> >
> >
> > --
> > 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
Reply | Threaded
Open this post in threaded view
|

RE: Transforming instance using XSLT

Richard Braman
I followed your recommendations and I didn't think I was using XPL.
This is a view.  What is the problem here?

> Hi Richard,
>
> 1) In XForms, you can execute a <xforms:submission replace="all"
> action="someURI"/>. This will make a request at someURI.
> 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> view="your-file.xsl">. This will run your-file.xsl.
> 3) In your-file.xsl, use doc('input:instance') to have access to the
> submitted instance and generate the page you want based on the
> submitted instance.
>
> So actually, you don't even need XPL in this case.
>
> Alex
The whole thread is below.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Monday, March 13, 2006 4:12 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Richard,

The <xsl:output method="text"/> can cause some problem. When you use the
XSLT processor with XPL, it is assumed that you will generate XML. If
you want to transform XML into text, you might want to look at the Text
converter.

http://www.orbeon.com/ops/doc/processors-converters

Also, to see what you have in input:instance, you can use
<xsl:message><xsl:copy-of
select="doc('input:instance')"/></xsl:message>, which will log the
instance.

Alex

On 3/10/06, Richard Braman <[hidden email]> wrote:
> Obviously that wont work because match="<pattern" ok.  So I tried:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xforms="http://www.w3.org/2002/xforms">
>         <xsl:output method="text"/>
>         <xsl:template match="/">
>                 <xsl:for-each
select="doc('input:instance')/f1040ez/*">

>                          [<xsl:value-of
> select="substring-after(name(.),'SEQ') "/>]
>                          <xsl:value-of select="."/>
>                 </xsl:for-each>
>         </xsl:template>
> </xsl:stylesheet>
>
> And it doesn't bomb but doesn't output anything.  Getting closer.
>
> -----Original Message-----
> From: Richard Braman [mailto:[hidden email]]
> Sent: Friday, March 10, 2006 10:00 AM
> To: [hidden email]
> Subject: RE: [ops-users] Transforming instance using XSLT
>
>
> Hi Alex
>
> Where do I put the doc('input:instance')
> In the stylesheet
>
> I know this doesn't work:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xforms="http://www.w3.org/2002/xforms">
>         <xsl:output method="text"/>
>         <xsl:template match="doc('input:instance')//form">
>                 <xsl:for-each select="*/*[. != '']">
>          [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
>          <xsl:value-of select="."/>
>                 </xsl:for-each>
>         </xsl:template>
> </xsl:stylesheet>
>
> Richard
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Thursday, March 09, 2006 8:07 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> Hi Richard,
>
> 1) In XForms, you can execute a <xforms:submission replace="all"
> action="someURI"/>. This will make a request at someURI.
> 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> view="your-file.xsl">. This will run your-file.xsl.
> 3) In your-file.xsl, use doc('input:instance') to have access to the
> submitted instance and generate the page you want based on the
> submitted instance.
>
> So actually, you don't even need XPL in this case.
>
> Alex
>
> On 3/6/06, Richard Braman <[hidden email]> wrote:
> >
> > Now that I am back into XPL (now that most of my Xforms controls are

> > done for 1040EZ, except a few bugs) My learning cure is back to
> > steep. I want to call  xpl pipeline to convert my xforms instance
> > into a text
> file
> > using the following xslt on my instance and return the rsults as in
> > a window, or better yet prmot the user to save them on a trigger.
> >
> > I am not sure where to put my xslt.
> >
> > I am still also having problems serializing instance and using
> > upload controls.
> >
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >   <xsl:output method="text"/>
> >     <xsl:template match="//form">
> >     <xsl:for-each select="*/*[. != '']">
> >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > "/>]
> >   <xsl:value-of select="."/>
> >   </xsl:for-each>
> >    </xsl:template>
> > </xsl:stylesheet>
> > </p:config>
> >
> > how would i go about doing this?
> >
> > My gues would be to enclose the
> >
> >
> >
> > Richard Braman
> > mailto:[hidden email]
> > 561.748.4002 (voice)
> >
> > http://www.taxcodesoftware.org
> > Free Open Source Tax Software
> >
> >
> > --
> > 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
Reply | Threaded
Open this post in threaded view
|

Re: Transforming instance using XSLT

Alessandro  Vernet
Administrator
The same applies to the view, i.e. the view is expected to generate
XML. In your case, do you want to generate a text file to be sent to
the user?

Alex

On 3/13/06, Richard Braman <[hidden email]> wrote:

> I followed your recommendations and I didn't think I was using XPL.
> This is a view.  What is the problem here?
>
> > Hi Richard,
> >
> > 1) In XForms, you can execute a <xforms:submission replace="all"
> > action="someURI"/>. This will make a request at someURI.
> > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> > view="your-file.xsl">. This will run your-file.xsl.
> > 3) In your-file.xsl, use doc('input:instance') to have access to the
> > submitted instance and generate the page you want based on the
> > submitted instance.
> >
> > So actually, you don't even need XPL in this case.
> >
> > Alex
>
> The whole thread is below.
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Monday, March 13, 2006 4:12 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> Richard,
>
> The <xsl:output method="text"/> can cause some problem. When you use the
> XSLT processor with XPL, it is assumed that you will generate XML. If
> you want to transform XML into text, you might want to look at the Text
> converter.
>
> http://www.orbeon.com/ops/doc/processors-converters
>
> Also, to see what you have in input:instance, you can use
> <xsl:message><xsl:copy-of
> select="doc('input:instance')"/></xsl:message>, which will log the
> instance.
>
> Alex
>
> On 3/10/06, Richard Braman <[hidden email]> wrote:
> > Obviously that wont work because match="<pattern" ok.  So I tried:
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:xforms="http://www.w3.org/2002/xforms">
> >         <xsl:output method="text"/>
> >         <xsl:template match="/">
> >                 <xsl:for-each
> select="doc('input:instance')/f1040ez/*">
> >                          [<xsl:value-of
> > select="substring-after(name(.),'SEQ') "/>]
> >                          <xsl:value-of select="."/>
> >                 </xsl:for-each>
> >         </xsl:template>
> > </xsl:stylesheet>
> >
> > And it doesn't bomb but doesn't output anything.  Getting closer.
> >
> > -----Original Message-----
> > From: Richard Braman [mailto:[hidden email]]
> > Sent: Friday, March 10, 2006 10:00 AM
> > To: [hidden email]
> > Subject: RE: [ops-users] Transforming instance using XSLT
> >
> >
> > Hi Alex
> >
> > Where do I put the doc('input:instance')
> > In the stylesheet
> >
> > I know this doesn't work:
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:xforms="http://www.w3.org/2002/xforms">
> >         <xsl:output method="text"/>
> >         <xsl:template match="doc('input:instance')//form">
> >                 <xsl:for-each select="*/*[. != '']">
> >          [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
> >          <xsl:value-of select="."/>
> >                 </xsl:for-each>
> >         </xsl:template>
> > </xsl:stylesheet>
> >
> > Richard
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Alessandro Vernet
> > Sent: Thursday, March 09, 2006 8:07 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Transforming instance using XSLT
> >
> >
> > Hi Richard,
> >
> > 1) In XForms, you can execute a <xforms:submission replace="all"
> > action="someURI"/>. This will make a request at someURI.
> > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> > view="your-file.xsl">. This will run your-file.xsl.
> > 3) In your-file.xsl, use doc('input:instance') to have access to the
> > submitted instance and generate the page you want based on the
> > submitted instance.
> >
> > So actually, you don't even need XPL in this case.
> >
> > Alex
> >
> > On 3/6/06, Richard Braman <[hidden email]> wrote:
> > >
> > > Now that I am back into XPL (now that most of my Xforms controls are
>
> > > done for 1040EZ, except a few bugs) My learning cure is back to
> > > steep. I want to call  xpl pipeline to convert my xforms instance
> > > into a text
> > file
> > > using the following xslt on my instance and return the rsults as in
> > > a window, or better yet prmot the user to save them on a trigger.
> > >
> > > I am not sure where to put my xslt.
> > >
> > > I am still also having problems serializing instance and using
> > > upload controls.
> > >
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > >   <xsl:output method="text"/>
> > >     <xsl:template match="//form">
> > >     <xsl:for-each select="*/*[. != '']">
> > >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > > "/>]
> > >   <xsl:value-of select="."/>
> > >   </xsl:for-each>
> > >    </xsl:template>
> > > </xsl:stylesheet>
> > > </p:config>
> > >
> > > how would i go about doing this?
> > >
> > > My gues would be to enclose the
> > >
> > >
> > >
> > > Richard Braman
> > > mailto:[hidden email]
> > > 561.748.4002 (voice)
> > >
> > > http://www.taxcodesoftware.org
> > > Free Open Source Tax Software
> > >
> > >
> > > --
> > > 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
>
>
>

--
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: Transforming instance using XSLT

Richard Braman
Yes.  I want to generate  text file to be sent to the user, or even to
be saved somewhere on the server.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Monday, March 13, 2006 4:34 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


The same applies to the view, i.e. the view is expected to generate XML.
In your case, do you want to generate a text file to be sent to the
user?

Alex

On 3/13/06, Richard Braman <[hidden email]> wrote:

> I followed your recommendations and I didn't think I was using XPL.
> This is a view.  What is the problem here?
>
> > Hi Richard,
> >
> > 1) In XForms, you can execute a <xforms:submission replace="all"
> > action="someURI"/>. This will make a request at someURI.
> > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> > view="your-file.xsl">. This will run your-file.xsl.
> > 3) In your-file.xsl, use doc('input:instance') to have access to the

> > submitted instance and generate the page you want based on the
> > submitted instance.
> >
> > So actually, you don't even need XPL in this case.
> >
> > Alex
>
> The whole thread is below.
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Monday, March 13, 2006 4:12 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> Richard,
>
> The <xsl:output method="text"/> can cause some problem. When you use
> the XSLT processor with XPL, it is assumed that you will generate XML.

> If you want to transform XML into text, you might want to look at the
> Text converter.
>
> http://www.orbeon.com/ops/doc/processors-converters
>
> Also, to see what you have in input:instance, you can use
> <xsl:message><xsl:copy-of
> select="doc('input:instance')"/></xsl:message>, which will log the
> instance.
>
> Alex
>
> On 3/10/06, Richard Braman <[hidden email]> wrote:
> > Obviously that wont work because match="<pattern" ok.  So I tried:
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:xforms="http://www.w3.org/2002/xforms">
> >         <xsl:output method="text"/>
> >         <xsl:template match="/">
> >                 <xsl:for-each
> select="doc('input:instance')/f1040ez/*">
> >                          [<xsl:value-of
> > select="substring-after(name(.),'SEQ') "/>]
> >                          <xsl:value-of select="."/>
> >                 </xsl:for-each>
> >         </xsl:template>
> > </xsl:stylesheet>
> >
> > And it doesn't bomb but doesn't output anything.  Getting closer.
> >
> > -----Original Message-----
> > From: Richard Braman [mailto:[hidden email]]
> > Sent: Friday, March 10, 2006 10:00 AM
> > To: [hidden email]
> > Subject: RE: [ops-users] Transforming instance using XSLT
> >
> >
> > Hi Alex
> >
> > Where do I put the doc('input:instance')
> > In the stylesheet
> >
> > I know this doesn't work:
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:xforms="http://www.w3.org/2002/xforms">
> >         <xsl:output method="text"/>
> >         <xsl:template match="doc('input:instance')//form">
> >                 <xsl:for-each select="*/*[. != '']">
> >          [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
> >          <xsl:value-of select="."/>
> >                 </xsl:for-each>
> >         </xsl:template>
> > </xsl:stylesheet>
> >
> > Richard
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Alessandro Vernet
> > Sent: Thursday, March 09, 2006 8:07 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Transforming instance using XSLT
> >
> >
> > Hi Richard,
> >
> > 1) In XForms, you can execute a <xforms:submission replace="all"
> > action="someURI"/>. This will make a request at someURI.
> > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> > view="your-file.xsl">. This will run your-file.xsl.
> > 3) In your-file.xsl, use doc('input:instance') to have access to the

> > submitted instance and generate the page you want based on the
> > submitted instance.
> >
> > So actually, you don't even need XPL in this case.
> >
> > Alex
> >
> > On 3/6/06, Richard Braman <[hidden email]> wrote:
> > >
> > > Now that I am back into XPL (now that most of my Xforms controls
> > > are
>
> > > done for 1040EZ, except a few bugs) My learning cure is back to
> > > steep. I want to call  xpl pipeline to convert my xforms instance
> > > into a text
> > file
> > > using the following xslt on my instance and return the rsults as
> > > in a window, or better yet prmot the user to save them on a
> > > trigger.
> > >
> > > I am not sure where to put my xslt.
> > >
> > > I am still also having problems serializing instance and using
> > > upload controls.
> > >
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > >   <xsl:output method="text"/>
> > >     <xsl:template match="//form">
> > >     <xsl:for-each select="*/*[. != '']">
> > >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > > "/>]
> > >   <xsl:value-of select="."/>
> > >   </xsl:for-each>
> > >    </xsl:template>
> > > </xsl:stylesheet>
> > > </p:config>
> > >
> > > how would i go about doing this?
> > >
> > > My gues would be to enclose the
> > >
> > >
> > >
> > > Richard Braman
> > > mailto:[hidden email]
> > > 561.748.4002 (voice)
> > >
> > > http://www.taxcodesoftware.org
> > > Free Open Source Tax Software
> > >
> > >
> > > --
> > > 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
>
>
>


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

Re: Transforming instance using XSLT

Alessandro  Vernet
Administrator
Richard,

OK, then try to generate in your view an XML document that looks like:

<document xsi:type="xs:string" content-type="text/plain">
    Your text here
</document>

This will be recognized by the epilogue and sent as text to the user.
If you look at the epilogue, you will see there is a test: <p:when
test="/document[@xsi:type]">. When the root of your document has a
<document xsi:type="...">, the HTTP serializer runs. For more about
the text mode, see:

http://www.orbeon.com/ops/doc/processors-serializers-http#text-mode

Alex

On 3/13/06, Richard Braman <[hidden email]> wrote:

> Yes.  I want to generate  text file to be sent to the user, or even to
> be saved somewhere on the server.
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Monday, March 13, 2006 4:34 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> The same applies to the view, i.e. the view is expected to generate XML.
> In your case, do you want to generate a text file to be sent to the
> user?
>
> Alex
>
> On 3/13/06, Richard Braman <[hidden email]> wrote:
> > I followed your recommendations and I didn't think I was using XPL.
> > This is a view.  What is the problem here?
> >
> > > Hi Richard,
> > >
> > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > action="someURI"/>. This will make a request at someURI.
> > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> > > view="your-file.xsl">. This will run your-file.xsl.
> > > 3) In your-file.xsl, use doc('input:instance') to have access to the
>
> > > submitted instance and generate the page you want based on the
> > > submitted instance.
> > >
> > > So actually, you don't even need XPL in this case.
> > >
> > > Alex
> >
> > The whole thread is below.
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Alessandro Vernet
> > Sent: Monday, March 13, 2006 4:12 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Transforming instance using XSLT
> >
> >
> > Richard,
> >
> > The <xsl:output method="text"/> can cause some problem. When you use
> > the XSLT processor with XPL, it is assumed that you will generate XML.
>
> > If you want to transform XML into text, you might want to look at the
> > Text converter.
> >
> > http://www.orbeon.com/ops/doc/processors-converters
> >
> > Also, to see what you have in input:instance, you can use
> > <xsl:message><xsl:copy-of
> > select="doc('input:instance')"/></xsl:message>, which will log the
> > instance.
> >
> > Alex
> >
> > On 3/10/06, Richard Braman <[hidden email]> wrote:
> > > Obviously that wont work because match="<pattern" ok.  So I tried:
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > >         <xsl:output method="text"/>
> > >         <xsl:template match="/">
> > >                 <xsl:for-each
> > select="doc('input:instance')/f1040ez/*">
> > >                          [<xsl:value-of
> > > select="substring-after(name(.),'SEQ') "/>]
> > >                          <xsl:value-of select="."/>
> > >                 </xsl:for-each>
> > >         </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > And it doesn't bomb but doesn't output anything.  Getting closer.
> > >
> > > -----Original Message-----
> > > From: Richard Braman [mailto:[hidden email]]
> > > Sent: Friday, March 10, 2006 10:00 AM
> > > To: [hidden email]
> > > Subject: RE: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Hi Alex
> > >
> > > Where do I put the doc('input:instance')
> > > In the stylesheet
> > >
> > > I know this doesn't work:
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > >         <xsl:output method="text"/>
> > >         <xsl:template match="doc('input:instance')//form">
> > >                 <xsl:for-each select="*/*[. != '']">
> > >          [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
> > >          <xsl:value-of select="."/>
> > >                 </xsl:for-each>
> > >         </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > Richard
> > >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > Alessandro Vernet
> > > Sent: Thursday, March 09, 2006 8:07 PM
> > > To: [hidden email]
> > > Subject: Re: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Hi Richard,
> > >
> > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > action="someURI"/>. This will make a request at someURI.
> > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
> > > view="your-file.xsl">. This will run your-file.xsl.
> > > 3) In your-file.xsl, use doc('input:instance') to have access to the
>
> > > submitted instance and generate the page you want based on the
> > > submitted instance.
> > >
> > > So actually, you don't even need XPL in this case.
> > >
> > > Alex
> > >
> > > On 3/6/06, Richard Braman <[hidden email]> wrote:
> > > >
> > > > Now that I am back into XPL (now that most of my Xforms controls
> > > > are
> >
> > > > done for 1040EZ, except a few bugs) My learning cure is back to
> > > > steep. I want to call  xpl pipeline to convert my xforms instance
> > > > into a text
> > > file
> > > > using the following xslt on my instance and return the rsults as
> > > > in a window, or better yet prmot the user to save them on a
> > > > trigger.
> > > >
> > > > I am not sure where to put my xslt.
> > > >
> > > > I am still also having problems serializing instance and using
> > > > upload controls.
> > > >
> > > >
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > >   <xsl:output method="text"/>
> > > >     <xsl:template match="//form">
> > > >     <xsl:for-each select="*/*[. != '']">
> > > >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > > > "/>]
> > > >   <xsl:value-of select="."/>
> > > >   </xsl:for-each>
> > > >    </xsl:template>
> > > > </xsl:stylesheet>
> > > > </p:config>
> > > >
> > > > how would i go about doing this?
> > > >
> > > > My gues would be to enclose the
> > > >
> > > >
> > > >
> > > > Richard Braman
> > > > mailto:[hidden email]
> > > > 561.748.4002 (voice)
> > > >
> > > > http://www.taxcodesoftware.org
> > > > Free Open Source Tax Software
> > > >
> > > >
> > > > --
> > > > 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
> >
> >
> >
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: Transforming instance using XSLT

Richard Braman
OK Alex that seemed to work, with a few unresolved issues....
The text seems to have a lot of spacing in it.  I need to have all of
the text in a line with no spaces.  My stylesheet follows the  output.
I also tried to add Content-Disposition="attachment" to see if that
would prompt the user to save but nothing happened.  Also the &#xa0; did
not get translated to text.  I think I can solve that with translate
though.

Output................

1017****RET&#xa0;&#xa0;&#xa0;1040Z&#xa0;PG01&#xa0;&#xa0;200512&#xa0;
                                 [0010]
                         400001001
                                 [0030]
                         400002001
                                 [0060]
                         TEST I<WHY<GWEN KNOTT
                                 [0080]
                         12457 WILSHIRE-ON-THE-HAMPTONS BLVD
                                 [0083]
                         WYNOT
                                 [0087]
                         NE
                                 [0095]
                         68792
                                 [0375]
                         0
                                 [0378]
                         0
                                 [0380]
                         63
                                 [0552]
                         0
                                 [0750]
                         63
                                 [0815]
                         16400
                                 [0820]
                         0
                                 [1160]
                         0
                                 [1180]
                         399
                                 [1185]
                         6700
                                 [1250]
                         399
                                 [1256]
                         0
                                 [1270]
                         399
                                 [1272]
                         123456780
                                 [1274]
                         X
                                 [1278]
                         02135763
                                 [1307]
                         JOHN DOE
                                 [1309]
                         8885551111
                                 [1323]
                         MILITARY
                                 [1327]
                         HOUSEWIFE
                                 [1328]
                         8885551111
                                 [1360]
                         123456789
                                 [1370]
                         TCSF
                                 [1380]
                         123456789
                                 [1390]
                         JUPITER
                                 [1400]
                         FL
                                 [1410]
                         33469
                                 [1420]
                         5617484002#



<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xsl:template match="/">
                <document xsi:type="xs:string" content-type="text/plain"
Content-Disposition="attachment">
                        <xsl:for-each
select="doc('input:instance')/form/f1040ez/*[. ne '']">
                                <xsl:if test="
                                substring-after(name(.),'SEQ') ne '' and

                                name(.) ne 'SEQ0000' and
                                name(.) ne 'SEQ0001' and
                                name(.) ne 'SEQ0002' and
                                name(.) ne 'SEQ0004' and
                                name(.) ne 'SEQ0005' and
                                name(.) ne 'SEQ0006'
                                ">
                                 [<xsl:value-of select="
substring-after(name(.),'SEQ') "/>]
                         </xsl:if>
                                <xsl:value-of select="."/>
                        </xsl:for-each>
                </document>
        </xsl:template>
</xsl:stylesheet>


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Monday, March 13, 2006 9:38 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Richard,

OK, then try to generate in your view an XML document that looks like:

<document xsi:type="xs:string" content-type="text/plain">
    Your text here
</document>

This will be recognized by the epilogue and sent as text to the user. If
you look at the epilogue, you will see there is a test: <p:when
test="/document[@xsi:type]">. When the root of your document has a
<document xsi:type="...">, the HTTP serializer runs. For more about the
text mode, see:

http://www.orbeon.com/ops/doc/processors-serializers-http#text-mode

Alex

On 3/13/06, Richard Braman <[hidden email]> wrote:
> Yes.  I want to generate  text file to be sent to the user, or even to

> be saved somewhere on the server.
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Monday, March 13, 2006 4:34 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> The same applies to the view, i.e. the view is expected to generate
> XML. In your case, do you want to generate a text file to be sent to
> the user?
>
> Alex
>
> On 3/13/06, Richard Braman <[hidden email]> wrote:
> > I followed your recommendations and I didn't think I was using XPL.
> > This is a view.  What is the problem here?
> >
> > > Hi Richard,
> > >
> > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > action="someURI"/>. This will make a request at someURI.
> > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"

> > > view="your-file.xsl">. This will run your-file.xsl.
> > > 3) In your-file.xsl, use doc('input:instance') to have access to
> > > the
>
> > > submitted instance and generate the page you want based on the
> > > submitted instance.
> > >
> > > So actually, you don't even need XPL in this case.
> > >
> > > Alex
> >
> > The whole thread is below.
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Alessandro Vernet
> > Sent: Monday, March 13, 2006 4:12 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Transforming instance using XSLT
> >
> >
> > Richard,
> >
> > The <xsl:output method="text"/> can cause some problem. When you use

> > the XSLT processor with XPL, it is assumed that you will generate
> > XML.
>
> > If you want to transform XML into text, you might want to look at
> > the Text converter.
> >
> > http://www.orbeon.com/ops/doc/processors-converters
> >
> > Also, to see what you have in input:instance, you can use
> > <xsl:message><xsl:copy-of
> > select="doc('input:instance')"/></xsl:message>, which will log the
> > instance.
> >
> > Alex
> >
> > On 3/10/06, Richard Braman <[hidden email]> wrote:
> > > Obviously that wont work because match="<pattern" ok.  So I tried:
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > >         <xsl:output method="text"/>
> > >         <xsl:template match="/">
> > >                 <xsl:for-each
> > select="doc('input:instance')/f1040ez/*">
> > >                          [<xsl:value-of
> > > select="substring-after(name(.),'SEQ') "/>]
> > >                          <xsl:value-of select="."/>
> > >                 </xsl:for-each>
> > >         </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > And it doesn't bomb but doesn't output anything.  Getting closer.
> > >
> > > -----Original Message-----
> > > From: Richard Braman [mailto:[hidden email]]
> > > Sent: Friday, March 10, 2006 10:00 AM
> > > To: [hidden email]
> > > Subject: RE: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Hi Alex
> > >
> > > Where do I put the doc('input:instance')
> > > In the stylesheet
> > >
> > > I know this doesn't work:
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > >         <xsl:output method="text"/>
> > >         <xsl:template match="doc('input:instance')//form">
> > >                 <xsl:for-each select="*/*[. != '']">
> > >          [<xsl:value-of select="substring-after(name(.),'SEQ')
"/>]

> > >          <xsl:value-of select="."/>
> > >                 </xsl:for-each>
> > >         </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > Richard
> > >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > Alessandro Vernet
> > > Sent: Thursday, March 09, 2006 8:07 PM
> > > To: [hidden email]
> > > Subject: Re: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Hi Richard,
> > >
> > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > action="someURI"/>. This will make a request at someURI.
> > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"

> > > view="your-file.xsl">. This will run your-file.xsl.
> > > 3) In your-file.xsl, use doc('input:instance') to have access to
> > > the
>
> > > submitted instance and generate the page you want based on the
> > > submitted instance.
> > >
> > > So actually, you don't even need XPL in this case.
> > >
> > > Alex
> > >
> > > On 3/6/06, Richard Braman <[hidden email]> wrote:
> > > >
> > > > Now that I am back into XPL (now that most of my Xforms controls

> > > > are
> >
> > > > done for 1040EZ, except a few bugs) My learning cure is back to
> > > > steep. I want to call  xpl pipeline to convert my xforms
> > > > instance into a text
> > > file
> > > > using the following xslt on my instance and return the rsults as

> > > > in a window, or better yet prmot the user to save them on a
> > > > trigger.
> > > >
> > > > I am not sure where to put my xslt.
> > > >
> > > > I am still also having problems serializing instance and using
> > > > upload controls.
> > > >
> > > >
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > >   <xsl:output method="text"/>
> > > >     <xsl:template match="//form">
> > > >     <xsl:for-each select="*/*[. != '']">
> > > >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > > > "/>]
> > > >   <xsl:value-of select="."/>
> > > >   </xsl:for-each>
> > > >    </xsl:template>
> > > > </xsl:stylesheet>
> > > > </p:config>
> > > >
> > > > how would i go about doing this?
> > > >
> > > > My gues would be to enclose the
> > > >
> > > >
> > > >
> > > > Richard Braman
> > > > mailto:[hidden email]
> > > > 561.748.4002 (voice)
> > > >
> > > > http://www.taxcodesoftware.org
> > > > Free Open Source Tax Software
> > > >
> > > >
> > > > --
> > > > 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
> >
> >
> >
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: Transforming instance using XSLT

Richard Braman
Hold on, I have it working, it seems un pretty printing it makes a
difference.  
1017****RET   1040Z PG01  200512
[0010]400001001[0030]400002001[0060]TEST I<WHY<GWEN KNOTT[0080]12457
WILSHIRE-ON-THE-HAMPTONS
BLVD[0083]WYNOT[0087]NE[0095]68792[0375]0[0378]0[0380]63[0552]0[0750]63[
0815]16400[0820]0[1160]0[1180]399[1185]6700[1250]399[1256]0[1270]399[127
2]123456780[1274]X[1278]02135763[1307]JOHN
DOE[1309]8885551111[1323]MILITARY[1327]HOUSEWIFE[1328]8885551111[1360]12
3456789[1370]TCSF[1380]123456789[1390]JUPITER[1400]FL[1410]33469[1420]56
17484002#

I would also like to know how to send it as an attachment.

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Monday, March 13, 2006 10:26 PM
To: [hidden email]
Subject: RE: [ops-users] Transforming instance using XSLT


OK Alex that seemed to work, with a few unresolved issues.... The text
seems to have a lot of spacing in it.  I need to have all of the text in
a line with no spaces.  My stylesheet follows the  output. I also tried
to add Content-Disposition="attachment" to see if that would prompt the
user to save but nothing happened.  Also the &#xa0; did not get
translated to text.  I think I can solve that with translate though.

Output................

1017****RET&#xa0;&#xa0;&#xa0;1040Z&#xa0;PG01&#xa0;&#xa0;200512&#xa0;
                                 [0010]
                         400001001
                                 [0030]
                         400002001
                                 [0060]
                         TEST I<WHY<GWEN KNOTT
                                 [0080]
                         12457 WILSHIRE-ON-THE-HAMPTONS BLVD
                                 [0083]
                         WYNOT
                                 [0087]
                         NE
                                 [0095]
                         68792
                                 [0375]
                         0
                                 [0378]
                         0
                                 [0380]
                         63
                                 [0552]
                         0
                                 [0750]
                         63
                                 [0815]
                         16400
                                 [0820]
                         0
                                 [1160]
                         0
                                 [1180]
                         399
                                 [1185]
                         6700
                                 [1250]
                         399
                                 [1256]
                         0
                                 [1270]
                         399
                                 [1272]
                         123456780
                                 [1274]
                         X
                                 [1278]
                         02135763
                                 [1307]
                         JOHN DOE
                                 [1309]
                         8885551111
                                 [1323]
                         MILITARY
                                 [1327]
                         HOUSEWIFE
                                 [1328]
                         8885551111
                                 [1360]
                         123456789
                                 [1370]
                         TCSF
                                 [1380]
                         123456789
                                 [1390]
                         JUPITER
                                 [1400]
                         FL
                                 [1410]
                         33469
                                 [1420]
                         5617484002#



<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xsl:template match="/">
                <document xsi:type="xs:string" content-type="text/plain"
Content-Disposition="attachment">
                        <xsl:for-each
select="doc('input:instance')/form/f1040ez/*[. ne '']">
                                <xsl:if test="
                                substring-after(name(.),'SEQ') ne '' and

                                name(.) ne 'SEQ0000' and
                                name(.) ne 'SEQ0001' and
                                name(.) ne 'SEQ0002' and
                                name(.) ne 'SEQ0004' and
                                name(.) ne 'SEQ0005' and
                                name(.) ne 'SEQ0006'
                                ">
                                 [<xsl:value-of select="
substring-after(name(.),'SEQ') "/>]
                         </xsl:if>
                                <xsl:value-of select="."/>
                        </xsl:for-each>
                </document>
        </xsl:template>
</xsl:stylesheet>


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Monday, March 13, 2006 9:38 PM
To: [hidden email]
Subject: Re: [ops-users] Transforming instance using XSLT


Richard,

OK, then try to generate in your view an XML document that looks like:

<document xsi:type="xs:string" content-type="text/plain">
    Your text here
</document>

This will be recognized by the epilogue and sent as text to the user. If
you look at the epilogue, you will see there is a test: <p:when
test="/document[@xsi:type]">. When the root of your document has a
<document xsi:type="...">, the HTTP serializer runs. For more about the
text mode, see:

http://www.orbeon.com/ops/doc/processors-serializers-http#text-mode

Alex

On 3/13/06, Richard Braman <[hidden email]> wrote:
> Yes.  I want to generate  text file to be sent to the user, or even to

> be saved somewhere on the server.
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Monday, March 13, 2006 4:34 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> The same applies to the view, i.e. the view is expected to generate
> XML. In your case, do you want to generate a text file to be sent to
> the user?
>
> Alex
>
> On 3/13/06, Richard Braman <[hidden email]> wrote:
> > I followed your recommendations and I didn't think I was using XPL.
> > This is a view.  What is the problem here?
> >
> > > Hi Richard,
> > >
> > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > action="someURI"/>. This will make a request at someURI.
> > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"

> > > view="your-file.xsl">. This will run your-file.xsl.
> > > 3) In your-file.xsl, use doc('input:instance') to have access to
> > > the
>
> > > submitted instance and generate the page you want based on the
> > > submitted instance.
> > >
> > > So actually, you don't even need XPL in this case.
> > >
> > > Alex
> >
> > The whole thread is below.
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Alessandro Vernet
> > Sent: Monday, March 13, 2006 4:12 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Transforming instance using XSLT
> >
> >
> > Richard,
> >
> > The <xsl:output method="text"/> can cause some problem. When you use

> > the XSLT processor with XPL, it is assumed that you will generate
> > XML.
>
> > If you want to transform XML into text, you might want to look at
> > the Text converter.
> >
> > http://www.orbeon.com/ops/doc/processors-converters
> >
> > Also, to see what you have in input:instance, you can use
> > <xsl:message><xsl:copy-of
> > select="doc('input:instance')"/></xsl:message>, which will log the
> > instance.
> >
> > Alex
> >
> > On 3/10/06, Richard Braman <[hidden email]> wrote:
> > > Obviously that wont work because match="<pattern" ok.  So I tried:
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > >         <xsl:output method="text"/>
> > >         <xsl:template match="/">
> > >                 <xsl:for-each
> > select="doc('input:instance')/f1040ez/*">
> > >                          [<xsl:value-of
> > > select="substring-after(name(.),'SEQ') "/>]
> > >                          <xsl:value-of select="."/>
> > >                 </xsl:for-each>
> > >         </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > And it doesn't bomb but doesn't output anything.  Getting closer.
> > >
> > > -----Original Message-----
> > > From: Richard Braman [mailto:[hidden email]]
> > > Sent: Friday, March 10, 2006 10:00 AM
> > > To: [hidden email]
> > > Subject: RE: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Hi Alex
> > >
> > > Where do I put the doc('input:instance')
> > > In the stylesheet
> > >
> > > I know this doesn't work:
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > >         <xsl:output method="text"/>
> > >         <xsl:template match="doc('input:instance')//form">
> > >                 <xsl:for-each select="*/*[. != '']">
> > >          [<xsl:value-of select="substring-after(name(.),'SEQ')
"/>]

> > >          <xsl:value-of select="."/>
> > >                 </xsl:for-each>
> > >         </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > Richard
> > >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > Alessandro Vernet
> > > Sent: Thursday, March 09, 2006 8:07 PM
> > > To: [hidden email]
> > > Subject: Re: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Hi Richard,
> > >
> > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > action="someURI"/>. This will make a request at someURI.
> > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"

> > > view="your-file.xsl">. This will run your-file.xsl.
> > > 3) In your-file.xsl, use doc('input:instance') to have access to
> > > the
>
> > > submitted instance and generate the page you want based on the
> > > submitted instance.
> > >
> > > So actually, you don't even need XPL in this case.
> > >
> > > Alex
> > >
> > > On 3/6/06, Richard Braman <[hidden email]> wrote:
> > > >
> > > > Now that I am back into XPL (now that most of my Xforms controls

> > > > are
> >
> > > > done for 1040EZ, except a few bugs) My learning cure is back to
> > > > steep. I want to call  xpl pipeline to convert my xforms
> > > > instance into a text
> > > file
> > > > using the following xslt on my instance and return the rsults as

> > > > in a window, or better yet prmot the user to save them on a
> > > > trigger.
> > > >
> > > > I am not sure where to put my xslt.
> > > >
> > > > I am still also having problems serializing instance and using
> > > > upload controls.
> > > >
> > > >
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > >   <xsl:output method="text"/>
> > > >     <xsl:template match="//form">
> > > >     <xsl:for-each select="*/*[. != '']">
> > > >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > > > "/>]
> > > >   <xsl:value-of select="."/>
> > > >   </xsl:for-each>
> > > >    </xsl:template>
> > > > </xsl:stylesheet>
> > > > </p:config>
> > > >
> > > > how would i go about doing this?
> > > >
> > > > My gues would be to enclose the
> > > >
> > > >
> > > >
> > > > Richard Braman
> > > > mailto:[hidden email]
> > > > 561.748.4002 (voice)
> > > >
> > > > http://www.taxcodesoftware.org
> > > > Free Open Source Tax Software
> > > >
> > > >
> > > > --
> > > > 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
> >
> >
> >
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Transforming instance using XSLT

Alessandro  Vernet
Administrator
Richard,

Just a note about the spacing, instead of:
    [<xsl:value-of select="substring-after(name(.),'SEQ') "/>]
You might want to write:
    <xsl:text>[</xsl:text>
    <xsl:value-of select="substring-after(name(.),'SEQ') "/>
    <xsl:text>]</xsl:text>

By putting all the non-whitespace character in <xsl:text> you make
sure that other whitespace characters that are around the "[" and "]"
won't get into your output. There must be a better way to explain this
:), but I hope this gets the idea through. For reference, here is the
specification for <xsl:text>:

http://www.w3.org/TR/xslt20/#xsl-text

Alex

On 3/13/06, Richard Braman <[hidden email]> wrote:

> Hold on, I have it working, it seems un pretty printing it makes a
> difference.
> 1017****RET   1040Z PG01  200512
> [0010]400001001[0030]400002001[0060]TEST I<WHY<GWEN KNOTT[0080]12457
> WILSHIRE-ON-THE-HAMPTONS
> BLVD[0083]WYNOT[0087]NE[0095]68792[0375]0[0378]0[0380]63[0552]0[0750]63[
> 0815]16400[0820]0[1160]0[1180]399[1185]6700[1250]399[1256]0[1270]399[127
> 2]123456780[1274]X[1278]02135763[1307]JOHN
> DOE[1309]8885551111[1323]MILITARY[1327]HOUSEWIFE[1328]8885551111[1360]12
> 3456789[1370]TCSF[1380]123456789[1390]JUPITER[1400]FL[1410]33469[1420]56
> 17484002#
>
> I would also like to know how to send it as an attachment.
>
> -----Original Message-----
> From: Richard Braman [mailto:[hidden email]]
> Sent: Monday, March 13, 2006 10:26 PM
> To: [hidden email]
> Subject: RE: [ops-users] Transforming instance using XSLT
>
>
> OK Alex that seemed to work, with a few unresolved issues.... The text
> seems to have a lot of spacing in it.  I need to have all of the text in
> a line with no spaces.  My stylesheet follows the  output. I also tried
> to add Content-Disposition="attachment" to see if that would prompt the
> user to save but nothing happened.  Also the &#xa0; did not get
> translated to text.  I think I can solve that with translate though.
>
> Output................
>
> 1017****RET&#xa0;&#xa0;&#xa0;1040Z&#xa0;PG01&#xa0;&#xa0;200512&#xa0;
>                                  [0010]
>                          400001001
>                                  [0030]
>                          400002001
>                                  [0060]
>                          TEST I<WHY<GWEN KNOTT
>                                  [0080]
>                          12457 WILSHIRE-ON-THE-HAMPTONS BLVD
>                                  [0083]
>                          WYNOT
>                                  [0087]
>                          NE
>                                  [0095]
>                          68792
>                                  [0375]
>                          0
>                                  [0378]
>                          0
>                                  [0380]
>                          63
>                                  [0552]
>                          0
>                                  [0750]
>                          63
>                                  [0815]
>                          16400
>                                  [0820]
>                          0
>                                  [1160]
>                          0
>                                  [1180]
>                          399
>                                  [1185]
>                          6700
>                                  [1250]
>                          399
>                                  [1256]
>                          0
>                                  [1270]
>                          399
>                                  [1272]
>                          123456780
>                                  [1274]
>                          X
>                                  [1278]
>                          02135763
>                                  [1307]
>                          JOHN DOE
>                                  [1309]
>                          8885551111
>                                  [1323]
>                          MILITARY
>                                  [1327]
>                          HOUSEWIFE
>                                  [1328]
>                          8885551111
>                                  [1360]
>                          123456789
>                                  [1370]
>                          TCSF
>                                  [1380]
>                          123456789
>                                  [1390]
>                          JUPITER
>                                  [1400]
>                          FL
>                                  [1410]
>                          33469
>                                  [1420]
>                          5617484002#
>
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>         <xsl:template match="/">
>                 <document xsi:type="xs:string" content-type="text/plain"
> Content-Disposition="attachment">
>                         <xsl:for-each
> select="doc('input:instance')/form/f1040ez/*[. ne '']">
>                                 <xsl:if test="
>                                 substring-after(name(.),'SEQ') ne '' and
>
>                                 name(.) ne 'SEQ0000' and
>                                 name(.) ne 'SEQ0001' and
>                                 name(.) ne 'SEQ0002' and
>                                 name(.) ne 'SEQ0004' and
>                                 name(.) ne 'SEQ0005' and
>                                 name(.) ne 'SEQ0006'
>                                 ">
>                                  [<xsl:value-of select="
> substring-after(name(.),'SEQ') "/>]
>                          </xsl:if>
>                                 <xsl:value-of select="."/>
>                         </xsl:for-each>
>                 </document>
>         </xsl:template>
> </xsl:stylesheet>
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Alessandro Vernet
> Sent: Monday, March 13, 2006 9:38 PM
> To: [hidden email]
> Subject: Re: [ops-users] Transforming instance using XSLT
>
>
> Richard,
>
> OK, then try to generate in your view an XML document that looks like:
>
> <document xsi:type="xs:string" content-type="text/plain">
>     Your text here
> </document>
>
> This will be recognized by the epilogue and sent as text to the user. If
> you look at the epilogue, you will see there is a test: <p:when
> test="/document[@xsi:type]">. When the root of your document has a
> <document xsi:type="...">, the HTTP serializer runs. For more about the
> text mode, see:
>
> http://www.orbeon.com/ops/doc/processors-serializers-http#text-mode
>
> Alex
>
> On 3/13/06, Richard Braman <[hidden email]> wrote:
> > Yes.  I want to generate  text file to be sent to the user, or even to
>
> > be saved somewhere on the server.
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Alessandro Vernet
> > Sent: Monday, March 13, 2006 4:34 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Transforming instance using XSLT
> >
> >
> > The same applies to the view, i.e. the view is expected to generate
> > XML. In your case, do you want to generate a text file to be sent to
> > the user?
> >
> > Alex
> >
> > On 3/13/06, Richard Braman <[hidden email]> wrote:
> > > I followed your recommendations and I didn't think I was using XPL.
> > > This is a view.  What is the problem here?
> > >
> > > > Hi Richard,
> > > >
> > > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > > action="someURI"/>. This will make a request at someURI.
> > > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
>
> > > > view="your-file.xsl">. This will run your-file.xsl.
> > > > 3) In your-file.xsl, use doc('input:instance') to have access to
> > > > the
> >
> > > > submitted instance and generate the page you want based on the
> > > > submitted instance.
> > > >
> > > > So actually, you don't even need XPL in this case.
> > > >
> > > > Alex
> > >
> > > The whole thread is below.
> > >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > Alessandro Vernet
> > > Sent: Monday, March 13, 2006 4:12 PM
> > > To: [hidden email]
> > > Subject: Re: [ops-users] Transforming instance using XSLT
> > >
> > >
> > > Richard,
> > >
> > > The <xsl:output method="text"/> can cause some problem. When you use
>
> > > the XSLT processor with XPL, it is assumed that you will generate
> > > XML.
> >
> > > If you want to transform XML into text, you might want to look at
> > > the Text converter.
> > >
> > > http://www.orbeon.com/ops/doc/processors-converters
> > >
> > > Also, to see what you have in input:instance, you can use
> > > <xsl:message><xsl:copy-of
> > > select="doc('input:instance')"/></xsl:message>, which will log the
> > > instance.
> > >
> > > Alex
> > >
> > > On 3/10/06, Richard Braman <[hidden email]> wrote:
> > > > Obviously that wont work because match="<pattern" ok.  So I tried:
> > > >
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > > >         <xsl:output method="text"/>
> > > >         <xsl:template match="/">
> > > >                 <xsl:for-each
> > > select="doc('input:instance')/f1040ez/*">
> > > >                          [<xsl:value-of
> > > > select="substring-after(name(.),'SEQ') "/>]
> > > >                          <xsl:value-of select="."/>
> > > >                 </xsl:for-each>
> > > >         </xsl:template>
> > > > </xsl:stylesheet>
> > > >
> > > > And it doesn't bomb but doesn't output anything.  Getting closer.
> > > >
> > > > -----Original Message-----
> > > > From: Richard Braman [mailto:[hidden email]]
> > > > Sent: Friday, March 10, 2006 10:00 AM
> > > > To: [hidden email]
> > > > Subject: RE: [ops-users] Transforming instance using XSLT
> > > >
> > > >
> > > > Hi Alex
> > > >
> > > > Where do I put the doc('input:instance')
> > > > In the stylesheet
> > > >
> > > > I know this doesn't work:
> > > >
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > > xmlns:xforms="http://www.w3.org/2002/xforms">
> > > >         <xsl:output method="text"/>
> > > >         <xsl:template match="doc('input:instance')//form">
> > > >                 <xsl:for-each select="*/*[. != '']">
> > > >          [<xsl:value-of select="substring-after(name(.),'SEQ')
> "/>]
> > > >          <xsl:value-of select="."/>
> > > >                 </xsl:for-each>
> > > >         </xsl:template>
> > > > </xsl:stylesheet>
> > > >
> > > > Richard
> > > >
> > > > -----Original Message-----
> > > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > > Alessandro Vernet
> > > > Sent: Thursday, March 09, 2006 8:07 PM
> > > > To: [hidden email]
> > > > Subject: Re: [ops-users] Transforming instance using XSLT
> > > >
> > > >
> > > > Hi Richard,
> > > >
> > > > 1) In XForms, you can execute a <xforms:submission replace="all"
> > > > action="someURI"/>. This will make a request at someURI.
> > > > 2) Then in the page-flow.xml, you have a <page path-info="someURI"
>
> > > > view="your-file.xsl">. This will run your-file.xsl.
> > > > 3) In your-file.xsl, use doc('input:instance') to have access to
> > > > the
> >
> > > > submitted instance and generate the page you want based on the
> > > > submitted instance.
> > > >
> > > > So actually, you don't even need XPL in this case.
> > > >
> > > > Alex
> > > >
> > > > On 3/6/06, Richard Braman <[hidden email]> wrote:
> > > > >
> > > > > Now that I am back into XPL (now that most of my Xforms controls
>
> > > > > are
> > >
> > > > > done for 1040EZ, except a few bugs) My learning cure is back to
> > > > > steep. I want to call  xpl pipeline to convert my xforms
> > > > > instance into a text
> > > > file
> > > > > using the following xslt on my instance and return the rsults as
>
> > > > > in a window, or better yet prmot the user to save them on a
> > > > > trigger.
> > > > >
> > > > > I am not sure where to put my xslt.
> > > > >
> > > > > I am still also having problems serializing instance and using
> > > > > upload controls.
> > > > >
> > > > >
> > > > > <xsl:stylesheet version="1.0"
> > > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > > >   <xsl:output method="text"/>
> > > > >     <xsl:template match="//form">
> > > > >     <xsl:for-each select="*/*[. != '']">
> > > > >   [<xsl:value-of select="substring-after(name(.),'SEQ')
> > > > > "/>]
> > > > >   <xsl:value-of select="."/>
> > > > >   </xsl:for-each>
> > > > >    </xsl:template>
> > > > > </xsl:stylesheet>
> > > > > </p:config>
> > > > >
> > > > > how would i go about doing this?
> > > > >
> > > > > My gues would be to enclose the
> > > > >
> > > > >
> > > > >
> > > > > Richard Braman
> > > > > mailto:[hidden email]
> > > > > 561.748.4002 (voice)
> > > > >
> > > > > http://www.taxcodesoftware.org
> > > > > Free Open Source Tax Software
> > > > >
> > > > >
> > > > > --
> > > > > 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
> > >
> > >
> > >
> >
> >
> > --
> > 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
>
>
>

--
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