Author |
Message
|
leopucci |
Posted: Thu Nov 09, 2017 4:19 am Post subject: Change DFDL Encoding. |
|
|
Apprentice
Joined: 09 Nov 2017 Posts: 28
|
Hello guys, how have you been?
I am having some trouble to cast a DFDL message to another encoding.
I´ve tried the OutputRoot.Properties.CodedCharSetId, and also changing the code page of the dfdl itself. Nothing worked
The thing is that there are some hex info that i need to maintain, so i was wondering two things:
1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdl´s? For instance, two equal dfdl structures, and use diferente code pages on it?
2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let´s name it "Selective cast" lol
Thanks for your help! |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 09, 2017 5:43 am Post subject: Re: Change DFDL Encoding. |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
leopucci wrote: |
Hello guys, how have you been?
I am having some trouble to cast a DFDL message to another encoding.
I´ve tried the OutputRoot.Properties.CodedCharSetId, and also changing the code page of the dfdl itself. Nothing worked
The thing is that there are some hex info that i need to maintain, so i was wondering two things:
1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdl´s? For instance, two equal dfdl structures, and use diferente code pages on it?
2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let´s name it "Selective cast" lol
Thanks for your help! |
Probably none of the above. From your description of the problem it seems like you may have some binary fields that are not defined as such in your DFDL. I say go back to your DFDL definition and fix it!.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
leopucci |
Posted: Thu Nov 09, 2017 10:55 am Post subject: Re: Change DFDL Encoding. |
|
|
Apprentice
Joined: 09 Nov 2017 Posts: 28
|
Thanks for your help Saper, the bits are ok and defined as hex! can you help me understand which command in esql i need to make to cast the message?
I have tried to set OutputRoot.Properties.CodedCharSetId but after that the message did not changed.
Thanks again!
fjb_saper wrote: |
leopucci wrote: |
Hello guys, how have you been?
I am having some trouble to cast a DFDL message to another encoding.
I´ve tried the OutputRoot.Properties.CodedCharSetId, and also changing the code page of the dfdl itself. Nothing worked
The thing is that there are some hex info that i need to maintain, so i was wondering two things:
1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdl´s? For instance, two equal dfdl structures, and use diferente code pages on it?
2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let´s name it "Selective cast" lol
Thanks for your help! |
Probably none of the above. From your description of the problem it seems like you may have some binary fields that are not defined as such in your DFDL. I say go back to your DFDL definition and fix it!.  |
|
|
Back to top |
|
 |
timber |
Posted: Thu Nov 09, 2017 4:00 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
I've tried the OutputRoot.Properties.CodedCharSetId |
That will set a DFDL variable ${dfdl:encoding}. If you are using that variable in your DFDL schema then it will affect the output of the DFDL serializer. Otherwise it will have no effect at all.
Quote: |
and also changing the code page of the dfdl itself |
That's ambiguous - what specific part of the DFDL schema did you edit?
Quote: |
1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it? |
Yes. That's the only solution that can possibly work. Every element in a DFDL schema has the property 'Encoding'. Usually, it gets set to a fixed value in the global format block, and every character field inherits that value. If the format block uses "${dfdl:encoding}" then it will pick up the encoding from the Properties tree.
Quote: |
2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let's name it "Selective cast" lol |
lol indeed! How exactly do you think ESQL's CAST function could work out which parts of the BLOB should be converted and which parts should be left alone?
Only a message model can supply that information - hence the answer above. |
|
Back to top |
|
 |
timber |
Posted: Thu Nov 09, 2017 4:05 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Just realised that my previous answer could be misunderstood...
Quote: |
Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it? |
You don't need 2 DFDL schemas. You need one DFDL schema that makes use of the ${dfdl:encoding} variable. Fortunately, all schemas generated by the wizards in the IIB toolkit are set up this way. You may not be able to use those wizards for your format, but you can create a dummy schema to see how it's done, and then follow the recipe in your own DFDL schema. |
|
Back to top |
|
 |
leopucci |
Posted: Fri Nov 10, 2017 12:57 pm Post subject: |
|
|
Apprentice
Joined: 09 Nov 2017 Posts: 28
|
Thank you timber.
You and saber are both right.
The fact is that the DFDL that i am testing (ISO8583) does not have the encoding property defined.
I have just created one using wizard as you explained and found the encoding variable.
Now i can move forward.
Thank you very much for the help!
timber wrote: |
Just realised that my previous answer could be misunderstood...
Quote: |
Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it? |
You don't need 2 DFDL schemas. You need one DFDL schema that makes use of the ${dfdl:encoding} variable. Fortunately, all schemas generated by the wizards in the IIB toolkit are set up this way. You may not be able to use those wizards for your format, but you can create a dummy schema to see how it's done, and then follow the recipe in your own DFDL schema. |
|
|
Back to top |
|
 |
leopucci |
Posted: Fri Nov 10, 2017 2:29 pm Post subject: |
|
|
Apprentice
Joined: 09 Nov 2017 Posts: 28
|
Timber,
I have just tried the dynamic encoding.
Now i am able to see this dynamic encoding term on the dfdl editor.
It seems that i am not being able to understand the toolkit way of dealing with it.
I have created a message with the charset defined as ascii, then at the bottom of the esql, changed to ebcdic.
I think that it wil be necessary to send to a second node, before changing the charset. Am I correct?
Or it is possible to make the conversion in the same node?
Thanks in advance!
leopucci wrote: |
Thank you timber.
You and saber are both right.
The fact is that the DFDL that i am testing (ISO8583) does not have the encoding property defined.
I have just created one using wizard as you explained and found the encoding variable.
Now i can move forward.
Thank you very much for the help!
timber wrote: |
Just realised that my previous answer could be misunderstood...
Quote: |
Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it? |
You don't need 2 DFDL schemas. You need one DFDL schema that makes use of the ${dfdl:encoding} variable. Fortunately, all schemas generated by the wizards in the IIB toolkit are set up this way. You may not be able to use those wizards for your format, but you can create a dummy schema to see how it's done, and then follow the recipe in your own DFDL schema. |
|
|
|
Back to top |
|
 |
timber |
Posted: Sat Nov 11, 2017 3:53 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Would you mind posting some code - I'm struggling to understand the latest problem. |
|
Back to top |
|
 |
leopucci |
Posted: Tue Dec 26, 2017 3:18 am Post subject: |
|
|
Apprentice
Joined: 09 Nov 2017 Posts: 28
|
timber wrote: |
Would you mind posting some code - I'm struggling to understand the latest problem. |
Thanks Timber for your help. After fighting with the dfdl on the notepad i have found some encoding definitions that was wrong. After removing it, it worked! |
|
Back to top |
|
 |
|