|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DFDL : XML to CHAR : Double Quotes |
« View previous topic :: View next topic » |
Author |
Message
|
wbisantosh |
Posted: Fri Jul 17, 2015 7:57 am Post subject: DFDL : XML to CHAR : Double Quotes |
|
|
Apprentice
Joined: 12 Nov 2012 Posts: 47
|
Hello,
Here is what I am trying to do, I have a Variable and an XML. I am supposed to create a pipe-delimited Message in the following Pattern
Code: |
Variable | XML_CHAR |
I am able to create this Message Successfully. But, when the XML has a Pipe"|" in one of its field Values , I am getting double quotes in the XML_CHAR.
I have tried making the DFDL as Comma Delimited instead of Pipe Delimited and the Double Quotes still exist.
Do I need to make any changes to the DFDL String Definition for XML ? convert or escape the PIPE in the XML ?
Any suggestions are welcome
Environment -
OS -AIX
WMB - v8.0.0.4
Sample Data -
Code: |
ABC |
<?xml version="1.0" encoding="UTF-8"?>
<APP_PO xmlns="http://www.abc.com/de">
<Sample>Field 1</Sample>
</APP_PO> |
Sample with Pipe -
Code: |
ABC |
"
<?xml version=""1.0"" encoding=""UTF-8""?>
<APP_PO xmlns=""http://www.abc.com/de"">
<Sample>S65|906</Sample>
</APP_PO>
"
|
Thanks
Santosh |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 17, 2015 8:59 am Post subject: Re: DFDL : XML to CHAR : Double Quotes |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wbisantosh wrote: |
Hello,
Here is what I am trying to do, I have a Variable and an XML. I am supposed to create a pipe-delimited Message in the following Pattern
Code: |
Variable | XML_CHAR |
|
That's a fairly silly message design. I accept it's almost certainly not your fairly silly design, but you might want to mention this to the actual designer.
wbisantosh wrote: |
convert or escape the PIPE in the XML ? |
AFAIK you can't have a pipe character in an XML document (irrespective of if it's one half of a DFDL model or not). Try | instead.
Or ask the consumers of the message if they'd mind a base64 encoded string. They're clearly being unconventional with their message parsing, so maybe they can accommodate that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 17, 2015 9:02 am Post subject: Re: DFDL : XML to CHAR : Double Quotes |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vitor wrote: |
wbisantosh wrote: |
convert or escape the PIPE in the XML ? |
AFAIK you can't have a pipe character in an XML document (irrespective of if it's one half of a DFDL model or not). Try | instead. |
Now that clinches it. What I typed (without the additional spaces) was & # 1 2 4 ;
Which clearly is the hex for a pipe character  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 17, 2015 11:16 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I don't usually contradict the Grand High Poobah. However, in this case I feel compelled to point out that a pipe character is
a) quite a common alternative to a comma in CSV files and
b) a legal character in an XML document
I know what the OP's problem is, too. He has created the DFDL schema using the CSV wizard. That wizard automatically provides an 'escape scheme' ( that's an escape scheme folks. Not an escape schema ).
An escape scheme tells DFDL what to do when a delimeter appears in the value of an element.
wbisantosh: You cannot allow field values that contain un-escaped delimiters. That will cause chaos in the downstream application when it tries to interpret the output of your message flow.
You don't like what the automatically-provided escape scheme is doing. So read the DFDL specification, understand what your options are, and choose the solution that fits the requirements.
As always, if you get stuck all you need to do is tell us what you tried and we'll be glad to assist. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 17, 2015 11:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kimbert wrote: |
I don't usually contradict the Grand High Poobah. |
I bow down before the God Of Parsing and Message Formats.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wbisantosh |
Posted: Fri Jul 17, 2015 1:01 pm Post subject: |
|
|
Apprentice
Joined: 12 Nov 2012 Posts: 47
|
Thank you Very much for the Responses @Vitor and @kimbert. I understand,I will need to deep dive into this, will do so. And, as you mentioned, when needed, I can get some help from you Experts
Thanks
Santosh |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|