Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Hide prefix when importing empty XML tag

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #98483

      Hello
      I REALLY hope someone will be able to help me here. I’m trying to import a XML file (which works fine), but if there’s an empty XML tag, I want to hide the prefix text field or label if thats what its called. The XML looks like this:

      <name>Bill Ipsum</name>
      <phone></phone>
      <email>bill@mail.com</email>

      Everything works fine. In my Indesign template it ends up looking something like this:

      Name: Bill Ipsum
      Phone:
      Email: bill@mail.com

      But if a person haven’t entered his/her phonenumber, I want to remove the entire line – including my prefix text. But how???

      I hope this makes sense

      Best regards
      MadsRH

    • #98486
      David Blatner
      Keymaster

      While you could probably do that with an XSLT or a script run at import, in general I believe you just need to clean it up later.

      However, I just found this script on the Adobe forum that might help? https://forums.adobe.com/thread/980946

    • #98488

      Thanks for the reply David :D

      Isn’t the script for empty tag? My XML tags are fine, I need to remove a text field next to it.

      I’ll look into XSLT and scripting, but it seems a bit too complicated for me.

    • #98489
      David Blatner
      Keymaster

      LOL, in my opinion everything about XML is too complicated. My opinion is that people should try all possible alternatives and then only use XML if it is the only option. :-)

      Have you tried Data Merge? Or a third-party tool such as InData? Often those are far easier.

    • #98490

      David: No, I don’t know InData. I’ve done a bit with Data Merge before, but it really feels like starting from scratch when it’s only this little detail I need fixed (sigh).

      Perhaps I’ve chased away all the other experts, by asking the wrong question. Maybe if I don’t mention XML? Something like: Is there a spredsheet-like script, that can remove a table row if a certain field is empty? No, It still sounds way too complicated :/

      My hair is getting gray as I’m trying to solve this, so I think I’ll have to go with what you suggested in your first post: …you just need to clean it up later.

    • #98507
      David Popham
      Participant

      Did you try checking “Delete elements, frames, and content that do not match imported XML” in the XML Import Options dialog?

Viewing 5 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads