Copy link to clipboard
Copied
Greetings:
I have been given an xml file that originated in a low cost xml editor. When I open the document in Frame 9, the document has extraneous spaces before and after various tags.
The most bothersome are those that appear after start tags. For example:
<para> Now is the time ....
Other editors I've worked with allow you to search for a "<para> " and replace it with "<para>", the text representation of the tag.
I see Frame supports regular expressions in Find/Replace but I can't find any documentation to describe how to use it.
Anyone have any idea how I can elminate rogue spaces before and after various start/end tags in Frame?
thanks in advance.
Baejc
Copy link to clipboard
Copied
Hi Baejc...
In FM, you can't search on tags .. you can search for a tag, but not the actual tag markup. I actually don't know of a way to fix the problem you're seeing once the file has been opened in FM (aside from developing a custom plugin or script that would clean it up). This problem is caused because the XML file you're opening has been pretty-printed (I'm guessing). FM treats all space within a tag as "content" .. this includes whitespace in parent tags as well .. this ends up typically being NOT what you want.
One solution is to open the XML file in a plain text editor or an tag-based XML editor and "un-pretty-print" the file by removing the leading tabs or spaces on all lines. If this isn't a viable solution, you will need to introduce an import XSLT script to your structured application. This will cleanse your file of the unwanted whitespace before it's opened in FM. For an excellent discussion of this subject, visit the following URL ..
http://www.scriptorium.com/whitepapers/whitespace/
Good luck!
...scott
Copy link to clipboard
Copied
Scott:
Thank you for your response. I "suspected" this could not be accomplished in Frame.
I will use your advice and cleanse it using a text editor that can read the xml file.
Many thanks
Joe
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more