http-serializer requires xsi:type

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

http-serializer requires xsi:type

Hank Ratzesberger

I attempted to move a pipeline from the
legacy xml-serializer to the http-serializer.
However, I get an exception, "Root element must
contain an xsi:type attribute"  Not sure why this
is happening, never a problem before with a
myriad of namespaces.

Any directions welcome, thanks.

--Hank

Hank Ratzesberger
NEES Programmer
Institute for Crustal Studies
University of California, Santa Barbara


------------ exception:

Type     class org.orbeon.oxf.common.OXFException
Message  Root element must contain an xsi:type attribute
Location oxf:/tests/test1.xhtml
Line     N/A
Column   N/A

--------------- pipeline:

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

 <p:processor name="oxf:xslt">
  <p:input name="config" href="/tests/test1.xhtml"/>
  <p:input name="data" href="aggregate('root', /site-prefs.xml)"/>
  <p:output name="data" id="data"/>
 </p:processor>

  <p:processor name="oxf:http-serializer">
    <p:input name="config">
      <config>
        <content-type>text/html</content-type>
        <force-content-type>true</force-content-type>
      </config>
    </p:input>
    <p:input name="data" href="#data" />
  </p:processor>

</p:config>


---------------------- page:

<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xmlns:widget="http://orbeon.org/oxf/xml/widget"
    xmlns:ev="http://www.w3.org/2001/xml-events">

 <xsl:output omit-xml-declaration="yes" />

  <xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>

<body>
  Time: <xsl:value-of select="current-dateTime()" />
  <br />
  Copyright: <xsl:value-of select="/root/preferences/copyright" />
  <br />
</body>
</html>

  </xsl:template>
</xsl:stylesheet>




--
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: http-serializer requires xsi:type

Erik Bruchez
Administrator
Hank Ratzesberger wrote:
>
> I attempted to move a pipeline from the legacy xml-serializer to the
> http-serializer. However, I get an exception, "Root element must
> contain an xsi:type attribute"  Not sure why this
> is happening, never a problem before with a myriad of namespaces.
>
> Any directions welcome, thanks.

Yes, the HTTP Serializer accepts two different types of documents only:
binary an text, as per this:

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

You do need an xsi:type attribute on the root element, and the content
is either text or binary encoded as Base64.

If you want to no longer use the XML serializer, you have to use, in
addition to the HTTP serializer, the XML converter, for example (from
epilogue-servlet.xpl):

<p:processor name="oxf:xml-converter">
     <p:input name="config">
         <config>
             <encoding>utf-8</encoding>
         </config>
     </p:input>
     <p:input name="data" href="#xformed-data"/>
     <p:output name="data" id="converted"/>
</p:processor>
<p:processor name="oxf:http-serializer">
     <p:input name="config">
         <config>
             <header>
                 <name>Cache-Control</name>
                 <value>post-check=0, pre-check=0</value>
             </header>
             <content-type>application/xml</content-type>
         </config>
     </p:input>
     <p:input name="data" href="#converted"/>
</p:processor>

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws