xml spy
Previous  Top  Next
Import HTML to XML

1.From the HTML document, mark the HOME entry, drag it into the tree view window, and drop it under the Root element. As soon as you reach a point where you can drop the element, a right-and-down arrow or a down arrow is shown. The entry can be dropped only when an arrow is shown.  
 
firstelemtent  
 
The right-and-down arrow ic_down_right appends a child.  
The down arrow ic_down_straight appends an element or attribute.  
 
When you release the mouse button, a pop-up window opens. Depending on what you want to do, you have a selection of options. Since the HOME object is part of a table, let us convert the whole table at once. Click on Convert selected table/list to elements.  
 
addnodes  
 
2.At this point a new window opens:  
 
selecttable  
 
Select 'as dynamic table' to import all fields of the table into the tree view. All elements of the table are being imported into the tree view. If you select an object that is not part of a table, this function is disabled.  
3.Right click on Table Node and select Rename to change its name to 'Link_to', NewNode under HyperLinkNode to 'Home', NewNode under HyperLinkNode1 to 'Products', NewNode under HyperLinkNode2 to 'Downloads', NewNode under HyperLinkNode3 to 'Order', NewNode under HyperLinkNode4 to 'Support', NewNode under HyperLinkNode5 to 'FAQ', NewNode under HyperLinkNode6 to 'Resources', NewNode under HyperLinkNode7 to 'References',NewNode under HyperLinkNode8 to 'Partners', NewNode under HyperLinkNode9 to 'Company', and NewNode under HyperLinkNode10 to 'Japan'.  
 
renamenode     
 
4.After renaming the elements, the tree view should look like this:  
 
treenodes  
 
The renamed items in the HTML document should now look like this:  
 
renamemain  
 
The HTML document now shows the tags of the nodes that have been imported into the tree view.  
5.Save the project. Select File | Save as. A window opens:  
 
not_imported_controls  
 
Since it's possible to import these user controls at a later time, select do not import and click OK.  
 
savealsoas  
 
Click Yes to save all files.  
6.Select a name for the W3C Schema. In this case, type 'altova'.  
 
savew3c  
 
The file is saved as altova.xsd.  
7.Select a name for the Xslt file. In this case, type 'altova'  
 
savexslt  
 
The file is saved as altova.xslt.  
8.Select a name for the XML file. In this case, type 'altova'  
 
savexml  
 
The file is saved as Altova.xml.  
9.Select a name for the sps file. In this case, type 'altova'.  
 
savesps  
 
The file is saved as Altova.sps. All files have now been saved, and are ready for editing.  

You have now successfully imported parts of the Altova homepage HTML file into XML for further editing in Stylesheet Designer!  

Previous  Top  Next

© 2003 Altova