problems xxforms:serialize

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

problems xxforms:serialize

FParsons
OK, I'm not sure exactly where the problem lies, but here's what I'm trying to do.

I have a form (using <fr:tabview>) where I want to put a "preview" in one of the tabs. I want to use "xxforms:call-xpl()" to run a stylesheet on the main instance that will run when the user selects the "preview" tab. I have the output of "call-xpl" copied to an instance to hold the html:

        <xforms:insert context="instance('preview-instance')/html-data" origin="xxforms:call-xpl('oxf:/apps/cc-test/preview-transform.xpl', 'data', instance('questionnaire-instance'), 'data')"/>

I then have an <xforms:output mediatype="text\html"/> to display this output via xxforms:serialize:

<xforms:output mediatype="text/html" value="xxforms:serialize(instance('preview-instance'), 'html')"/>

This works fine with my stylesheet most of the time, but the content I'm previewing can have html markup in it. (It's a "questionnaire editor" where the user can change the text and add bolding, underlining, etc, via the HTML editor). It could look like this:

<QUESTION_TEXT>
<p>Here is some text that's <strong>bolded</strong>, <em>italicized</em>, and <u>underlined</u>.</p>
</QUESTION_TEXT>

The html output of the stylesheet will show the same markup, but the output element (mentioned above) doesn't show it as styled HTML, it shows the tags as text. Other HTML markup displays as it should (I have a separate stylesheet for the "preview.xsl", it's apparently just the stuff that's created by the HTML editor.

I don't know if this is enough information, but can anyone spot something I'm doing wrong? I appreciate any kind of help with this.  
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: problems xxforms:serialize

FParsons
I forgot to add that if I paste the html produced by the stylsheet directly in the form page (I have Orbeon Forms inspector in one of the tabs), it renders correctly.

Also, if I paste that stylesheet  output into an instance, and use

<xforms:output mediatype="text/html" value="xxforms:serialize(instance('preview-instance')/test, 'html')"/>

to look at it, it renders fine (i.e.,strong elements are bolded instead of showing the tags) - including all the css classes the stylesheet uses.



-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: problems xxforms:serialize

Louis Ratzesberger-2
In reply to this post by FParsons

Francis,

Have you also tried serializing in the 'text' or 'xml' ?

Sorry, but I'm not sure if it is the serialize function or the output  
element that is doing the entity escaping.

--Hank

Quoting FParsons <[hidden email]>:

>
> OK, I'm not sure exactly where the problem lies, but here's what I'm trying
> to do.
>
> I have a form (using <fr:tabview>) where I want to put a "preview" in one of
> the tabs. I want to use "xxforms:call-xpl()" to run a stylesheet on the main
> instance that will run when the user selects the "preview" tab. I have the
> output of "call-xpl" copied to an instance to hold the html:
>
> <xforms:insert context="instance('preview-instance')/html-data"
> origin="xxforms:call-xpl('oxf:/apps/cc-test/preview-transform.xpl', 'data',
> instance('questionnaire-instance'), 'data')"/>
>
> I then have an <xforms:output mediatype="text\html"/> to display this output
> via xxforms:serialize:
>
> <xforms:output mediatype="text/html"
> value="xxforms:serialize(instance('preview-instance'), 'html')"/>
>
> This works fine with my stylesheet most of the time, but the content I'm
> previewing can have html markup in it. (It's a "questionnaire editor" where
> the user can change the text and add bolding, underlining, etc, via the HTML
> editor). It could look like this:
>
> <QUESTION_TEXT>
> <p>Here is some text that's <strong>bolded</strong>, <em>italicized</em>,
> and <u>underlined</u>.</p>
> </QUESTION_TEXT>
>
> The html output of the stylesheet will show the same markup, but the output
> element (mentioned above) doesn't show it as styled HTML, it shows the tags
> as text. Other HTML markup displays as it should (I have a separate
> stylesheet for the "preview.xsl", it's apparently just the stuff that's
> created by the HTML editor.
>
> I don't know if this is enough information, but can anyone spot something
> I'm doing wrong? I appreciate any kind of help with this.
>
> -----
> -- Francis
> --
> View this message in context:  
> http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2257687.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>


--
Hank Ratzesberger
[hidden email]



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: problems xxforms:serialize

FParsons
Hank - I think I did try that, but I'd have to try that again to make sure. (I'm not at work right now).

Do you think this might have something to do with the sequence of events? You have the call-xpl to generate the html and then the xxforms:serialize going to the output element. If I paste that same html generated by the call-xpl into an instance and have a different output element with xxforms:serialize, it renders correctly. I did try having the action kicking off the call-xpl subsequently copy it to a different node, and have the output element read that, but the result was the same.  However, maybe one thing I could try is making it two manually activated steps: a trigger kicking off call-xpl to put xml in one node, then a trigger to copy the contents to another, and see if there's any difference.

Would you have an idea of a different method of achieving this "html preview" of the main instance without having to put it in an external window?


-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: problems xxforms:serialize

FParsons
In reply to this post by Louis Ratzesberger-2
Hank -

I did try different output types with xx:serialize just now:

html, xhtml, xml: escaped formatting is displayed
text: of course just shows the content of all the elements, however IE 7 *does* display the formatting properly

(BTW, it's probably not relevant, but I did try this in Opera (10.6) as well, the results were the same.)

Can you think of any reason why <xforms:output ref=xx:serialize()> would behave differently when reading html from an instance that's already there as opposed to html that's just been copied by call-xbl()? I did try using a trigger to copy the xsl (html) output to another node and then reading that with the <xforms:output ref="xx:serialize()>, but there was no difference.

Could pasting that html from Orbeon Forms Inspector into an instance be doing something that makes it work? Could this have something to do with encodings?
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: problems xxforms:serialize

Hoi Chong
Hi Francis,
Why not serialize the html-data at the XPL, and then store it into the instance('preview-instance')/html-data.
Then output the html-data using
<xforms:output mediatype="text/html" value="instance('preview-instance')/html-data"/>

You may need to serialize the html-data one more time before output.

Cheers.
HC
Reply | Threaded
Open this post in threaded view
|

Re: problems xxforms:serialize

FParsons
Hoi Chong wrote
Why not serialize the html-data at the XPL, and then store it into the instance('preview-instance')/html-data.
Thanks for the reply, but I wasn't sure exactly what you meant by "serialize the html-data at the XPL".

In my .xpl I have:

<?xml version="1.0" encoding="utf-8"?>

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf="http://www.orbeon.com/oxf/processors">

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

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#data"/>
        <p:input name="config" href="preview.xsl"/>
        <p:output name="data" ref="data"/>
    </p:processor>

</p:config>

Any help with this is welcome!
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: problems xxforms:serialize

Louis Ratzesberger-2

With no warranties, implied or otherwise.....

Is there no instance for this data, and no trigger or event that calls  
a submission to update that instance?

If you had no call-xpl() function, you would need a trigger element  
for the preview tab (which is also an XForms case element).  The  
trigger would run a submission that would update the instance data  
that the tab/case displays. The xpl service that responds to that  
submission would need to use http-serializer or xml-serializer  
elements to return serialized xml.

http://www.orbeon.com/orbeon/doc/processors-serializers

Anyway that is the idea behind "serialize the html data at the xpl" (I  
very much hope...) Your data would nevertheless need to be xhtml, that  
is, valid XML. The XForms 1.1 "mime-type" extension to the output  
element would take care of rendering it as html.

Maybe a code sample that runs in the sandbox is needed at this point.

--Hank


I assume that

Quoting FParsons <[hidden email]>:

>
>
> Hoi Chong wrote:
>>
>> Why not serialize the html-data at the XPL, and then store it into the
>> instance('preview-instance')/html-data.
>>
> Thanks for the reply, but I wasn't sure exactly what you meant by "serialize
> the html-data at the XPL".
>
> In my .xpl I have:
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>           xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>     <p:param type="input" name="data"/>
>     <p:param type="output" name="data"/>
>
>     <p:processor name="oxf:xslt">
>         <p:input name="data" href="#data"/>
>         <p:input name="config" href="preview.xsl"/>
>         <p:output name="data" ref="data"/>
>     </p:processor>
>
> </p:config>
>
> Any help with this is welcome!
>
> -----
> -- Francis
> --
> View this message in context:  
> http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2263119.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>


--
Hank Ratzesberger
[hidden email]



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: problems xxforms:serialize

Erik Bruchez
Administrator
In reply to this post by FParsons
Try <xforms:output mediatype="text/html" value="xxf:serialize(...)"/> instead of using the ref attribute.

Even if this works, this is still not ideal because this will re-evaluate at every refresh. What you want to do is store the serialized HTML into an instance upon calling xxf:call-xpl(), and do this upon an action.

-Erik

On Fri, Jun 18, 2010 at 6:22 AM, FParsons <[hidden email]> wrote:

Hank -

I did try different output types with xx:serialize just now:

html, xhtml, xml: escaped formatting is displayed
text: of course just shows the content of all the elements, however IE 7
*does* display the formatting properly

(BTW, it's probably not relevant, but I did try this in Opera (10.6) as
well, the results were the same.)

Can you think of any reason why <xforms:output ref=xx:serialize()> would
behave differently when reading html from an instance that's already there
as opposed to html that's just been copied by call-xbl()? I did try using a
trigger to copy the xsl (html) output to another node and then reading that
with the <xforms:output ref="xx:serialize()>, but there was no difference.

Could pasting that html from Orbeon Forms Inspector into an instance be
doing something that makes it work? Could this have something to do with
encodings?

-----
-- Francis
--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2260180.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: problems xxforms:serialize

FParsons
Erik - I already have tried:
<xforms:output mediatype="text/html" value="xxforms:serialize(instance('preview-instance')/html-data, 'html')"/>
an action does the "call-xpl()", which stores the html in an instance, and the output serialize it.
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: problems xxforms:serialize

FParsons
In reply to this post by Louis Ratzesberger-2
Hank - if you have the time, any further explanation would be welcomed. (I don't think yet have a grasp on using serializers.)

I have a bit of additional info, though:

to recap: I have a form with several tabs, one of them is a "review" tab. When this tab is activated, it runs an action with this code that runs a stylesheet on the main instance and stores the result in a different instance:

<xforms:insert context="instance('preview-instance')/html-data" origin="xxforms:call-xpl('oxf:/apps/cc-test/preview-transform.xpl', 'data', instance('questionnaire-instance'), 'data')"/>

An output element uses xxforms:serialize to display this html:

<xforms:output mediatype="text/html" value="xxforms:serialize(instance('preview-instance')/html-data, 'html')"/>

I am using the (YUI) rich text editor to modify the text in nodes (I'm limiting it to bold, italic, underline). From what I can tell, the text editor produces escaped greater-than and less-than characters.

I am using the Orbeon Form inspector to look at the text I'm modifying -  If I have it on "formatted text", the form inspector displays angle brackets, but if I have it on "plain text" I'll see the escaped angle brackets. The only instances of these unescaped brackets are those that have been generated by the YUI RTE, the rest of the HTML (generated by the stylesheet I'm calling) is regular brackets.

I suppose I need the HTML that will be submitted needs to have unescaped brackets in this text, because in FOP (when it's printed) I need to match these tags so they can be outputted as FO.

Any additional help with this would be greatly appreciated.

-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: problems xxforms:serialize

Alessandro  Vernet
Administrator
Francis,

Everything you're saying makes sense, and I agree with your
conclusion. What you have in instance('preview-instance')/html-data is
XHTML (not "CDATA"), so you should be fine passing that to FOP, right?

Alex

On Thu, Jul 1, 2010 at 8:48 AM, FParsons <[hidden email]> wrote:

>
> Hank - if you have the time, any further explanation would be welcomed. (I
> don't think yet have a grasp on using serializers.)
>
> I have a bit of additional info, though:
>
> to recap: I have a form with several tabs, one of them is a "review" tab.
> When this tab is activated, it runs an action with this code that runs a
> stylesheet on the main instance and stores the result in a different
> instance:
>
> <xforms:insert context="instance('preview-instance')/html-data"
> origin="xxforms:call-xpl('oxf:/apps/cc-test/preview-transform.xpl', 'data',
> instance('questionnaire-instance'), 'data')"/>
>
> An output element uses xxforms:serialize to display this html:
>
> <xforms:output mediatype="text/html"
> value="xxforms:serialize(instance('preview-instance')/html-data, 'html')"/>
>
> I am using the (YUI) rich text editor to modify the text in nodes (I'm
> limiting it to bold, italic, underline). From what I can tell, the text
> editor produces escaped greater-than and less-than characters.
>
> I am using the Orbeon Form inspector to look at the text I'm modifying -  If
> I have it on "formatted text", the form inspector displays angle brackets,
> but if I have it on "plain text" I'll see the escaped angle brackets. The
> only instances of these unescaped brackets are those that have been
> generated by the YUI RTE, the rest of the HTML (generated by the stylesheet
> I'm calling) is regular brackets.
>
> I suppose I need the HTML that will be submitted needs to have unescaped
> brackets in this text, because in FOP (when it's printed) I need to match
> these tags so they can be outputted as FO.
>
> Any additional help with this would be greatly appreciated.
>
>
>
> -----
> -- Francis
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2275333.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: problems xxforms:serialize

FParsons
Alex - the main instance (that gets built by the xform), not the
"preview-instance" is what's going to get passed to FOP. However, the
main instance contains these escaped angle brackets that the RTE
produces too (they are output from the "preview.xsl" unchanged).

Forgive my blatant ignorance, but if these escaped angle brackets are
present in the XML fed to the FOP stylesheet, won't I be unable to match
them (to produce the required FO)?

I'll have to give this a try at some point, but I can't yet because the
FOP stylesheet needs some work because of some changes I made along the way.

--- Francis
On 7/1/2010 3:14 PM, Alessandro Vernet wrote:

> Francis,
>
> Everything you're saying makes sense, and I agree with your
> conclusion. What you have in instance('preview-instance')/html-data is
> XHTML (not "CDATA"), so you should be fine passing that to FOP, right?
>
> Alex
>
> On Thu, Jul 1, 2010 at 8:48 AM, FParsons<[hidden email]>  wrote:
>    
>> Hank - if you have the time, any further explanation would be welcomed. (I
>> don't think yet have a grasp on using serializers.)
>>
>> I have a bit of additional info, though:
>>
>> to recap: I have a form with several tabs, one of them is a "review" tab.
>> When this tab is activated, it runs an action with this code that runs a
>> stylesheet on the main instance and stores the result in a different
>> instance:
>>
>> <xforms:insert context="instance('preview-instance')/html-data"
>> origin="xxforms:call-xpl('oxf:/apps/cc-test/preview-transform.xpl', 'data',
>> instance('questionnaire-instance'), 'data')"/>
>>
>> An output element uses xxforms:serialize to display this html:
>>
>> <xforms:output mediatype="text/html"
>> value="xxforms:serialize(instance('preview-instance')/html-data, 'html')"/>
>>
>> I am using the (YUI) rich text editor to modify the text in nodes (I'm
>> limiting it to bold, italic, underline). From what I can tell, the text
>> editor produces escaped greater-than and less-than characters.
>>
>> I am using the Orbeon Form inspector to look at the text I'm modifying -  If
>> I have it on "formatted text", the form inspector displays angle brackets,
>> but if I have it on "plain text" I'll see the escaped angle brackets. The
>> only instances of these unescaped brackets are those that have been
>> generated by the YUI RTE, the rest of the HTML (generated by the stylesheet
>> I'm calling) is regular brackets.
>>
>> I suppose I need the HTML that will be submitted needs to have unescaped
>> brackets in this text, because in FOP (when it's printed) I need to match
>> these tags so they can be outputted as FO.
>>
>> Any additional help with this would be greatly appreciated.
>>
>>
>>
>> -----
>> -- Francis
>> --
>> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2275333.html
>> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>>
>>
>> --
>> 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
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>>      
>
>
>    

--
--- Francis




--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: problems xxforms:serialize

Alessandro  Vernet
Administrator
Francis,

Right, the RTE produces XML as "text/CDATA". So it you want it as
"real XML" in an instance, you need to use saxon:parse(), which is the
opposite of saxon:serialize(). If this doesn't help, I'll have to ask
you to create a reproducible example that shows the issue you're
describing.

Alex

On Thu, Jul 1, 2010 at 1:34 PM, Francis Parsons <[hidden email]> wrote:

> Alex - the main instance (that gets built by the xform), not the
> "preview-instance" is what's going to get passed to FOP. However, the main
> instance contains these escaped angle brackets that the RTE produces too
> (they are output from the "preview.xsl" unchanged).
>
> Forgive my blatant ignorance, but if these escaped angle brackets are
> present in the XML fed to the FOP stylesheet, won't I be unable to match
> them (to produce the required FO)?
>
> I'll have to give this a try at some point, but I can't yet because the FOP
> stylesheet needs some work because of some changes I made along the way.
>
> --- Francis
> On 7/1/2010 3:14 PM, Alessandro Vernet wrote:
>>
>> Francis,
>>
>> Everything you're saying makes sense, and I agree with your
>> conclusion. What you have in instance('preview-instance')/html-data is
>> XHTML (not "CDATA"), so you should be fine passing that to FOP, right?
>>
>> Alex
>>
>> On Thu, Jul 1, 2010 at 8:48 AM, FParsons<[hidden email]>  wrote:
>>
>>>
>>> Hank - if you have the time, any further explanation would be welcomed.
>>> (I
>>> don't think yet have a grasp on using serializers.)
>>>
>>> I have a bit of additional info, though:
>>>
>>> to recap: I have a form with several tabs, one of them is a "review" tab.
>>> When this tab is activated, it runs an action with this code that runs a
>>> stylesheet on the main instance and stores the result in a different
>>> instance:
>>>
>>> <xforms:insert context="instance('preview-instance')/html-data"
>>> origin="xxforms:call-xpl('oxf:/apps/cc-test/preview-transform.xpl',
>>> 'data',
>>> instance('questionnaire-instance'), 'data')"/>
>>>
>>> An output element uses xxforms:serialize to display this html:
>>>
>>> <xforms:output mediatype="text/html"
>>> value="xxforms:serialize(instance('preview-instance')/html-data,
>>> 'html')"/>
>>>
>>> I am using the (YUI) rich text editor to modify the text in nodes (I'm
>>> limiting it to bold, italic, underline). From what I can tell, the text
>>> editor produces escaped greater-than and less-than characters.
>>>
>>> I am using the Orbeon Form inspector to look at the text I'm modifying -
>>>  If
>>> I have it on "formatted text", the form inspector displays angle
>>> brackets,
>>> but if I have it on "plain text" I'll see the escaped angle brackets. The
>>> only instances of these unescaped brackets are those that have been
>>> generated by the YUI RTE, the rest of the HTML (generated by the
>>> stylesheet
>>> I'm calling) is regular brackets.
>>>
>>> I suppose I need the HTML that will be submitted needs to have unescaped
>>> brackets in this text, because in FOP (when it's printed) I need to match
>>> these tags so they can be outputted as FO.
>>>
>>> Any additional help with this would be greatly appreciated.
>>>
>>>
>>>
>>> -----
>>> -- Francis
>>> --
>>> View this message in context:
>>> http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2275333.html
>>> Sent from the Orbeon Forms (ops-users) mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> --
>>> 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
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> --- Francis
>
>
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: problems xxforms:serialize

FParsons
Alex - I'm working on creating an example zip file for you to look at, I'll post again when it's done.
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: problems xxforms:serialize

FParsons
In reply to this post by Alessandro Vernet
Alex -

I have attached a zip of a folder that you can drop in under /resources/apps. This shows essentially what I'm trying to do: have nodes of text that you can edit and format with the Yahoo RTE, and a 'preview' page that allows the user to view all the edits made at once before it's submitted (This preview page should display the HTML formatting applied as well as the text).

Again, what's intended in the final application is that the main instance (containing the edit "Q_ITEM" nodes), gets submitted in a state where the html formatting produced by the RTE (bold, italic, underline) are real nodes.  This would allow the FOP stylesheet receiving this XML to match the HTML formatting and output the correct FO.

I did some looking at XSLT's "disable output escaping" (see http://www.dpawson.co.uk/xsl/sect2/N2215.html) but so far am confused as to whether this is the answer, as I haven't been able to get this to work.

I don't think I would be the only person who'd like to do something like this. Any help is very much appreciated!

test-1.zip
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: problems xxforms:serialize

Alessandro  Vernet
Administrator
Francis,

I have your application running, and to summarize what I see:

1. The text entered through the RTE ends up in <Q_TEXT> in main-instance.
2. When displaying the second tab, you send that instance to
preview-transform.xpl, which runs preview.xsl.
3. In preview.xsl, what you have in <Q_TEXT> is still text, so you
need to parse it if you want to produce XHTML from it. You can use
saxon:parse() with this. Since saxon:parse() expects a root element,
you need to add a div or span around the text.

So replace: <xsl:value-of select="./Q_TEXT"/>
With: <xsl:copy-of select="saxon:parse(concat('&lt;div>', Q_TEXT,
'&lt;/div>'))/*"/>

and I think you'll get get the result you expected.

Alex

On Thu, Jul 8, 2010 at 8:24 AM, FParsons <[hidden email]> wrote:

>
> Alex -
>
> I have attached a zip of a folder that you can drop in under
> /resources/apps. This shows essentially what I'm trying to do: have nodes of
> text that you can edit and format with the Yahoo RTE, and a 'preview' page
> that allows the user to view all the edits made at once before it's
> submitted (This preview page should display the HTML formatting applied as
> well as the text).
>
> Again, what's intended in the final application is that the main instance
> (containing the edit "Q_ITEM" nodes), gets submitted in a state where the
> html formatting produced by the RTE (bold, italic, underline) are real
> nodes.  This would allow the FOP stylesheet receiving this XML to match the
> HTML formatting and output the correct FO.
>
> I did some looking at XSLT's "disable output escaping" (see
> http://www.dpawson.co.uk/xsl/sect2/N2215.html
> http://www.dpawson.co.uk/xsl/sect2/N2215.html ) but so far am confused as to
> whether this is the answer, as I haven't been able to get this to work.
>
> I don't think I would be the only person who'd like to do something like
> this. Any help is very much appreciated!
>
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n2282469/test-1.zip
> test-1.zip
>
> -----
> -- Francis
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2282469.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: problems xxforms:serialize

FParsons
Alex - I use this in the preview.xsl:

<xsl:copy-of select="saxon:parse(concat('&lt;div class=''questionItem'' &gt;',Q_TEXT,'&lt;/div&gt;'))/*"/>

and it now works! Thanks very much!

However, it's more important that the formatting can be found in the FOP stylesheet: is it true that I would need to run the xml (produced by the xform, containing the escaped angle brackets) through a stylesheet before giving it to FOP? Is it possible to handle this in the FOP stylesheet itself?
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: problems xxforms:serialize

Alessandro  Vernet
Administrator
Francis,

You can call that saxon:parse() from an XSLT in the pipeline that runs
FOP, before you run FOP. Or you can run it directly from XForms, but
then you'll need to have another instance that has that data in XML
(parsed) in addition to the one you already have which has the HTML as
text (unparsed). Does this answer your question?

Alex

On Fri, Jul 9, 2010 at 5:57 AM, FParsons <[hidden email]> wrote:

>
> Alex - I use this in the preview.xsl:
>
> <xsl:copy-of select="saxon:parse(concat('&lt;div class=''questionItem''
> &gt;',Q_TEXT,'&lt;/div&gt;'))/*"/>
>
> and it now works! Thanks very much!
>
> However, it's more important that the formatting can be found in the FOP
> stylesheet: is it true that I would need to run the xml (produced by the
> xform, containing the escaped angle brackets) through a stylesheet before
> giving it to FOP? Is it possible to handle this in the FOP stylesheet
> itself?
>
> -----
> -- Francis
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/problems-xxforms-serialize-tp2257687p2283211.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Out of Office AutoReply: Re: Re: Re: Re: Re: problems xxforms:serialize

pappleby
Out of Office AutoReply: Re: Re: Re: Re: Re: problems xxforms:serialize

I am out of the office until 26th July

***********************************************************************************************

This email, including any attachment, is confidential and may be legally privileged. If you are not the intended recipient or if you have received this email in error, please inform the sender immediately by reply and delete all copies from your system. Do not retain, copy, disclose, distribute or otherwise use any of its contents.

 

Whilst we have taken reasonable precautions to ensure that this email has been swept for computer viruses, we cannot guarantee that this email does not contain such material and we therefore advise you to carry out your own virus checks. We do not accept liability for any damage or losses sustained as a result of such material.

 

Please note that incoming and outgoing email communications passing through our IT systems may be monitored and/or intercepted by us solely to determine whether the content is business related and compliant with company standards.

***********************************************************************************************

The Stationery Office Limited is registered in England No. 3049649 at 10 Eastbourne Terrace, London, W2 6LG