Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Hard Carriage Returns on Paragraph and XML

New Here ,
Jan 19, 2009 Jan 19, 2009
Hi,

I'm still running FM 7.2, I have 8.0, but we are not ready as a company to move yet.

I am capturing legacy FM information and need to save as XML.
This information will at times have paragraphs that used hard carriage returns to build in separation and make things easier to read.

When we export this XML, these hard CRs are removed and all extra white space is compressed out of the element.

This is causing much grief for the people reading the documents and they have asked if I can retain the hard breaks.

I've looked into the Structured Application and found nothing. I've looked at the ReadWrite Rules files in hopes I could map the hard break to a element of some kind, or something like that. I'm not finding any solutions.

Is there a way to keep this information in the resulting XML file?

Thanks,

- mike
TOPICS
Structured
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 20, 2009 Jan 20, 2009
Mike,

there is a read/write rule instruction "preserve line breaks" to keep line breaks (Shift+Return) as line breaks in the XML. It is a little bit hard to parse this if you want to further process the documents and not very XML-stylish, because in most other places whitespace is not important.

I recommend including an empty element
with a formatting rule that creates a prefix or suffix of "\n".

- Michael Müller-Hillebrand
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 20, 2009 Jan 20, 2009
Thanks Michael.. I'll give that a try..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2009 Feb 02, 2009
LATEST
Hello Mr. Hare,

you might try the following:

1. Adjust the template of your structapp to contain a variable named "hardreturn" whose definition is "\n" (without the quotiation marks).

2. In your R/W-Rules, write: entity "hardreturn"is fm char 0x09;

3. In every FM-Document you want to save as XML
a. also add the variable
b. assign the structapp

4. ..and do the following
a. insert the variable "hardreturn" somewhere and copy it into the clipboard, and delete the variable from your insertion point
b. Search for "\p\p" (=two consecutive hard returns, i.e. an "empty line" or for "\x09" (= a soft return) and "change" "by pasting".
The result should be a variable "hardreturn, wherever \p\p or \x09 was.

If you save this as XML, the \x09 from the variable should survive as an entity.

Hope this helps.
With kind regards,
Franz.
[ excess signature removed by host ]
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines