From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Append the Doc Type Declaration to XML Form in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

In creating XML documents, we want to give the document a Document type Declaration or DTD.  We can add the DTD to our XML forms with the LabVIEW XML API.

 

Description

This example shows how we can quickly add the DTD to an XML form by utilizing the property and invoke nodes of our document reference.  We use the documents XML Implementation reference and 'Create Document type' method to create the DTD.  Then we append the DTD to our XML document by using the documents reference's 'Append New Child' method.  This adds the DTD to the form.

 

Requirements

  • LabVIEW 2013 (or compatible).

 

Steps to Implement or Execute Code

  1. Open the DOM Doc Type Declaration.vi
  2. Run the code. The code will create an XML file called example.xml which includes the DTD. 

 

Additional Images or Video

AddDTD.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Cole R.
National Instruments
Software Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
0Forest0
Member
Member
on

How to append the ATTLIST to Doc Type Declaration in XML file by LabVIEW?

Like this:


<?xml version="1.0">

<!DOCTYPE DTD [

<!ATTLIST name attname value>

]>