General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › present an xml fragment in a table format
-
jrhuckaby June 25, 2009 at 8:02 pm
present an xml fragment in a table format
June 25, 2009 at 8:02 pmParticipants 4Replies 5Last Activity 13 years, 7 months agois 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!!
Derek Read June 25, 2009 at 8:21 pm
Reply to: present an xml fragment in a table format
June 25, 2009 at 8:21 pmI 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?
jrhuckaby June 25, 2009 at 8:34 pm
Reply to: present an xml fragment in a table format
June 25, 2009 at 8:34 pmsay 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 | yI 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
Derek Read June 25, 2009 at 8:55 pm
Reply to: present an xml fragment in a table format
June 25, 2009 at 8:55 pmI'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.
jrhuckaby June 25, 2009 at 9:09 pm
Reply to: present an xml fragment in a table format
June 25, 2009 at 9:09 pmour 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.
Derek Read June 30, 2009 at 7:16 pm
Reply to: present an xml fragment in a table format
June 30, 2009 at 7:16 pmJust 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 | yTo 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”.
-
AuthorPosts
- You must be logged in to reply to this topic.