You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by "Jackson, Douglas" <do...@siemens.com> on 2008/12/02 22:03:57 UTC

bpel escaped xml assignment question

Hi!
If I have a variable which is an xml complex type or a message containing an xml complex type, and I want to put the value of that variable (i.e. the xml escaped) into a string variable or into a string element/attribute in another complex type.  How would I do that?

i.e. in pseudo code:

 var<some-element-type> v1 = <literal><some-element>...</some-element></literal>
 var<string> v2 = escape-xml(v1)     (i.e.  "&lt;some-element&gt;...&lt;/some-element&gt;").

I guess I could write a web service that takes a request with an <any> xml piece and return a string if I had to do so.
-Doug.



Re: bpel escaped xml assignment question

Posted by Ciaran <ci...@gmail.com>.
On Wed, Dec 3, 2008 at 4:17 PM, Alex Boisvert <bo...@intalio.com> wrote:

> The dom-to-string() function could do that.
>
> http://ode.apache.org/xpath-extensions.html

Hmm, I never noticed that the old domToString form had been deprecated until
that post!  I'd best adjust my BPEL :)
- Cj.

RE: bpel escaped xml assignment question

Posted by "Jackson, Douglas" <do...@siemens.com>.
Hi!
Thanks!  I could have sworn that last time I looked there weren't extension functions like that! :)
-Doug.

-----Original Message-----
From: Alex Boisvert [mailto:boisvert@intalio.com] 
Sent: Wednesday, December 03, 2008 10:17 AM
To: user@ode.apache.org
Subject: Re: bpel escaped xml assignment question

The dom-to-string() function could do that.

http://ode.apache.org/xpath-extensions.html

alex


On Wed, Dec 3, 2008 at 7:30 AM, Matthieu Riou <ma...@offthelip.org>wrote:

> On Tue, Dec 2, 2008 at 1:03 PM, Jackson, Douglas <
> douglas.s.jackson@siemens.com> wrote:
>
> > Hi!
> > If I have a variable which is an xml complex type or a message containing
> > an xml complex type, and I want to put the value of that variable (i.e.
> the
> > xml escaped) into a string variable or into a string element/attribute in
> > another complex type.  How would I do that?
> >
> > i.e. in pseudo code:
> >
> >  var<some-element-type> v1 =
> > <literal><some-element>...</some-element></literal>
> >  var<string> v2 = escape-xml(v1)     (i.e.
> >  "&lt;some-element&gt;...&lt;/some-element&gt;").
> >
> > I guess I could write a web service that takes a request with an <any>
> xml
> > piece and return a string if I had to do so.
>
>
> It's one possibility. Something simpler would probably be to implement a
> small XPath extension function and plug it into Saxon (our XPath 2.0
> engine), that would look very much like your example above.
>
> http://www.saxonica.com/documentation/extensibility/functions.html
>
> Cheers,
> Matthieu
>
>
> >
> > -Doug.
> >
> >
> >
>

Re: bpel escaped xml assignment question

Posted by Alex Boisvert <bo...@intalio.com>.
The dom-to-string() function could do that.

http://ode.apache.org/xpath-extensions.html

alex


On Wed, Dec 3, 2008 at 7:30 AM, Matthieu Riou <ma...@offthelip.org>wrote:

> On Tue, Dec 2, 2008 at 1:03 PM, Jackson, Douglas <
> douglas.s.jackson@siemens.com> wrote:
>
> > Hi!
> > If I have a variable which is an xml complex type or a message containing
> > an xml complex type, and I want to put the value of that variable (i.e.
> the
> > xml escaped) into a string variable or into a string element/attribute in
> > another complex type.  How would I do that?
> >
> > i.e. in pseudo code:
> >
> >  var<some-element-type> v1 =
> > <literal><some-element>...</some-element></literal>
> >  var<string> v2 = escape-xml(v1)     (i.e.
> >  "&lt;some-element&gt;...&lt;/some-element&gt;").
> >
> > I guess I could write a web service that takes a request with an <any>
> xml
> > piece and return a string if I had to do so.
>
>
> It's one possibility. Something simpler would probably be to implement a
> small XPath extension function and plug it into Saxon (our XPath 2.0
> engine), that would look very much like your example above.
>
> http://www.saxonica.com/documentation/extensibility/functions.html
>
> Cheers,
> Matthieu
>
>
> >
> > -Doug.
> >
> >
> >
>

Re: bpel escaped xml assignment question

Posted by Matthieu Riou <ma...@offthelip.org>.
On Tue, Dec 2, 2008 at 1:03 PM, Jackson, Douglas <
douglas.s.jackson@siemens.com> wrote:

> Hi!
> If I have a variable which is an xml complex type or a message containing
> an xml complex type, and I want to put the value of that variable (i.e. the
> xml escaped) into a string variable or into a string element/attribute in
> another complex type.  How would I do that?
>
> i.e. in pseudo code:
>
>  var<some-element-type> v1 =
> <literal><some-element>...</some-element></literal>
>  var<string> v2 = escape-xml(v1)     (i.e.
>  "&lt;some-element&gt;...&lt;/some-element&gt;").
>
> I guess I could write a web service that takes a request with an <any> xml
> piece and return a string if I had to do so.


It's one possibility. Something simpler would probably be to implement a
small XPath extension function and plug it into Saxon (our XPath 2.0
engine), that would look very much like your example above.

http://www.saxonica.com/documentation/extensibility/functions.html

Cheers,
Matthieu


>
> -Doug.
>
>
>