5 Replies Latest reply on Aug 24, 2009 11:09 AM by SuperMacGuy

    CS3/4 Is there a char for an XML tag?

    SuperMacGuy Level 2

      I have a script that gets the value of an XML element. If some of my users make the tagged text wrong, then I get an extra invisible character in the string, and that string is used to make a file name, and then I have problems later since this invisible character is illegal in the filesystem. I'm working on Mac, if it might matter.

      So, is there a character that is the equivalent of one of the tagging brackets? Here's how my users are mistakenly making their tags.

       

      1. Make a new document
      2. draw a text frame, type a couple characters like "foobar"
      3. open tag pallet. Make a new tag like "tag1"
      4. select all text with the text tool.
      5. apply tag to text. You should NOT see tag brackets on the text by default because the entire text frame is tagged.
      6. now select all the text EXCEPT the last character. If you typed "foobar" only select "fooba"
      7. Apply tag. Now you will see tag brackets.
      8. Now unselect text.
      9. Use arrow keys to key forward through text. When  you get to the closing bracket, you will have to key over 2x to get the cursor to move. This suggests to me there is an invisible character.

       

      Now when I am running my script, it sometimes picks up the invisible character. I need to be able to strip it off.

      Because the length of text varies, I can't chop off "char -1" because sometimes the text is tagged correctly and I don't have the invisible char. I think it's Unicode (maybe?).

       

      If you post some code, please use Applescript. Thx.

       

      Thanks,

      Chris