|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Validate XML against XSD |
« View previous topic :: View next topic » |
Author |
Message
|
saviobarr |
Posted: Thu Mar 09, 2017 6:50 am Post subject: Validate XML against XSD |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Hi everyone,
I have a HTTP Input, which receives a XML message. I have to validate the incoming message agains a xsd, but I saw no HTTP Input property where I can provide the xsd. I tried the "Message Model" property, by typing xsd name. It didn go thru.
I went thru the KC, but I could not find the information.
Do you guys have a suggestion?
Kind regards,
Savio Barros _________________ Go as far as you can go. Then go farther! |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 09, 2017 6:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Add the xsd to your application/service/whatever. Tell the HTTPInput node to use the XMLNSC parser.
As long as the XSD describes the document that you receive, it will validate.
If you want to validate content as well as structure, you need to alter the properties of the HTTPInput node to "Content and Value"... _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
saviobarr |
Posted: Thu Mar 09, 2017 7:07 am Post subject: |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Hi, thanks for replying
mqjeff wrote: |
Add the xsd to your application/service/whatever. Tell the HTTPInput node to use the XMLNSC parser. |
The xsd is already in the application and the HTTInput node is set to parse the incoming message to XMLNSC domain.
mqjeff wrote: |
As long as the XSD describes the document that you receive, it will validate.
If you want to validate content as well as structure, you need to alter the properties of the HTTPInput node to "Content and Value"... |
Don't I have to tell to HTTPInput node which xsd it must use to validate the incoming message?
Many thanks
Savio _________________ Go as far as you can go. Then go farther! |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 09, 2017 7:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You don't have to tell the node which XSD to use.
It will match the root tag of the XML document with the XSD that matches that tag...
So if you have a document like
and xsds
and
Code: |
...<TheOtherDoc>... |
, the XMLNSC parser will use the MyDoc xsd. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
saviobarr |
Posted: Thu Mar 09, 2017 7:21 am Post subject: |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Great! It worked!
Thanks again
Savio _________________ Go as far as you can go. Then go farther! |
|
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
|
|
|
|