473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

issue with iteration

My code is building a DirectoryEntry and its siblings to match the
configuration set out in the xml file with the following structure:

<ou name="newDomain" schema="organizationalUnit">
<ou name="users" schema="organizationalUnit"></ou>
<ou name="domains" schema="organizationalUnit"></ou>
<ou name="profiles" schema="organizationalUnit">
<ou name="profileName=WEB" schema="apsProfile"></ou>
<ou name="profileName=MAIL" schema="apsProfile">
<ou name="configuredItemName=MAIL"
schema="apsItemConfiguration"></ou>
</ou>
<ou name="profileName=RADIUS" schema="apsProfile">
<ou name="configuredItemName=RADIUSAuthorisation"
schema="radiusAuthorisationPSCO"></ou>
<ou name="configuredItemName=RADIUSAuthentication"
schema="radiusAuthenticationPSCO"></ou>
<ou name="configuredItemName=RADIUSAccounting"
schema="radiusAccountingPSCO"></ou>
</ou>
</ou>
</ou>
And this is the method that interacts with the directory to build the
new entry:

private void populateDirectory(XmlNode currentNode, DirectoryEntry
currentEntry)
{
String name = currentNode.Attributes["name"].InnerText;
String schema = currentNode.Attributes["schema"].InnerText;
DirectoryEntry newEntry = currentEntry.Children.Add(name, schema);

newEntry.CommitChanges();

foreach (XmlNode node in currentNode.SelectNodes("ou"))
{
populateDirectory(node, newEntry, false);
}
}

The problem with the code is the iteration. The example above just adds
new children to the current entry , it basically doesn't understand the
parent of the current entry that it's writing.

This is more of a logical question rather than ADSI or .Net, how do you
position the iteration so it correctly iterates through the xml and
builds the directory?

Thanks

Nov 17 '05 #1
0 954

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: Raymond Hettinger | last post by:
Here is a discussion draft of a potential PEP. The ideas grew out of the discussion on pep-284. Comments are invited. Dart throwing is optional. Raymond Hettinger ...
2
by: Abdullah Khaidar | last post by:
Is there any iteration style we must use to get faster processing time? I've tried with some style to concat number in list. But I still don't know which one is the recommended style. >>> def...
28
by: rbt | last post by:
Either I'm crazy and I'm missing the obvious here or there is something wrong with this code. Element 5 of this list says it doesn't contain the string 255, when that's *ALL* it contains... why...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
7
by: Shane | last post by:
Hi, Thanks in advance for the help. I have been to many websites and tried several solutions to my problem, but have fixed part of it. It's time to come humbly to the newsgroups for help :-) ...
3
by: Jesper Stocholm | last post by:
I have developed a data-cleaner that extracts some data from a database, cleans it for illegal/unwanted data and writes it to a CSV-fil for later insertion to a SQL Server 2000 database. My problem...
75
by: Sathyaish | last post by:
Can every problem that has an iterative solution also be expressed in terms of a recursive solution? I tried one example, and am in the process of trying out more examples, increasing their...
12
by: Chief | last post by:
Hey I have a CODE that some 1 wrote however he use this line x= (y=4,z=6); ( by the way the output of this line is x=6 , y=4 , z=6 ) i was wondring in what situation i will have to use it?...
1
by: saikatbose2005 | last post by:
Hi, Ineed some help from anyone regarding an issue I'm facing. I've created an image dynamically on clicking a button. What I inetend to do is when I click on the created image it will popup a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.