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

Can you reorder cells using Read/Write rules?

Guest
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

I’m trying to reorder some table cells during conversion from SMGL to FM10, but I think the Read/Write rules don’t really do what I want them to do.

Here’s what I’ve got in SGML:

<data>

               <cus>B</cus>

               <mod>A</mod>

               <cec>D</cec>

               <acn>C</acn>

</data>

What I want is:

A

B

C

D

My read/write rules are:

}

element "data" {

  is fm table row element;

}

element "cus" {

  is fm table cell element;

  fm property column number value is "2";

  fm property row type value is "Data";

}

element "mod" {

  is fm table cell element;

  fm property column number value is "1";

  fm property row type value is "Data";

}

element "cec" {

  is fm table cell element;

  fm property column number value is "4";

  fm property row type value is "Data";

}

element "acn" {

  is fm table cell element;

  fm property column number value is "3";

  fm property row type value is "Data";

}

What I end up with is each element in its proper cell, but not in the same row:

B

A

D

C


My guess it that FM reads down the SGML and applies the rules to each line as it comes to it, therefore it reads the first line and puts “B” in column 2, then it reads the second line and puts “A” in the next available column 1, which is actually in the next row. Is there a way to keep them in the same row without changing the SGML?

Thanks!

ebpdx

TOPICS
Structured

Views

868
Translate

Report

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
Guest
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

It looks like rule order matters here. Have you tried putting the 'mod' rule first, then the 'cus' rule, and so on?

Votes

Translate

Report

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
Guest
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

Yes, it didn't help.

Votes

Translate

Report

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
Engaged ,
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

you can't do this with RW-Rules. But you can define an XSLT in your structured application, which does the restructuring process of you input xml.

hope this helps

Votes

Translate

Report

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
Guest
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

Unfortunately, I've got SGML files, not XML files and the conversion from SGML to XML is really messy. Oh well, thanks for your help!

ebpdx

Votes

Translate

Report

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
Engaged ,
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

But you can do it in a second step.

Import SGML Files and you've got a structured FM Document.

Now you can do an XML roundtrip in an easy way and restructure that table in that step.

You can also use FrameSLT (http://www.weststreetconsulting.com/WSC_FrameSLT.htm) if you want to do it in FM document directly.
Hope this helps
Markus

Votes

Translate

Report

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
Engaged ,
Nov 02, 2012 Nov 02, 2012

Copy link to clipboard

Copied

LATEST

ahhh..

Don't know if this could work for this. Perhaps FM's conversion table could solve that problem.

could be a little bit tricky, but could work

Votes

Translate

Report

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