Altova StyleVision 2025 Enterprise Edition

Creating Tables and Lists as Elements/Attributes

Accueil Préc Haut Suivant

Tables and lists in the HTML document can be converted to element or attribute nodes in the XML Schema so that they retain the table or list structure in the schema.

 

Converting a table to elements/attributes

To convert a table to schema nodes, do the following:

 

1.Select the HTML table by highlighting some text in it.

2.Drag it to the node in the schema tree as a sibling or child of which you want to create it.

3.Drop the node when the Create as Sibling symbol h2x_addsibling or Create as Child symbol h2x_addchild appears.

4.In the context menu that now pops up (screenshot below), select the command Convert selected table/list to elements or Convert selected table/list to attributes according to whether you wish to create the contents of table cells as elements or attributes, respectively.

 

H2XMnuConvertTable.ListBMP

 

5.In the Convert Table dialog that pops up (screenshot below), select whether the table created in the SPS should be a static table or dynamic table.

 

H2XDlgConvertTable

 

If the static table option is selected, then for each cell in the table, a schema node is created. In the design, each node is inserted with the (content) placeholder. The data in the table cells is copied to the temporary internal XML document (and to the generated XML document). The dynamic table option is available when the structure of all rows in the table are identical. When created in the SPS, the rows of the dynamic table are represented by a single row in the design (because each row has the same structure). The table data will be copied to the XML file. The dynamic table can grow top/down (rows are arranged vertically relative to each other) or left/right (rows become columns and extend from left to right). If you indicate that the first row/column is a header, then (i) a header row containing the column headers as static text is included in the design; and (ii) the schema element/attribute nodes take the header texts as their names. If the first row/column is not indicated as a header, then no header row is included in the design.

6.After you have selected the required option/s, click Convert to finish.

 

Converting a list to elements/attributes

To convert a list to schema nodes, do the following:

 

1.Select the HTML list by highlighting some text in it.

2.Drag it to the node in the schema tree as a sibling or child of which you want to create it.

3.Drop the node when the Create as Sibling symbol h2x_addsibling or Create as Child symbol h2x_addchild appears.

4.In the context menu that now pops up (screenshot below), select the command Convert selected table/list to elements or Convert selected table/list to attributes according to whether you wish to create the contents of table cells as elements or attributes, respectively.

 

H2XMnuConvertTable.ListBMP

 

5.In the Convert List dialog that pops up (screenshot below), select whether the list created in the SPS should be a static list or dynamic list.

 

H2XDlgConvertList

 

If the static list option is selected, then for each list item, a schema node is created. In the design, each node is inserted with the text of the HTML list item included as static content of the list item. If the dynamic list option is selected, then each list item is represented by a single list item node  in the design. In the design, the list item element is inserted with the (content) placeholder.

6.After you have selected the required option, click Convert to finish.

 

© 2018-2024 Altova GmbH