×
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.
On 2025-01-15 3:33 p.m., Dave wrote:
...
How would I indicate the path if parts is nested in another array like
this ? :
<object><id>O1</>
<parts>
<part><qty>100</qty><id>A1</id><cost>12.03</cost></part>
<part><qty>2</qty><id>A4</id><cost>1.98</cost></part>
</parts>
</object>
<object><id>O2</>
<parts>
<part><qty>100</qty><id>B1</id><cost>12.03</cost></part>
<part><qty>2</qty><id>B4</id><cost>1.98</cost></part>
</parts>
</object>
...
Assuming there is an outer element holding the <object> elements
<outer>
<object><id>O1</id>
<parts>
<part><qty>100</qty><id>A1</id><cost>12.03</cost></part>
<part><qty>2</qty><id>A4</id><cost>1.98</cost></part>
</parts>
</object>
<object><id>O2</id>
<parts>
<part><qty>100</qty><id>B1</id><cost>12.03</cost></part>
<part><qty>2</qty><id>B4</id><cost>1.98</cost></part>
</parts>
</object>
</outer>
You specify the path that gets to each part.
path=outer/object/parts/part
It will find every instance of an XML element that has that path from
the beginning of the document, so it will find all 4.
DATA.QTY(1) = 100
DATA.ID(1) = 'A1'
DATA.COST(1) = 012.03
DATA.QTY(2) = 2
DATA.ID(2) = 'A4'
DATA.COST(2) = 001.98
DATA.QTY(3) = 100
DATA.ID(3) = 'B1'
DATA.COST(3) = 012.03
DATA.QTY(4) = 2
DATA.ID(4) = 'B4'
DATA.COST(4) = 001.98
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.