ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » A Huge XML Document parsing

Post new topic  Reply to topic
 A Huge XML Document parsing « View previous topic :: View next topic » 
Author Message
PEPERO
PostPosted: Sun May 21, 2017 7:56 am    Post subject: A Huge XML Document parsing Reply with quote

Disciple

Joined: 30 May 2011
Posts: 177

Hi;
Suppose an input file contains an XML document in which there is one complex element as the file header ;meaning have some local element about the whole file ; and a hundred thousands occurences of another complex element as the body records. As each iteration of the message flow starting with the FILEINPUT node must consume one record, a hundred thousands plus one iteration is required parsing all of the file. What type of parser should i choose to recognise the header element or each of the body records and also validate them. Consider i don't want to use the whole file as a message.
I used the XMLNSC but as it contains a root element, i cannot use the 'PARSED RECORD SEQUENCE' for record detection.
Back to top
View user's profile Send private message
timber
PostPosted: Sun May 21, 2017 2:03 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Good problem description. You are not the first to ask about this. The answer is to change your message model from
Code:
Message
    sequence
        Header (1/1)
        Record*
        Footer (1/1)

to
Code:
Message
    Record*
        choice
            Header (1/1)
            InnerRecord (1/1)
            Footer (1/1)

That way, the header is also a 'record' and will be reported first. Then, each inner record is reported as an invidivual 'record'. Finally, the footer gets reported.
Back to top
View user's profile Send private message
PEPERO
PostPosted: Sun May 21, 2017 8:08 pm    Post subject: Reply with quote

Disciple

Joined: 30 May 2011
Posts: 177

thanks for the given solution.
Back to top
View user's profile Send private message
PEPERO
PostPosted: Mon May 22, 2017 12:33 am    Post subject: Reply with quote

Disciple

Joined: 30 May 2011
Posts: 177

So as the originator makes and sends the message in XML format , I've to parse and validate each record separately. In the other side the input message is contained within a single Document element. How could i use the parsed record sequence rule for record detection when having the follow message format.
Code:

Message
    Record*
        choice
            Header (1/1)
            InnerRecord (1/1)

Notice that the Message part is put into a Document element.
Back to top
View user's profile Send private message
timber
PostPosted: Mon May 22, 2017 11:55 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

You are correct - my advice does not work for an XML document where the header and body are enclosed within a root tag. However, if you use the search button you should find lots of advice on how to deal with large messages. You will probably end up using the techniques described in this document:
https://www.ibm.com/developerworks/websphere/library/techarticles/0505_storey/0505_storey.html
but using XMLNSC instead of MRM (of course). There may even be a sample that demonstrates how to do it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » A Huge XML Document parsing
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.