Escaping issues...

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

Escaping issues...

Mauro Mugnaini
Hello everybody,
We have the following (1) xpl pipeline that has to produce the
"xforms:instance" part of a page.
The generated instance should then be included through XSLT (2) in a xhtml
view. We do not enable the standard transformations in the orbeon epilogue
since we make some tests with direct client rendering (mozilla Xforms plugin).

Our concern is that we are not able to produce the *non-escaped* xml fragment
representing the xforms:instance. Instead we get something like (3).

We also tried to add a "debug" attribute to the output of the xslt processor
but we got an org.orbeon.oxf.common.OXFException exception: Null document for
debug 'dbg'.

Our xslt starts with:

<xsl:stylesheet version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml">

   <xsl:output method="xhtml" encoding="ISO-8859-1"
               omit-xml-declaration="yes" indent="yes" />


and for generating '<' and '>' we use the following sample code:

       <xsl:text><![CDATA[>]]></xsl:text>


Finally, just for completeness, we attach also the page-flow.xml snippet (4).

(1) The processors in the pipeline declaration

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:oxf="http://www.orbeon.com/oxf/processors"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:syn="http://rnd.websynapsis.com">

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

   <p:processor name="oxf:xslt">
       <p:input name="data" href="oxf:/schema/schema.xsd" />
       <p:input name="config" href="oxf:/xslt/builder.xsl"/>
       <p:output name="data" ref="data"/>

       <!--p:output name="data" ref="data" debug="dbg"/ -->

   </p:processor>
</p:config>

(2) The xslt view code

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:syn="http://rnd.websynapsis.com">

   <head>
       <xforms:model>
           <xforms:instance>
               <xsl:value-of select="/" disable-output-escaping="yes" />
           </xforms:instance>
        </xforms:model>
   </head>
</html>


(3) The "View Page Source" output we get in the browser.

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:syn="http://rnd.websynapsis.com">

<head>
 <xforms:model>
  <xforms:instance>
        &lt;syn:LegalPN use=""&gt;
        &lt;syn:validTime operator="I" value="" nullFlavor=""&gt;
        [...]
        &lt;syn:suffix
        partType=""&gt;&lt;/syn:suffix&gt;&lt;/syn:LegalPN&gt;
  </xforms:instance>
 </xforms:model>
</head>
</html>


(4) The snippet of our page-flow.xml

<page id="main" path-info="/authenticated/main.xhtml"
      model="main-model.xpl" view="display.xsl" />



Thank you in advance to any help you can give us.


--
Have a nice day, bye...

   Mauro Mugnaini.

--------------------------------
--- PGP public key available ---
--------------------------------
Dott. Mauro Mugnaini

Synapsis S.r.l.
     in Computer Science

P.zza Dante, 19/20
57121 Livorno
tel: 0586 426790
fax: 0586 443954
www.websynapsis.com

 ----------------------------------------------------------------------
| CONFIDENTIALITY NOTICE   [Italian Dec. Lgs 196 of 30/06/2003]        |
| This message and its attachments are addressed solely to the persons |
| above and may contain confidential information.                      |
| If you are not the addressee or an authorized recipient of this      |
| message, be informed that any use of the content hereof is           |
| prohibited.                                                          |
| Please notify the sender immediately and then delete this message.   |
| Should you have any questions, please contact us by replying to:     |
| [hidden email]                                           |
|                                           Thank you.                 |
 ----------------------------------------------------------------------



--
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: Escaping issues...

Erik Bruchez
Administrator
Mauro,

This is a simple XSLT issue.

xsl:value-of *always* returns a string. Use xsl:copy-of instead (and
remove disable-output-escaping).

The "null document" you get in the XPL is a little worrying though, as
that probably means that your XSLT stylesheet fails to return
anything. But first things first: start trying xsl:copy-of.

-Erik

 > We have the following (1) xpl pipeline that has to produce the
 > "xforms:instance" part of a page.
 > The generated instance should then be included through XSLT (2) in a
xhtml
 > view. We do not enable the standard transformations in the orbeon
epilogue
 > since we make some tests with direct client rendering (mozilla Xforms
plugin).
 >
 > Our concern is that we are not able to produce the *non-escaped* xml
fragment
 > representing the xforms:instance. Instead we get something like (3).
 >
 > We also tried to add a "debug" attribute to the output of the xslt
processor
 > but we got an org.orbeon.oxf.common.OXFException exception: Null
document for
 > debug 'dbg'.
 >
 > Our xslt starts with:
 >
 > <xsl:stylesheet version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml">
 >
 >    <xsl:output method="xhtml" encoding="ISO-8859-1"
 >                omit-xml-declaration="yes" indent="yes" />
 >
 >
 > and for generating '<' and '>' we use the following sample code:
 >
 >        <xsl:text><![CDATA[>]]></xsl:text>
 >
 >
 > Finally, just for completeness, we attach also the page-flow.xml
snippet (4).
 >
 > (1) The processors in the pipeline declaration
 >
 > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
 >    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 >    xmlns:oxf="http://www.orbeon.com/oxf/processors"
 >    xmlns:xs="http://www.w3.org/2001/XMLSchema"
 >    xmlns:syn="http://rnd.websynapsis.com">
 >
 >    <p:param name="data" type="output"/>
 >
 >    <p:processor name="oxf:xslt">
 >        <p:input name="data" href="oxf:/schema/schema.xsd" />
 >        <p:input name="config" href="oxf:/xslt/builder.xsl"/>
 >        <p:output name="data" ref="data"/>
 >
 >        <!--p:output name="data" ref="data" debug="dbg"/ -->
 >
 >    </p:processor>
 > </p:config>
 >
 > (2) The xslt view code
 >
 > <?xml version="1.0" encoding="utf-8"?>
 > <html xmlns="http://www.w3.org/1999/xhtml"
 >       xmlns:xforms="http://www.w3.org/2002/xforms"
 >       xmlns:syn="http://rnd.websynapsis.com">
 >
 >    <head>
 >        <xforms:model>
 >            <xforms:instance>
 >                <xsl:value-of select="/" disable-output-escaping="yes" />
 >            </xforms:instance>
 > </xforms:model>
 >    </head>
 > </html>
 >
 >
 > (3) The "View Page Source" output we get in the browser.
 >
 > <?xml version="1.0" encoding="utf-8"?>
 > <html xmlns="http://www.w3.org/1999/xhtml"
 >       xmlns:xforms="http://www.w3.org/2002/xforms"
 >       xmlns:syn="http://rnd.websynapsis.com">
 >
 > <head>
 >  <xforms:model>
 >   <xforms:instance>
 > &lt;syn:LegalPN use=""&gt;
 > &lt;syn:validTime operator="I" value="" nullFlavor=""&gt;
 > [...]
 > &lt;syn:suffix
 > partType=""&gt;&lt;/syn:suffix&gt;&lt;/syn:LegalPN&gt;
 >   </xforms:instance>
 >  </xforms:model>
 > </head>
 > </html>
 >
 >
 > (4) The snippet of our page-flow.xml
 >
 > <page id="main" path-info="/authenticated/main.xhtml"
 >       model="main-model.xpl" view="display.xsl" />
 >
 >
 >
 > Thank you in advance to any help you can give us.

--
Orbeon - XForms Everywhere:
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: Escaping issues...

Mauro Mugnaini
Erik Bruchez ha scritto:
> Mauro,
>
> This is a simple XSLT issue.

Hi Erik,

> xsl:value-of *always* returns a string. Use xsl:copy-of instead (and
> remove disable-output-escaping).

We have already tried all *obvious*, for our xsl knowledge, issues. and in the
case that you suggest the final view xslt is:

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xi="http://www.w3.org/2001/XInclude">

 <head>
  <xforms:model>
   <xforms:instance><?javax.xml.transform.disable-output-escaping?>
<?javax.xml.transform.enable-output-escaping?><?javax.xml.transform.disable-output-escaping?>&lt;<?javax.xml.transform.enable-output-escaping?>syn:LegalPN
use<?javax.xml.transform.disable-output-escaping?>="<?javax.xml.transform.enable-output-escaping?><?javax.xml.transform.disable-output-escaping?>"<?javax.xml.transform.enable-output-escaping?><?javax.xml.transform.disable-output-escaping?>&gt;
partType<?javax.xml.transform.disable-output-escaping?>="<?javax.xml.transform.enable-output-escaping?><?javax.xml.transform.disable-output-escaping?>"<?javax.xml.transform.enable-output-escaping?><?javax.xml.transform.disable-output-escaping?>&gt;&lt;/<?javax.xml.transform.enable-output-escaping?>syn:suffix<?javax.xml.transform.disable-output-escaping?>&gt;&lt;/<?javax.xml.transform.enable-output-escaping?>syn:LegalPN<?javax.xml.transform.disable-output-escaping?>&gt;<?javax.xml.transform.enable-output-escaping?>

   [...]
</xforms:instance>
  </xforms:model>

 </head>
</html>

Differences are only represented by many
<?javax.xml.transform.disable-output-escaping?> processing instructions.

> The "null document" you get in the XPL is a little worrying though, as
> that probably means that your XSLT stylesheet fails to return
> anything.

Yes... Is also our conclusion, but model is also available in the view page
for transformation... Any idea?

Adding an additional processor in the pipeline for file serializing xslt
transformation shows the same escaped results of the view transformation.

> But first things first: start trying xsl:copy-of.

As described, we have already tried without achieving wanted result.


--
Have a nice day, bye...

   Mauro Mugnaini.

--------------------------------
--- PGP public key available ---
--------------------------------
Dott. Mauro Mugnaini

Synapsis S.r.l.
     in Computer Science

P.zza Dante, 19/20
57121 Livorno
tel: 0586 426790
fax: 0586 443954
www.websynapsis.com

 ----------------------------------------------------------------------
| CONFIDENTIALITY NOTICE   [Italian Dec. Lgs 196 of 30/06/2003]        |
| This message and its attachments are addressed solely to the persons |
| above and may contain confidential information.                      |
| If you are not the addressee or an authorized recipient of this      |
| message, be informed that any use of the content hereof is           |
| prohibited.                                                          |
| Please notify the sender immediately and then delete this message.   |
| Should you have any questions, please contact us by replying to:     |
| [hidden email]                                           |
|                                           Thank you.                 |
 ----------------------------------------------------------------------



--
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: Escaping issues...

Erik Bruchez
Administrator
Mauro,

 >> xsl:value-of *always* returns a string. Use xsl:copy-of instead (and
 >> remove disable-output-escaping).
 >
 > We have already tried all *obvious*, for our xsl knowledge, issues

Ok, but I can only base my reply on the code you sent, and it did
contain xsl:value-of! We can't read minds here ;-)

 > the final view xslt is:
 > <?javax.xml.transform.disable-output-escaping?>&gt;
 >    [...]

 > Differences are only represented by many
 > <?javax.xml.transform.disable-output-escaping?> processing instructions.

This has got to mean that you are using disable-output-escaping,
right? I have never seen those PIs in any other circumstances. Why do
you think you need to use disable-output-escaping?

 > and for generating '<' and '>' we use the following sample code:
 >        <xsl:text><![CDATA[>]]></xsl:text>

Why do you output '<' and '>' like this? Can you provide a simplified
example illustrating what kind of XML document you want to produce?

 >> The "null document" you get in the XPL is a little worrying though, as
 >> that probably means that your XSLT stylesheet fails to return
 >> anything.
 >
 > Yes... Is also our conclusion, but model is also available in the
view page
 > for transformation... Any idea?

This is probably due to your use of disable-output-escaping, which has
the consequence that you are in fact not outputting an XML
document. So don't use disable-output-escaping ;-)

-Erik

--
Orbeon - XForms Everywhere:
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