Altova XMLSpy 2024 Professional Edition

Inserting XML Fragments

Home Prev Top Next

You can insert XML fragments from other applications and web pages. These fragments can be inserted in one of two ways:

 

By using drag-and-drop to Text View or Grid View. If you drag-and-drop to Grid View, the intelligent information available in drag overlays can help you decide where to drop the fragment.

By using copy-and-paste to Text View or Grid View.

 

Example

The following example shows how a fragment can be added quickly and to the correct location in an XML document.

 

1.The fragment that is highlighted below (from an XML tutorial at w3schools.com) is selected. It is an element named food that contains a number of child elements.

Click to expand/collapse

2.The screenshot below shows the Grid View of an XML document, where two food elements are displayed as the rows of a table. When the fragment from the web page is dragged to the food table, a drag overlay appears containing the information that the dragged XML fragment will be dropped as a food element into the food table as its last row.

XMLFragmentDraggedToGrid

3.When the fragment is dropped, it is placed exactly where it is wanted—as the last food element child of breakfast_menu (see screenshot below).

XMLFragmentDropped

 

© 2018-2024 Altova GmbH