View Single Post
Old 11-18-2010, 08:13 PM   PM User | #8
grazopper
New to the CF scene

 
Join Date: Nov 2010
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
grazopper is an unknown quantity at this point
Ok, so I have taken the code, and completed the project. I had to make a couple of small tweaks to the code, but all in all the class you created worked beautifully!!

The only question I had was concerning looping. In one area, I need to manually set the Language Code (as an attribute) to EN. Currently, I am using this:


Code:
# Manually set the language code to EN
    e_nodes[0].setAttribute("LanguageCode", "EN")
    e_nodes[1].setAttribute("LanguageCode", "EN")
    e_nodes[2].setAttribute("LanguageCode", "EN")
    e_nodes[3].setAttribute("LanguageCode", "EN")
    e_nodes[4].setAttribute("LanguageCode", "EN")
    e_nodes[5].setAttribute("LanguageCode", "EN")
    e_nodes[6].setAttribute("LanguageCode", "EN")
    e_nodes[7].setAttribute("LanguageCode", "EN")
    e_nodes[8].setAttribute("LanguageCode", "EN")
    e_nodes[9].setAttribute("LanguageCode", "EN")
I attempted to create a loop by:

Code:
for node in e_nodes:
    e_node(node).setAttribute("LanguageCode", "EN")
However, I recieved an error. What would be the proper way to loop this?? Or did I do it correctly??

Once again, I can't thank you enough for your assistance!!!!
grazopper is offline   Reply With Quote