General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion present an xml fragment in a table format

  • jrhuckaby

    present an xml fragment in a table format

    Participants 4
    Replies 5
    Last Activity 13 years, 3 months ago

    is there a way to present an xml fragment in a table format while being able to continue editing in a structured view? 

    We've tried using forms but we lose the native xmetal functions like search/replace, spell check, etc.

    HELP!!

    Reply

    Derek Read

    Reply to: present an xml fragment in a table format

    I think some more detail would help.

    Which type of table are you working with?
    HTML
    CALS
    “semantic” (ie: CSS is being used to render a set of elements that are neither HTML or CALS as a table).

    When you say “structured view”, do you mean the actual “Structure View”, or do you mean something else?

    Reply

    jrhuckaby

    Reply to: present an xml fragment in a table format

    say my XML looks like this (just an example):

    abcd
    and I need it to display it in a table like format where the data (some elements and some attributes) is displayed not in the sequence of the xml. i.e.
    x  |    abcd | 1234  | y

    I need to be able to still edit it in the normal view with the tree structure and being able to do search and replace, spell check etc.

    I hope this explains it. thanks for your help

    Reply

    Derek Read

    Reply to: present an xml fragment in a table format

    I'm not sure rendering this as a table will give you what you really want. XMetaL Author really works best when rendering HTML and CALS tables. In your case, if you are not working with real HTML or CALS tables then I would generally recommend rendering this content as a table (unless you are willing to do a bunch of scripting to make it easy for users to manipulate their content).

    Going by your example, the following CSS should render something very similar:

    [code]ELEMENT { display:block }
    ELEMENT:before { content:attr(ATTR1) }
    ELEMENT:after { content:attr(ATTR2) }
    SUB1, SUB2 { display: inline }
    [/code]

    Note: there was an inconsistency between your opening “ELEMENT1” and closing “/ELEMENT” tags. The “ELEMENT” in this example is the top level element in this fragment.

    Reply

    jrhuckaby

    Reply to: present an xml fragment in a table format

    our data isn't real HTML or CALS tables so you're suggesting using style sheets to render the data in a tabular view for authoring?  our users require this table view for authoring but the underlying data structure isn't a table and we really don't want to go the route of inserting a bunch of table tags to convert the data to a table…and burden the users with seeing a lot of tags that are meaningless to them.

    this data is airline IPC data (Illustrated Parts Catalogue).

    thx a lot for the advice. I'll ask our developers if they've looked at the option of using style sheets to render the data.

    Reply

    Derek Read

    Reply to: present an xml fragment in a table format

    Just to be clear (sounds like there is still confusion), XMetaL automatically recognizes HTML and CALS tables and will render them as tables. Anything else will not render as a table unless you specifically set the CSS up to do so.

    The example CSS I gave should approximate the example styling you asked for, and would not be a table:
    x  |    abcd | 1234  | y

    To style something as a table requires three elements: one representing the table, one the row (child of table) and at least one for cells (child of row). You can then use the CSS display properties: “table”, “table-row” and “table-cell” to designate the elements to render as a table. Your elements do not seem to fit this model however, unless “SUB2” is a child of “SUB1”.

    Reply

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

Lost Your Password?

Products
Downloads
Support