Community Forum

Problem with "hasXMLProperty" function

Forum Overview >> Scripting

CategoryScripting
Created05.03.2013 18:18


Andreas Großschedl (Unknown) 05.03.2013 18:23
Hi!

I have a problem with the "hasXMLProperty" Function... here is some code:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<elements>
<element1 filename="btn1.dds" />
<element2 filename="btn2.dds" />
</elements>


print(hasXMLProperty(xmlId, "elements.element2"));
print(hasXMLProperty(xmlId, "elements.element1#filenamesy."));
print(hasXMLProperty(xmlId, "elements.element1.xxx"));
print(hasXMLProperty(xmlId, "elements.element1.filename"));
print(hasXMLProperty(xmlId, "elements.element1#filename"));

result:

true,true,false,false,true ?????

can anybody explain this?

thx ag12041980

D. Ecker (Decker_MMIV) 16.03.2013 18:35
> print(hasXMLProperty(xmlId, "elements.element1#filenamesy."));

That is the only one, which I see as a "problem". But due to you having a dot-character (.) as the last character in the 'propertyPath' argument, I guess the internal XML-validator gets confused.

The other four results seems to be correct.

If this is not the explanation you were looking for, the please be more elaborate about which of the results you are confused about.


Note: Log in to post. Create a new account here.