---
schema_version: "1"
id: 2e7d81a5055d865b252f014a7c1e2d099645121b0e47308dcf6ac090521278ff
title: docTypeAsString
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-dtd-functions-doctypeasstring.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-dtd-functions-doctypeasstring
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 465c258e28a80d167898919dd06d21ce7a3b902a505e7fe654b84a726a042537
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# docTypeAsString

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## docTypeAsString(docType: DocType): String

Transforms a `DocType` value to a string representation.

_Introduced in DataWeave version 2.5.0._

### Parameters

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><p><code>docType</code></p></td><td><p>DocType</p></td><td><p>The <code>DocType</code> value to transform to a string.</p></td></tr></tbody></table>

### Example

This example transforms a `DocType` value that includes a `systemId` to a string representation.

#### Source

```DataWeave
%dw 2.0
import * from dw::xml::Dtd
output application/json
---
docTypeAsString({rootName: "cXML", systemId: "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd"})
```

#### Output

```Json
"cXML SYSTEM http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd"
```

### Example

This example transforms a `DocType` value that includes a `publicId` and `systemId` to a string
representation.

#### Source

```DataWeave
%dw 2.0
import * from dw::xml::Dtd
output application/json
---
docTypeAsString({rootName: "html", publicId: "-//W3C//DTD XHTML 1.0 Transitional//EN", systemId: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"})
```

#### Output

```Json
"html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
```
