Carl
11/21/2007 5:44:00 AM
Martin Durai <martin@angleritech.com> writes:
> Thank you carl, iam very new to this language
>
> sorry carl could you help with this code fully
>
> for( int i = namespaceEnd -1; i >= 0; i--) {
> if( prefix.equals( namespacePrefix[ i ] ) ) {
> return namespaceUri[ i ];
> }
>
>
> thank you in advance
>
I suspect you're looking for the element in the namespaceUri
array which is at the position determined by looking up the
position of 'prefix' in the namespacePrefix array (how very
unsettling). Assuming namespaceEnd is actually the count of
elements in the namespacePrefix array, would this work?
your_value = (i = namespace_prefix.index(prefix)) ?
namespace_uri[i] :
nil
Where 'your_value' will now contain the namespace_uri value,
or nil if it was not found in namespace_prefix
If i've misunderstood your question, post back with the values
of prefix, namespacePrefix, namespaceUri and namespaceEnd, and
what you expect to get out of it and I'll see if I can't help.