is now part of CreativePro.com!

Removing the XML Structure from a Document

13

I.S. wrote:

I have a file that contains tagged XML content. I was asked to remove the XML from the document. Is there a way to delete/de-link the XML from a document?

If you open the Structure pane (press command/ctrl-option/alt-1) and select the XML elements, you can delete them. When you do this, InDesign gives you an option:

The default choice, Delete, actually removes the content from your document — the paragraphs or images go away! If you just want to remove the tags without messing up your document, choose Untag.

If this alert doesn’t appear (perhaps someone clicked Don’t Show Again), then you have another choice: Select the elements (you can select them all by opening the Root element, then clicking on the first element and shift-clicking on the last element) and choose Untag Element from the Structure panel menu (it’s a little menu in the upper-right corner of the Structure pane):

That should remove the tags, but leave all the good stuff in the document.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Harbs says:

    If you want to untag specific items in you document, you can also untag them from the Tags panel. You don’t even need to open the XML structure pane.

    Just select the tagged content in your document (such as text) and click the Untag button in your Tags panel.

  • GShannon says:

    Is this a glimpse of something that can be used to easily extract text from an XML file? I currently have a multi-step process using a text editor, Excel, and browser to get all the text between tags and strip out HTML markup, usually to send to translators.

    First stab, I imported the XML file and populated the structure panel, but those tags do not know about their corresponding selves in the XML file I placed as text.

  • Dorothy Hoskins says:

    FYI, what crashed my IDD CS5 tag when I was playing with untagging, was untagging a table. That may be particularly fraught with “crashiness” because tagged tables are a weird kind of hybrid XML and InDesign structure/object. I’ll have to investigate some more.

    IMHO, hauling XML content into InDesign to extract the text from the file is odd, this generally is best done with an XSLT. You can set up what you want to create — tabbed text, or paragraphs, etc. I suggest you search online for an XSLT to convert XML to text, there are a number to look at.

  • Praveen says:

    Hi,

    We can also remove the tags by selecting any tagged frames and then right click to select the option ‘Untag Frame’, this will remove the tags completely without any text changes.

    Thanks,
    Praveen

  • stan says:

    What if there is no link to the xml file in the first place, can you unlink and then it print as intended? Without anything dropping off?

    Thanks

  • @stan: Sure. As I said in the last line: it just deletes the tags but leaves the document alone.

  • melivea01 says:

    Good Morning!

    I need to make a phone directory of about 200 pages with tittles in chinese and english information. I have tried to organize the structure of the file with an .xml file and import the tags. I was wondering if its easier to just do it with merge data in automating layouts. Please help me. Have a great day thank you!

  • melivea01 says:

    Thank you very much! I really appreciate it

  • melivea01 says:

    I have revise this all day long the reply was really useful. But I have a problem. I only have an .xml file to start with, or a pdf that was converted to an .xml, to be more clear. And when I open the xml as an spreadsheet in excel to create the .scv file… (to load the data merge)… its impossible cause it opens in the wrong order, and it would take too long to manually organize 200 pages. :(. Any ideas?, does anybody have a clue of how to do this?. I would gladly appreciate it!. Thank you!

  • Janus says:

    What if you actually do want to delete all the content from the text frames as well, but (somewhere, somehow) someone seems to have clicked “Don’t show this again” clicking the ‘Untag’ option?

    ‘Untag’ and ‘Delete’ now do the exact same thing, and I cannot seem to find any way to actually delete (rather than just untag) the content, other than ‘deleting’ (i.e., untagging) it, selecting it in the document or story editor, and then manually deleting the non-tagged text. Which is a major PITA.

    Is there a way to restore the ‘delete’ function to actually, you know, **deleting**, preferably without trashing all my many InDesign preferences?

  • Gusgs, says:

    I have faced this issue today and what I have done to remove the unremovable missing link is a step further to what David posted:

    I deleted all tags from the Tags Palette. Then I unassigned tags to all elements in the structure of the document. leaving only the root element. As the missing link was still showing, I pressed delete to the root element in the structure and, voilá –as it seems that the root cannot be deleted–, InDesign rebuilt it anew and the missing link disappeared.

    Thanks for the hint!

  • Colleen Gratzer says:

    Thanks for this, David! I see this from time to time in files I get from designers who incorrectly approach accessibility by using the Structure and Tags panes.

  • >