This content has been marked as final. Show 4 replies
what are you trying to do ? why you need to find these "brackets" ?
why you can't go from other side - iterating XML collection ?
if you go to UI and select this bracket and hit F8 - you will see on INFO palette UNICODE code 0xFEFF - but there is no IdSpecialCharacter for XML "brackets" - you can only find it as unicode code
The reason why I'm doing this is I want to be able to select text in a document and determine if the selected text is a existing xml tag. And if it is not, I want it to make one.
To do this, I am comparing the contents of the associated xml element (of the selection) with the contents of the selected text itself. When I compare the contents of the associated xml tag and the selected text, sometimes the bracket characters prevent my script from correctly finding matchs. So I need to remove all instances of the brackets from my strings.
So is there a way to find the UNICODE value of a character in scripting?
Robert, I was able to extract a value from the character using the AscW function. The value I got was -257. Is there any way to verify this is the same value as 0xFEFF.
-257 is 0xFEFF (as a signed 2 byte word).
I don't think that's a terribly reliable way of checking XML tags (I seem to remember this is more an internal "IsNotUsual" code for ID). And you don't know if it's a start or end tag.
Your script may or may not pick up this code in the selected string, depending on where you start and end your selection. You can use regular string functions to remove them from the string.
Perhaps it's better to walk over the XML tree and check if each element's start and end value ("storyOffset" for the start, a quick eyeballing of the help didn't reveal a good candidate for its end) is at the start and end of your selection.