CDATA XML to another XML

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

CDATA XML to another XML

szdezso
Hi There!

I need a help!

I have a WebS response, for ex:

<GetEventsResult xmlns:a="http://schemas.datacontract.org/2004/07/FORRAS_Int" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <a:data>
<![CDATA[<egy:Egysegek xmlns:egy="http://www.griffsoft.hu/Egyseg" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><egy:Feek>aas</egy:Feek><egy:Fnev1>bfggfhgf</egy:Fnev1></egy:Egysegek>]]>
</a:data>
            <a:dateTime>2017-05-12T10:55:03.9562345+02:00</a:dateTime>
            <a:eventID>EgysegInsert</a:eventID>
            <a:queueID>1</a:queueID>
</GetEventsResult>

I like to "open" the CDATA xml and to transform to another xml struct for ex.: Feek --> CompUnitCode, Fnev1 --> Name

more detail:

#1
<egy:Egysegek>
         <egy:Feek>fgjhfghjfg</egy:Feek>
         <egy:Fnev1>Tiha</egy:Fnev1>
      </egy:Egysegek>

to

#2
<FlgCompUnits xmlns:msgns="http://j2ee.netbeans.org/wsdl/BpelXslt01/src/BpelXsltWSDL" xmlns:ns0="http://www.griffsoft.hu/FlgComUnit" xmlns="http://www.griffsoft.hu/FlgComUnit">
         <ns0:CompUnitCode>fgjhfghjfg</ns0:CompUnitCode>
         <ns0:Name>Tiha</ns0:Name>
      </FlgCompUnits>

but the 1st xml is in CDATA, I thought I need to open the CDATA to normal XML then can I transform to another xml struct.

?

Thanks in advance.

Rgds.

D.
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

vishnu.piskala
Do this in BPEL,

Assign the CDATA element to a string. Use a java static method and map the
CDATA string from bpel to the java method. The java method can open the
CDATA xml and return the xml as Node as Document object. You can then map
this returned xml to the appropriate XML element in BPEL. Now you have the
opened xml in BPEL and you can do any transformations you want.

This can help to some extent:
http://www.logicoy.com/wikilogicoy/Wiki.jsp@page=BPELSEHowToCallJavaMethods.
html

Regards
Vishnu
www.logicoy.com


-----Original Message-----
From: szdezso [mailto:[hidden email]]
Sent: Friday, May 12, 2017 3:21 PM
To: [hidden email]
Subject: CDATA XML to another XML

Hi There!

I need a help!

I have a WebS response, for ex:

<GetEventsResult
xmlns:a="http://schemas.datacontract.org/2004/07/FORRAS_Int"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <a:data></a:data>
            <a:dateTime>2017-05-12T10:55:03.9562345+02:00</a:dateTime>
            <a:eventID>EgysegInsert</a:eventID>
            <a:queueID>1</a:queueID>
</GetEventsResult>

I like to "open" the CDATA xml and to transform to another xml struct for
ex.: Feek --> CompUnitCode, Fnev1 --> Name

more detail:

#1
<egy:Egysegek>
         <egy:Feek>fgjhfghjfg</egy:Feek>
         <egy:Fnev1>Tiha</egy:Fnev1>
      </egy:Egysegek>

to

#2
<FlgCompUnits
xmlns:msgns="http://j2ee.netbeans.org/wsdl/BpelXslt01/src/BpelXsltWSDL"
xmlns:ns0="http://www.griffsoft.hu/FlgComUnit"
xmlns="http://www.griffsoft.hu/FlgComUnit">
         <ns0:CompUnitCode>fgjhfghjfg</ns0:CompUnitCode>
         <ns0:Name>Tiha</ns0:Name>
      </FlgCompUnits>

but the 1st xml is in CDATA, I thought I need to open the CDATA to normal
XML then can I transform to another xml struct.

?

Thanks in advance.

Rgds.

D.



--
View this message in context:
http://openesb-community-forum.794670.n2.nabble.com/CDATA-XML-to-another-XML
-tp7581625.html
Sent from the OpenESB Community Forum mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

szdezso
Dear Vishnu!


Ok, but some simplier way?

Do you think Javascript component?
Or some more heavy component as Java?

OSB dont support this featuer some way?

Rgds.

D.
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

Paul Perez
Administrator
Hello
From my point of view the best way to Get what you want is to use an XSL transformation.
then use your XSL in the Mapper
it must run easily

Regards

Paul
www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

szdezso
Hello!


Ok, but how can I open the CDATA XML to XML?
Maybe in JS component with JS code?

Or other way?

Rgds.

D.
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

Paul Perez
Administrator
Don't use the javascript
Put your input  in a string and use your input as xslt input.
Paul
www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

szdezso
I transform by doxltransfrom bpel under assign activity?
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

Paul Perez
Administrator
Yes

Sent from TypeApp
On 12 May 2017, at 17:50, "szdezso [via OpenESB Community Forum]" <[hidden email]> wrote:
I transform by doxltransfrom bpel under assign activity?


If you reply to this email, your message will be added to the discussion below:
http://openesb-community-forum.794670.n2.nabble.com/CDATA-XML-to-another-XML-tp7581625p7581633.html
To start a new topic under OpenESB Community Forum, email [hidden email]
To unsubscribe from CDATA XML to another XML, click here.
NAML
www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

szdezso
This post has NOT been accepted by the mailing list yet.

Ok, somebody can give me a working example in OSB transform the CDATA to XML?

thanks in advance.

Rgds.

D.
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

szdezso
This post has NOT been accepted by the mailing list yet.
In reply to this post by vishnu.piskala
Hello Wishnu!


Your link as you wrote is broken.

?

Rgds.

D.
Reply | Threaded
Open this post in threaded view
|

RE: CDATA XML to another XML

szdezso
This post has NOT been accepted by the mailing list yet.
In reply to this post by Paul Perez
Hello Paul!

The solution was: DounMarshal, because the CDATA XML align an XSD schema and we use this schame in BPEL too (as domain driven).

I could it easy transform the CDATA xml to my schame base XML (Node).

Rgds.

D.

ps.: and it can works in backward too when XML to CDATA.