Hi,

Hi,

To clarify the below XML was produced my a call to an ejb via a
delegation processor, listed below. What wish to do is to process the
return value (XML string) as an XML document for the next pipeline
processor, hence the use of saxon:parse as shown in the FAQ

<p:processor name="oxf:delegation">
  <p:input name="interface"> 
      <config> 
          <service id="read-data" type="stateless-ejb"
uri="ejb/MyBeanHome"/>
      </config>
  </p:input>
  <p:input name="call">
      <delegation:execute service="read-data" operation="getName"> 
          <theform xsi:type="xs:string">SomeStringValue</theform>
      </delegation:execute>
  </p:input>
  
  <p:output name="data" id="ejb-data"/>
</p:processor>

The ejb method listing is:

        public String getName( String id ) throws EJBException {
                return
                        ""
                      +  "<document>\n"
                        +  "<xml-string>\n"
                        +  "<name>Joe Bloggs Junior</name>\n"
                        +  "</xml-string>\n"
                        +  "</document>";
        }

Regards,

Avinder

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Erik
Bruchez
Sent: 07 February 2005 12:37
To: [email protected]
Subject: Re: [orbeon-user] Converting a string to an XML document

Avinder,

This doesn't look right. This is not a well-formed XML document. It is a

document with an XML declaration all right, but then it's only character

content (the brackets are escaped).

Maybe Alex can comment on how this could happen?

-Erik

Avinder Bahra wrote:
> Hi,
> 
> When I redirect the output produced by the EJB to file via the
> file-serlializer processor, I get a file that reads:
> 
> <?xml version="1.0" encoding="utf-8"?>
> &lt;document&gt;
> &lt;xml-string&gt;
> &lt;name&gt;Joe Bloggs Junior&lt;/name&gt;
> &lt;/xml-string&gt;
> &lt;/document&gt;
> 
> This XML string looks OK which is why I do not understand saxon:parse
> error. PS I am running under JBoss outside of OXF studio which I why I
> can not use the debug facility.
> 
> Regards,
> 
> Avinder
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Erik
> Bruchez
> Sent: 07 February 2005 11:28
> To: [email protected]
> Subject: Re: [orbeon-user] Converting a string to an XML document
> 
> My guess is that... the first argument of saxon:parse() is an empty 
> sequence, as the error implies. You are selecting /document/xml-string

> on the ejb-data document. Does it actually contain that? I.e., if you 
> put a debug on <p:input name="data" href="#ejb-data" />, what do you
> get?
> 
> -Erik
> 
> Avinder Bahra wrote:
> 
>>Hi,
>>
>>I tried using the approach in the below FAQ (
>>http://www.orbeon.com/community/faq#2.21 ) for converting an XML
> 
> string
> 
>>returned by an EJB into an XML document using the saxon:parse function
> 
> -
> 
>>however I get the error:
>>
>>org.orbeon.saxon.xpath.DynamicError: An empty sequence is not allowed
> 
> as
> 
>>the first argument of saxon:parse()
>>
>>The XML string returned by the EJB is
>><?xml version="1.0"?>
>><document>
>>  <xml-string>
>>    <name>Joe Bloggs Junior</name>
>>  </xml-string>
>></document>
>>
>>The XPL code is:
>><p:processor name="oxf:xslt">
>>    <p:input name="data" href="#ejb-data" />
>>      <p:input name="config">
>>              <xsl:stylesheet version="2.0"
>>xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>>                      <xsl:template match="/">
>>                              <xsl:copy-of
>>select="saxon:parse(xs:string(/document/xml-string))"/>
>>                      </xsl:template>
>>              </xsl:stylesheet>
>>      </p:input>
>>    <p:output name="data" id="transformation-result"/>
>></p:processor>
>>
>>Stack trace is listed below.
>>
>>Any help appreciated,
>>Regards,
>>Avinder Bahra
>>
>>2005-02-07 10:39:27,819 ERROR org.orbeon.oxf.pipeline.InitUtils null -
>>Exception
>> at oxf:/examples/xforms/xforms-wizard/read-form.xpl, line 55, column
> 
> -1
> 
>>; SystemID: oxf:/examples/xforms/xforms-wizard/read-form.xpl; Line#:
> 
> 55;
> 
>>Column#
>>: -1
>>org.orbeon.saxon.xpath.DynamicError: An empty sequence is not allowed
> 
> as
> 
>>the fir
>>st argument of saxon:parse()
>>        at
>>org.orbeon.saxon.expr.ComputedExpression.typeError(ComputedExpression
>>.java:486)
>>        at
>>org.orbeon.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChec
>>ker.java:107)
>>        at
> 
> org.orbeon.saxon.functions.Parse.evaluateItem(Parse.java:48)
> 
>>        at
>>org.orbeon.saxon.expr.ComputedExpression.iterate(ComputedExpression.j
>>ava:408)
>>        at
>>org.orbeon.saxon.instruct.CopyOf.processLeavingTail(CopyOf.java:67)
>>        at org.orbeon.saxon.instruct.Template.expand(Template.java:98)
>>        at
>>org.orbeon.saxon.instruct.Template.processLeavingTail(Template.java:8
>>2)
>>        at
>>org.orbeon.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplate
>>s.java:262)
>>        at
>>org.orbeon.saxon.Controller.transformDocument(Controller.java:1094)
>>        at
>>org.orbeon.saxon.TransformerHandlerImpl.endDocument(TransformerHandle
>>rImpl.java:121)
>>        at
>>org.orbeon.oxf.xml.ForwardingContentHandler.endDocument(ForwardingCon
>>tentHandler.java:43)
>>        at org.orbeon.oxf.xml.SAXStore.endDocument(SAXStore.java:238)
>>        at
>>org.orbeon.oxf.xml.ForwardingContentHandler.endDocument(ForwardingCon
>>tentHandler.java:43)
>>        at org.orbeon.oxf.xml.SAXStore.replay(SAXStore.java:173)
>>        at
>>org.orbeon.oxf.processor.generator.DOMGenerator$1.readImpl(DOMGenerat
>>or.java:137)
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
>>
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(Proce
>>ssorImpl.java:1106)
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.j
>>ava:340)
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.j
>>ava:345)
>>        at
>>org.orbeon.oxf.processor.DelegationProcessor$1.readImpl(DelegationPro
>>cessor.java:83)
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
>>
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(Proce
>>ssorImpl.java:1106)
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.j
>>ava:340)
>>        at
>>org.orbeon.oxf.processor.pipeline.TeeProcessor.access$100(TeeProcesso
>>r.java:27)
>>        at
>>org.orbeon.oxf.processor.pipeline.TeeProcessor$1.readImpl(TeeProcesso
>>r.java:48)
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
>>
>>        at
>>org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(Proce
>>ssorImpl.java:1106)
>>
>>
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf Of Erik
>>Bruchez
>>Sent: 04 February 2005 16:37
>>To: [email protected]
>>Subject: Re: [orbeon-user] Converting a string to an XML document
>>
>>Avinder Bahra wrote:
>>
>>
>>
>>>What I want to do is to call an EJB method to return XForms instance 
>>>data. The approach I was thinking of  was to return the XML as a
>>
>>string. 
>>
>>
>>>However I can not see how I would be able to convert the string 
>>>(returned as the output of the Dispatch processor) into an XML
>>
>>document 
>>
>>
>>>for consumption the next pipeline processor.
>>
>>
>>Easy task for me, that's in the FAQ:
>>
>>http://www.orbeon.com/community/faq#2.21
>>
>>-Erik
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by: IntelliVIEW -- Interactive
> 
> Reporting
> 
>>Tool for open source databases. Create drag-&-drop reports. Save time
>>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>>_______________________________________________
>>orbeon-user mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/orbeon-user
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by: IntelliVIEW -- Interactive
> 
> Reporting
> 
>>Tool for open source databases. Create drag-&-drop reports. Save time
>>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>>_______________________________________________
>>orbeon-user mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/orbeon-user
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> orbeon-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/orbeon-user
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> orbeon-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/orbeon-user



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to