神刀安全网

Embedding Images in XML

One of the really cool features added to XMLSpy a few years ago based on customer requests is the ability to embed external files – such as images – directly in an XML document as encoded text. This gives you the option to package all required data from various external files together in one large XML document.

Let’s take a look at how easy it is to accomplish this in the XML editor in just a few steps.

Embedding Images in XML

Embed Images in XML

First, click the Insert / Encoded External File command, which is is available in Text View and Grid View.

Embedding Images in XML

Browse to select the file to embed, and then choose either Base 16 or Base 64 encoding. If you wish to enclose the encoded text in an element, check the Create Element check box and specify the name to use.

In this example, we’re creating a new element called <photo>. If the Create Element check box is not checked, the encoded text will be inserted directly at the cursor location.

Embedding Images in XML

When we click OK, the encoded text of the image file we specified is inserted in the <photo> element and is now a part of our XML document.

Embedding Images in XML

And that’s all there is to it!  This feature is available in XMLSpy versions 2011 and higher. If you’re not already a customer, you can download a free, 30-day trial to check it out.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Embedding Images in XML

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮