Author |
Message
|
farubino |
Posted: Thu May 14, 2009 4:43 am Post subject: Parsing ignoring xsd type validation |
|
|
Novice
Joined: 17 Mar 2009 Posts: 13
|
Hi,
is it possible parsing in mrm or xmlnsc domain ignoring the schema? I tried with
Code: |
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateNone);
|
but for example if in a field there is an character instead an integer, I have error:
Code: |
'Error converting characters into a data value'
|
This is right, but is it possible ignoring with the parse options, this kinds of errors? |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 14, 2009 1:40 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
farubino |
Posted: Fri May 15, 2009 1:02 am Post subject: |
|
|
Novice
Joined: 17 Mar 2009 Posts: 13
|
kimbert wrote: |
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp
- Which topics have you looked at?
- Have you tried using the Search button? |
I tried but I didn't find. I need to parse a message without any validation, and passing that kind of options, I have validation errors anyway |
|
Back to top |
|
 |
kimbert |
Posted: Fri May 15, 2009 3:08 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I tried but I didn't find |
This is clearly explained in the product documentation. No help will be given until you explain what you have searched for, and what topics you have read. |
|
Back to top |
|
 |
farubino |
Posted: Fri May 15, 2009 3:26 am Post subject: |
|
|
Novice
Joined: 17 Mar 2009 Posts: 13
|
kimbert wrote: |
Quote: |
I tried but I didn't find |
This is clearly explained in the product documentation. No help will be given until you explain what you have searched for, and what topics you have read. |
I read http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp and searching on the site but I can't find a solution because it seems it ignore my options.
Code: |
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateNone);
|
ValidateNone is ignored, because I have a type error validation. I don't want the error is thrown, just want all the fields are parse like alphanumeric, ignoring date, integer described in the mxsd definition. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 15, 2009 4:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kimbert wrote: |
Which topics have you looked at? |
kimbert wrote: |
what topics you have read |
Perhaps if you could post a few topic links indicating what led you to the strategy you're employing? Specifically why you're parsing using the method you are?
If we knew a bit more about your requirements, and what led you to achieve them in this specific way, we could offer better advice? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
farubino |
Posted: Fri May 15, 2009 4:42 am Post subject: |
|
|
Novice
Joined: 17 Mar 2009 Posts: 13
|
Vitor wrote: |
If we knew a bit more about your requirements, and what led you to achieve them in this specific way, we could offer better advice? |
I have a csv file in input in a BLOB domain, and I need to parse it.
Code: |
DECLARE bodyEnv REFERENCE TO Environment;
DECLARE bitStream BLOB;
SET bitStream = InputRoot.BLOB.BLOB;
DECLARE myMessage REFERENCE TO Environment.Variables;
CREATE LASTCHILD OF myMessage DOMAIN ('MRM') NAME 'MRM';
CREATE LASTCHILD OF myMessage.MRM AS bodyEnv PARSE ( bitStream
OPTIONS parseOptions
SET 'MySet'
TYPE 'MyMessageType'
FORMAT 'CSV');
|
I want just to know if it's possibile disabling type validation, because I need to don't validate it at this moment ( I validate later) so I need just my tree structure ignoring if the fields had datetime or numbers Bad formatted. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 15, 2009 4:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
farubino wrote: |
[I have a csv file in input in a BLOB domain, and I need to parse it. |
Sort of guessed that from your posts about parsing, but why it is a BLOB? Why is it not validated on input? What value is there in picking up and processing a file which could fail in a later step due to bad format?
What I'm driving at (and sorry to sound like a cracked record) is why do it this way? What is the requirement? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 15, 2009 5:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
farubino wrote: |
I have a csv file in input in a BLOB domain, and I need to parse it. |
Here's a thing; in your original post you said:
farubino wrote: |
is it possible parsing in mrm or xmlnsc domain ignoring the schema |
So where's this CSV file (which won't parse in XMLNSC or match an XML Schema) come from?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
farubino |
Posted: Fri May 15, 2009 5:03 am Post subject: |
|
|
Novice
Joined: 17 Mar 2009 Posts: 13
|
Vitor wrote: |
farubino wrote: |
[I have a csv file in input in a BLOB domain, and I need to parse it. |
Sort of guessed that from your posts about parsing, but why it is a BLOB? Why is it not validated on input? What value is there in picking up and processing a file which could fail in a later step due to bad format?
What I'm driving at (and sorry to sound like a cracked record) is why do it this way? What is the requirement? |
I receive it from a webservice - SOAP input node (with a file attachment - binary field) this field is my blob (the csv) and I need to parse it, the parse is working good, with no problem, I just need to don't validate it at this time of my flow, (it will be validated in the next flows) because this csv has many children inside, and I need to validate them one to one, splitting it. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 15, 2009 5:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
farubino wrote: |
I receive it from a webservice - SOAP input node (with a file attachment - binary field) this field is my blob (the csv) and I need to parse it |
Ok. The attachment won't match the XSD of anything, and if all you're trying to split the attachment into it's components without looking at the contents then you'll need a message format that conforms to that requirement rather than one which matches the file format.
Or validate it up front rather than pass it down to fail later, which still seems a little odd. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
farubino |
Posted: Fri May 15, 2009 5:12 am Post subject: |
|
|
Novice
Joined: 17 Mar 2009 Posts: 13
|
Vitor wrote: |
you'll need a message format that conforms to that requirement rather than one which matches the file format.
|
May be this is the only solution, I thought that passing to the parse the Option ValidateNone, I could have a simple tree structure with all the fields like strings, ignoring the types. |
|
Back to top |
|
 |
kimbert |
Posted: Sat May 16, 2009 12:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
OK - I finally have enough information to answer your question.
- The MRM parser always builds the message tree using XML schema types. If a field is declared as xs:int then it will be put into the message tree as an INTEGER
- XMLNSC parses XML. You are parsing CSV. I am still trying to work out why you even mentioned XMLNSC in your first post.
The solution is to change the type of all elements in your message set to xs:string. |
|
Back to top |
|
 |
|