SimDesign

SimDesign software users forum
It is currently Thu Jun 20, 2013 1:25 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: NodeCount
PostPosted: Tue Oct 25, 2011 9:53 pm 
Offline
Member

Joined: Tue May 24, 2005 11:14 am
Posts: 10
Hi,

I'm a bit confused about the nodes. I had it before with another xml but now I don't have a clue. Example:

<t>
<field>ABBREVIATION.CODE</field>
<desc>
<p>This is the Abbreviation code by which the original text can be identified. </p>
<p>This field is used to specify the Abbreviation which will generate the ORIGINAL TEXT specified in Field ORIGINAL.TEXT. </p>
<p>Validation Rules</p>
<p>2-35 type SS (uppercase alpha or numeric, first character alpha) characters. No comma will be allowed in the Abbreviation text.</p>
</desc>
</t>

<t> is populated several times with different fields and descriptions. If I get to field, I want to get the related description by using ANode.Parent.GetNextSibling(ANode). It's getting only nil. Also ANode.Parent.FindNode('desc') gets nil.

So I looked in debugger and ANOde.Parent.NodeCount is equal to 1. Meaning, <t> has only one node.... ???

Any idea ?


Top
 Profile  
 
 Post subject: Re: NodeCount
PostPosted: Wed Oct 26, 2011 3:08 pm 
Offline
Member

Joined: Tue May 24, 2005 11:14 am
Posts: 10
Ok, this happens only for OnNodeLoaded event. Apparently the other child nodes are not read at this stage, so parent has just 1 child node. Most likely it would work the other way round, starting from desc as the last child. It definitely works ok with reading the nodes after loading them.
Rgds


Top
 Profile  
 
 Post subject: Re: NodeCount
PostPosted: Sat Nov 05, 2011 11:35 pm 
Offline
Site Admin
User avatar

Joined: Tue Jan 20, 2004 3:59 pm
Posts: 1425
Location: Hellevoetsluis, Netherlands
I dont know the exact code you wrote, but if we look at:

Code:
<t>
  <field>ABBREVIATION.CODE</field>
  <desc>
    <p>This is the Abbreviation code by which the original text can be identified. </p>
    <p>This field is used to specify the Abbreviation which will generate the ORIGINAL TEXT specified in Field ORIGINAL.TEXT. </p>
    <p>Validation Rules</p>
    <p>2-35 type SS (uppercase alpha or numeric, first character alpha) characters. No comma will be allowed in the Abbreviation text.</p>
  </desc>
</t>


..then <t> should have NodeCount=2, since it has 2 subnodes: field and desc, not counting any sub-sub nodes.

I am not sure why you use Node.Parent.NodeCount and/or where you use it. The parent of <t> itself could very well have NodeCount=1. So maybe you dont have <field> as node but perhaps <t> ?

Kind regards, Nils


Top
 Profile  
 
 Post subject: Re: NodeCount
PostPosted: Sat Nov 05, 2011 11:38 pm 
Offline
Site Admin
User avatar

Joined: Tue Jan 20, 2004 3:59 pm
Posts: 1425
Location: Hellevoetsluis, Netherlands
Oops sorry, saw that you already found the solution :)

Kind regards, Nils


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group