Welcome! Log In Create A New Profile

Advanced

WD23 xml files

Posted by jtadebruin 
WD23 xml files
October 08, 2018 04:20PM
Hey Forum

I hope you can help...

This is a little xml code

<Ordered>
<count>1</count>
</Ordered>
<Text tag="Extra Info: ">AAAAAAA</Text>
<Text tag="Tekst: ">BBBBBBB</Text>
<Ordered>
<count>2</count>
</Ordered>
<Text> CCCCCC</Text>

My problem is :

How can i know that

Extra Info en Tekst belongs to count 1

and

AFHALEN belongs to count 2
Re: WD23 xml files
October 08, 2018 04:43PM
Hi,

Is this "real" XML or XML that you "invented"?

The way you would normally recognise the text belonging to the count would be like this:

<Ordered> 
<count>1</count> 
<Text tag="Extra Info: ">AAAAAAA</Text> 
<Text tag="Tekst: ">BBBBBBB</Text> 
</Ordered> 
<Ordered> 
<count>2</count> 
<Text> CCCCCC</Text> 
</Ordered>

Regards,
Darren.
Re: WD23 xml files
October 08, 2018 05:05PM
Yep i know

It is an xml file from a supplier , i have to deal with it...moody smiley
Re: WD23 xml files
October 08, 2018 05:58PM
In that case, you can either:
1) Inform them of the error of their ways and ask them to fix their XML
...or...
2) You'll have to tell them youy're making the assumption that the Text tag after the most recent </Ordered> end tag will be related to that previous section. I don't see what else you can do.

Good luck!

Regards,
Darren.
Re: WD23 xml files
October 08, 2018 08:48PM
Hey Darren

the most recent </Ordered> end tag will be related to that previous section. I don't see what else you can do.

How should I do that ? Any idea??
I could read everything in a string but that so clumsy

TIA
Jan
Re: WD23 xml files
October 08, 2018 10:37PM
Hi,

There are a whole host of XML functions, but don't forget, there's also a specific XML variable type called XMLDocument:

[doc.windev.com]

...not to mention the various XML Unit examples that come with WX.

Regards,
Darren.
Re: WD23 xml files
October 09, 2018 10:48AM
Thanks Darren i solved it all ready thumbs upthumbs up
Re: WD23 xml files
October 09, 2018 01:34PM
Great stuff!

What did you do in the end? ...you never know it might help other people on the forum in the future. smileys with beer

Regards,
Darren.
Re: WD23 xml files
October 11, 2018 09:35AM
Hey Darren

I browse thru the xml file and count the orders-nodes and when the orders-node is finished and there is an /text node then i fill a array
i am not proud on this solution but it works confused smiley


Jan
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: