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 » What about sorting an unbounded element?

Post new topic  Reply to topic
 What about sorting an unbounded element? « View previous topic :: View next topic » 
Author Message
MikeOliverAZ
PostPosted: Mon Sep 22, 2014 5:53 pm    Post subject: What about sorting an unbounded element? Reply with quote

Apprentice

Joined: 10 Jul 2013
Posts: 47

I have a schema element defined as

Code:

<xsd:complexType name="OtherVariablesType">
      <xsd:sequence>
         <xsd:element maxOccurs="unbounded" minOccurs="1"
            name="OVParam1" type="xsd:string" nillable="true" />
         <xsd:element maxOccurs="unbounded" minOccurs="1"
            name="OVParam2" type="xsd:string" nillable="true" />
         <xsd:element maxOccurs="unbounded" minOccurs="1"
            name="OVParam3" type="xsd:string" nillable="true" />
         <xsd:element maxOccurs="unbounded" minOccurs="1"
            name="OVParam4" type="xsd:string" nillable="true" />
         <xsd:element maxOccurs="unbounded" minOccurs="1"
            name="OVParam5" type="xsd:string" nillable="true" />
      </xsd:sequence>
   </xsd:complexType>


I want to sort the unbounded arrays what would be the arguments to quickSort to do that since there is no 'value' attribute?
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Sep 23, 2014 5:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

First of all, presumably you mean the quicksort sample code posted around here somewhere.

Second of all, the element itself is going to have the value you want to sort on.

Third of all, the elements already have to be at least rough-sorted. The schema does not allow for any instance of OVParam1 to occur after any instance of OVParam2. All OVParam1's have to be listed first in the sequence, then all OVParam2s and etc. etc. etc.

If all you needed to do was ensure that, then you could quicksort on the fieldname.
Back to top
View user's profile Send private message
MikeOliverAZ
PostPosted: Tue Sep 23, 2014 3:45 pm    Post subject: yes, ? and yes Reply with quote

Apprentice

Joined: 10 Jul 2013
Posts: 47

Grand Master,

Yes I am talking about the quickSort posted in the thread.

Yes it is presorted, sort of with CREATE NEXTSIBLING used to populate the arrays which tends to group the elements by name.

Yes I know the element contains the value, the example given uses a "value" attribute and an 'element' field name...not the clearest example I ever saw.

My question is given the schema example I gave what would be the call to quicksort to sort on OVParam5? I gather the 'OVParam5' is the element name, but since there is no 'value' attribute, what replaces 'value' in the call arguments?
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Sep 24, 2014 5:04 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The element itself has a value, presumably.

The element in the *real* XML document will look like "<OVParam1>thisismyvalue</OVParam1>".

That value will be represented in Broker as something like InputRoot.XMLNSC.Message.Body.OtherVariablesType.OVParam1

it sounds like you need to review Broker basics a bit, before you try using quicksort.
Back to top
View user's profile Send private message
MikeOliverAZ
PostPosted: Wed Sep 24, 2014 3:28 pm    Post subject: Oh really Reply with quote

Apprentice

Joined: 10 Jul 2013
Posts: 47

Grand Master,

If you want to answer the question, please do, if you want to just pontificate, keep it to yourself.

I know how my data is structured, I know too that the example in the thread uses a "value" attribute, which is bad form to say the least. The example also uses an element named element....good god.

So my question is what string do I use in the quickSort "value" argument for normal xml where the value is the content of the element. I can use quickSort on sorting complex types where I am sorting on a field in the complexType, it doesn't look like I can use it to sort an unbounded simple element.

If I call myself Grand, I probably am not.
Back to top
View user's profile Send private message Send e-mail
Armageddon123
PostPosted: Wed Sep 24, 2014 10:54 pm    Post subject: Reply with quote

Acolyte

Joined: 11 Feb 2014
Posts: 61

Quote:
If I call myself Grand, I probably am not.


afaik, nobody calls themselves *Grand* here . it is based on

http://www.mqseries.net/phpBB2/viewtopic.php?t=43098

Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Sep 25, 2014 5:24 am    Post subject: Re: Oh really Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

MikeOliverAZ wrote:
Grand Master,

If you want to answer the question, please do, if you want to just pontificate, keep it to yourself.


I'm sorry you don't believe I answered the question. I did, at least as far as I know.

Otherwise, really, please answer 1,000 other questions here before you start to question my methods.

Also, you may find that other people will get a bit annoyed at you posting twice with the same question.
Back to top
View user's profile Send private message
MikeOliverAZ
PostPosted: Thu Sep 25, 2014 3:52 pm    Post subject: Re: Oh really Reply with quote

Apprentice

Joined: 10 Jul 2013
Posts: 47

mqjeff wrote:
MikeOliverAZ wrote:
Grand Master,

If you want to answer the question, please do, if you want to just pontificate, keep it to yourself.


I'm sorry you don't believe I answered the question. I did, at least as far as I know.

Otherwise, really, please answer 1,000 other questions here before you start to question my methods.

Also, you may find that other people will get a bit annoyed at you posting twice with the same question.


mqjeff, I don't want to start a flame war, but YOU did not answer the simple question on what to use as an argument, and YOU denigrated me first. I may be new on this forum but I have been developing on Broker sing 2006 and been in this business longer than you I would wager. Unlike some I don't think I know everything, so I ask questions.
_________________
SOACA, Lead Architect Smart Comunications
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Fri Sep 26, 2014 4:37 am    Post subject: Re: Oh really Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

MikeOliverAZ wrote:
I have been developing on Broker sing 2006 and been in this business longer than you I would wager. Unlike some I don't think I know everything, so I ask questions.

And knowing Jeff, there's a very high probability you'd be loosing this wager...
Like any other advice you may get from strangers on the internet, take with a grain of salt... No need to get upset...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Sep 26, 2014 5:07 am    Post subject: Re: Oh really Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fjb_saper wrote:
MikeOliverAZ wrote:
I have been developing on Broker sing 2006 and been in this business longer than you I would wager. Unlike some I don't think I know everything, so I ask questions.

And knowing Jeff, there's a very high probability you'd be loosing this wager...
Like any other advice you may get from strangers on the internet, take with a grain of salt... No need to get upset...




Not a good wager. Also given Jeff's technical background, he may well know everything in this area.....

As I and others have said, dial it down.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 26, 2014 5:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So I was a professional programmer in 1989. (professional only in the sense of 'I am actually getting paid to do this by a real company', I were a bit young at the time)

I've been working with Broker since 2.1, CSD3.

I am honestly trying to help, and honestly trying to be respectful.

I am honestly very serious that until you've really spent a long time posting here, you do not have a solid understanding of what gets posted and by whom.

I do not understand how your question is different from "I want to send in the value of an element rather than the value of an attribute, to the ESQL procedure known as quicksort".

So the answer to that question, as I understand it, is to provide the element itself, rather than the attribute. Which is the answer I gave.

If that doesn't match with the way the function is coded, and I admit I didn't review the code of the function, then the answer I'd give is "adjust the code of the function to match your needs".

If that wasn't the question you asked, then perhaps you could rephrase the question.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Sep 26, 2014 5:15 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
I've been working with Broker since 2.1, CSD3.


And not always as a customer.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Fri Sep 26, 2014 12:55 pm    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

If you (or anyone) still needs help post a sample XML to XML (with a few elements)

I won't try and figure from the xsd.

Otherwise we guess you're just done / found sth else to do
_________________
Just use REFERENCEs
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 » What about sorting an unbounded element?
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.