You could use an XPath statement of the form /[EMAIL PROTECTED]'xyz'] to 
'select' the node you're looking for. 

I'm not sure XPath is supported with TXMLDocument but you could use 
XMLPartner from http://sourceforge.net/projects/tpxmlpartner/  and use 
the SelectSingleNode() method.

I hope I've understood your question and that this helps...
Dave

Vahan Yoghoudjian wrote:

>    Ok... the question was too complicated obviously... let me try to put
>this in another way..
>
>    I have an XML node with a number of childnodes each one identified by an
>attribute. When I get the parent node can I position myself in a given child
>node according to the attribute value without scanning all the childnodes
>one by one until I reach the given node?
>
>Hope I made myself clear this time
>Vahan
>
>-----Original Message-----
>From: Vahan Yoghoudjian [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, March 22, 2005 11:57 AM
>To: Yahoo Groups: XML Doc; Yahoo Groups: Delphi Programmers; Yahoo Groups:
>Delphi En
>Subject: [delphi_programers] Reading from two XML related nodes
>simultaneously
>
>
>    Hi Group
>
>    My problem is a problem of speed and optimization, I have an XML
>document that I'm supposed import data from into my application's database
>tables. I can not change the XML file structure where I have 2 related
>tables. I'm using Delphi 6 and TXML Document to read from the XML file.
>    Here's my situation.
>
>Each table is structured as an XML node. I have a table called "Items", I
>assign it to a local variable and start looping all the child nodes to
>import the data, my problem is that for each item I have to go to another
>node which is called "prices" and get the related prices of the same item
>before posting it into my table. As you notice I have two "tables" in my xml
>file that are supposed to be stored in one table in my application.
>
>Here's a child node from table "Items"
>
><RECORD CODE="12MANCHEASO">
>                  <NAME>1/2 manche pr homme AS offre colle O</NAME>
>                  <DEPARTMENT>STANDARD</DEPARTMENT>
>                  <MANAGECURR>USD</MANAGECURR>
>                  <ITEMTYPE caption="physical item">I</ITEMTYPE>
>                  <ITEMQUANTITYTYPE caption="single">S</ITEMQUANTITYTYPE>
>                  <QTY1DECIMALS>0</QTY1DECIMALS>
>                  <QTYONHAND>1</QTYONHAND>
>                  <AVGCOST_CUR>1.25</AVGCOST_CUR>
>                  <AVGCOST_USD>1.25</AVGCOST_USD>
>                  <AVGCOST_LBP>1875</AVGCOST_LBP>
>                  <TAXATIONGROUP>STANDARD</TAXATIONGROUP>
></RECORD>
>
>Here's a child node from table "Prices"
>
>
><RECORD CODE="12MANCHEASO">
>                  <RetailCurr>LBP</RetailCurr>
>                  <RetailPriceWithVAT>2,750.00</RetailPriceWithVAT>
>                  <RetailPriceNOVAT>2,500.00</RetailPriceNOVAT>
>                  <RetailDiscountPct>0.00</RetailDiscountPct>
>                  <WholeSaleCurr>LBP</WholeSaleCurr>
>                  <WholeSalePriceWithVAT>2,750.00</WholeSalePriceWithVAT>
>                  <WholeSalePriceNoVAT>2,500.00</WholeSalePriceNoVAT>
>                  <WholeSaleDiscountPct>0.00</WholeSaleDiscountPct>
></RECORD>
>
>    When I'm positioned on a given node in node "Items" how can I go
>directly to the related node in "Prices", the way I'm doing now is by
>scanning the child nodes of "Prices" one by one until I reach the related
>one and delete it after use to scan less child nodes next time. It works but
>it's time consuming
>    Is there's a better way to do it?
>
>Sorry for my long and complicated messsage
>Thanks in advance
>
>Vahan
>
>
>[Non-text portions of this message have been removed]
>
>
>      Yahoo! Groups Sponsor
>            ADVERTISEMENT
>
>
>
>
>
>----------------------------------------------------------------------------
>----
>Yahoo! Groups Links
>
>  a.. To visit your group on the web, go to:
>  http://groups.yahoo.com/group/delphi_programers/
>
>  b.. To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>
>  c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>
>[Non-text portions of this message have been removed]
>
>
>
>-----------------------------------------------------
>Home page: http://groups.yahoo.com/group/delphi-en/
>To unsubscribe: [EMAIL PROTECTED] 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>
>  
>



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to