Skip to content

update DTL (Domain-Specific Text Literals) documentation #2648

@xushiwei

Description

@xushiwei

This is the old version of the DTL (Domain-Specific Text Literals) documentation: doc/domian-text-lit.md.

The following important updates have been made:

  • All built-in DTLs, except for TPL, are located in the encoding directory, where the directory name is the DTL name. Currently supported DTLs include: csv, json, yaml, html, xml, regexp, regexposix, golang, xgo, and fs.

  • Previously, using the html DTL required the user to import "golang.org/x/net/html", but this is no longer necessary.

  • Relationship with DQL (DOM Query Language): Many DTLs result in a DOM, such as json, yaml, xml, golang, xgo, and fs. While these are not typically the NodeSets required by DQL, they can be understood as NodeSets containing only a single root node. Therefore, these DOMs also support NodeSet query operations, including ns.* and ns.**. Therefore, you'll see that we can directly query a DQL without first converting it to a DQL NodeSet. There's a special case here: fs DQL, which returns a NodeSet directly. For example, fs`.` means only containing NodeSets of the current directory.

  • Examples of usage can be added for various DQL types. Especially for html, golang, xgo, and fs, which are newer, focus on them.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions