× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank you for your replies.

I have spent a bit more time looking at this now and think I can see the
problem.

If for example I have the following datastructure setup and I am using
the following XML-INTO options:

CODE
====
d notification ds QUALIFIED
d peanut likeds(peanutds)

d peanutDS ds QUALIFIED
d babyNut likeds(babyNutDS)DIM(10)
d countbabyNut 5i 0

d babyNutDS QUALIFIED
d type 10a
D wieght 10a

xml-into notification %XML(xmlDocument :
'doc=file +
trim=all +
countprefix=count +
allowmissing=yes +
case=any');

XML 1:
======
If my xml file looks like this:

<notification>
<peanut>
<babyNut>
<type>almond</type>
<weight>100g</weight>
</babyNut>
</peanut>
</notification>

Then my countbabyNut gets set to 1. This is what I would expect.

XML 2:
======

If my xml file looks this this, (no <babynut> element):

<notification>
<peanut/>
</notification>

Then my countbabyNut gets set to 0. This is also what I would expect


My problem then comes with the following example...

XML 3:
======
<notification/>

Now it appears that because the <peanut> element is missing, the
XML-INTO maybe realises that
there will obviously be no instance of babyNut, but does not set the
countbabyNut to 0, but leaves it blank, and as I am using a 5i 0 field,
this becomes 16448.
In my program I have a for loop that is reading through the babyNut
array using countbabyNut to determine how many elements I have, but
because
it now thinks I have 16448 I am getting an error.

Kind regards
Luke


-----------------------------------------------------------------------
The information contained in this email is confidential and may also contain privileged information. Sender does not waive confidentiality or legal privilege. If you are not the intended recipient please notify the sender immediately; you should not retain this message or disclose its content to anyone.
Internet communications are not secure or error free and the sender does not accept any liability for the content of the email. Although emails are routinely screened for viruses, the sender does not accept responsibility for any damage caused. Replies to this email may be monitored.
For more information about the Tullett Prebon group of companies please visit the following web site: www.tullettprebon.com

-----------------------------------------------------------------------

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.