473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Determine order of different elements in a structure

!NoItAll
297 100+
I have a structure
Expand|Select|Wrap|Line Numbers
  1. Structure Dogs
  2.    Dim Boxers as Dog()
  3.    Dim Pitbulls as Dog()
  4.    Dim Mutts as Dog()
  5. End Structure
  6.  
  7. Structure Dog
  8.    Dim Color as String
  9.    Dim Name as String
  10. End Structure
  11.  
I am deserializing this structure from an XML file

Expand|Select|Wrap|Line Numbers
  1. <Dogs>
  2.    <Pitbulls>
  3.        <Dog>
  4.            <Color>Brown</Color>
  5.            <Name>Charlie</Name>
  6.        </Dog>
  7.        <Dog>
  8.            <Color>Black</Color>
  9.            <Name>Hermione</Name>
  10.        </Dog>
  11.    </Pitbulls>
  12.    <Mutts>
  13.        <Dog>
  14.            <Color>Tan</Color>
  15.            <Name>Riley</Name>
  16.        </Dog>
  17.        <Dog>
  18.            <Color>Red</Color>
  19.            <Name>Sam</Name>
  20.        </Dog>
  21.    </Mutts>
  22.    <Boxers>
  23.        <Dog>
  24.            <Color>Tortoise</Color>
  25.            <Name>Sargent</Name>
  26.        </Dog>
  27.        <Dog>
  28.            <Color>White</Color>
  29.            <Name>Missy</Name>
  30.        </Dog>
  31.    </Boxers>
  32. </Dogs>
  33.  
Notice that the order of the structure and the order of the XML is different - that shouldn't matter. But... the order I present the data to the user is important. The data was entered in a specific order and needs to be presented in the same order.
So based on the XML I need to present the data as follows.


Pittbulls
Charlie/Brown
Hermione/Black
Mutts
Riley/Tan
Sam/Red
Boxers
Sargent/Tortoise
Missy/White


So the structure fills out just fine, but the order in the XML file is different each time and I need to honor that in my display of the data. Ok - my actual program is not about dogs, this is just for illustrative purposes.
Does anyone have a suggestion (or is this too obtuse)?

!NoItAll
Jan 20 '14 #1
0 801

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Marcio Rosa da Silva | last post by:
Hi! In dictionaries, unlinke lists, it doesn't matter the order one inserts the contents, elements are stored using its own rules. Ex: >>> d = {3: 4, 1: 2} >>> d {1: 2, 3: 4}
1
by: Gooseman | last post by:
Hi Just getting into XSD and have some questions: If I have several different elements that all have identical attibutes, what is the best way of conveying that in the XSD? Is there a way...
4
by: Christine McGavran | last post by:
To continue a previous thread, sort of... I have defined a schema for describing a windows-style user interface. My application correctly parses and uses that schema. I'm now trying to get that...
10
by: Mike Dickens | last post by:
hi, suppose i have: <a> <b i="Y" j="aaaa"/> <c i="N" j="bbbb"/> <d i="Y" j="cccc"/> <e i="N" j="dddd"/> <f i="N" j="eeee"/> <g i="Y" j="ffff"/>
14
by: Alex Vinokur | last post by:
Here is some function that detects if a vector contains only different elements bool vector_contains_only_different_elements (const vector<int>& v) { for (int i = 0; i < v.size(); i++) { if...
3
by: project | last post by:
Hi every body, Any body can help me the following doubts? 1. what is constructor? 2. what is destructor? 3. what is overriding function. 4. different between structure and array 5. what is...
7
by: paul.rusu | last post by:
I have a element "v" wich has different types of objects a,b,c. and i do: for $x in $doc/v/a where ... return $x for $x in $doc/v/b where ... return $x for $x in $doc/v/c where ... return $x...
2
by: Bardo | last post by:
Hi all, I am a newbie to using the XML Schema Object Model (SOM) and would like a few pointers on how to perform a particular task. I am essentially trying to search for elements/attributes via...
2
by: libsfan01 | last post by:
hi all im looking for help on how you can track the order of elements in a parent div when these elements are dragable (with scriptaculous)? I tihnk i need to write a function that is called...
1
bugboy
by: bugboy | last post by:
This ajax is called from an onclick in a form element. I want to use one call to change 2 different elements. Is there a way to change the contents of another element at the same time, not just...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.