3 Replies Latest reply on Jan 21, 2015 7:41 PM by KenWK

    Errant XML Tag

    KenWK Level 1

      Greetings all! Working in InD CS6 in Windows 7.


      I've got an XML element in a document that I can't do anything with and which doesn't appear to be associated with anything in the InD file. The red line is pointing to it in the Structure panel in image below. Note the X through its icon.


      The XML is added to the InD file by mapping styles to tags using the Load... button on the Map Styles to Tags dialog and "importing" them from another InD document.


      When right clicking this element in the Structure panel and selecting Go to Item the current selection goes away but then nothing else happens. Nor can I delete this element from the Structures panel. I had a similar issue a bit a go where I somehow ended up with elements in the XML that were not associated to anything in the document. Those had wording showing in the Structure panel after the name like others shown above but, again, going to them didn't go anywhere. I hadn't investigated it at the time because I was able to simply delete from the structure.


      With this element, however, I can't get rid of it without un-tagging the whole frame. I have a script routine that updates the XML attributes based on the style(s) applied to them. This element, though causes a scripting scripting error trying to access the .Text(1), because it doesn't exist, I'm guessing. The script iterates through all the XML elements so I can open the Structure pane and use .Select on the element to select it of an error occurs. But that's IT!


      So, I guess I really have a few questions. That is this thing!? How the heck did it get there? And is there anything I can do in scripting to "see" it as a the errant element it is?


      Thanks for reading this way-too-long-post.


      All the best,


        • 1. Re: Errant XML Tag
          cchimi Level 2

          I do not have an answer to your question, but this page does list all of the different Structure Pane icons: InDesign Help | Structuring documents for XML. Yours refers to an empty element (empty frame). I couldn't easily recreate it in a sample doc, so it's not super helpful on its own (but that page is kind of handy).

          • 2. Re: Errant XML Tag
            KenWK Level 1

            Thanks for the link, yes, it will be handy.


            One thing I've discovered since I posted is that selecting that element's parent in the Structure panel and Deleting it with the trash can icon does get rid of the problematic one. Prior to using the trash can I was simply un-tagging the parent, which just moved the problem child (I love puns) up one parent. So that at least keeps me from having to re-tag the whole frame.

            • 3. Re: Errant XML Tag
              KenWK Level 1

              OK (he says with a blush) I've got it, noticed a commonality I hadn't before posting.


              The page to which cchimi kindly supplied a link describes the icon as an empty element and that it's attached to an empty frame. However, it isn't only an empty frame.


              What happened in our file is that the script tagged an anchor marker with an xml tag, which InD apparently doesn't like very much. Kind of makes sense, really.


              Now, I maybe cracking up, but with one instance of the "bad" element I THOUGHT I was able to see the empty element in the story view with the anchor just a few characters away. I selected the anchor and dragged it back in between the start and end code and the element's icon changed and it came "alive" again, I was able to manipulate it. For most of the other troublesome elements, though, AND sinpy tagging an anchor marker, the XML tag does NOT show in story view. The element gets the empty icon when you simply tag an anchor marker, in this case it is an anchor for a rule.


              Hope this might help somebody, some day.

              Thanks again for reading.