xml 单行注释_如何在XML标签块或单行中注释?

xml 单行注释

xml 单行注释

XML comments are very useful in order to explain the XML tags. Also if we want to test some XML code with and without we can use comments to enable or disable a single line or XML tag block. XML has similar syntax and terms to the HTML and also comment term is the same.

XML注释对于解释XML标签非常有用。 同样,如果我们要测试是否有XML代码,可以使用注释来启用或禁用单行或XML标记块。 XML具有与HTML相似的语法和术语,注释项也相同。

注释XML块 (Comment XML Block)

As XML is a hierarchical language there may be a lot of tags which are parents and children of others. This named XML tag block. We can command XML tag block which consists of multiple XML tags with the <!-- CODEBLOCK -->

由于XML是一种分层语言,因此可能有很多标记是其他标记的父子。 这个命名的XML标签块。 我们可以使用<!-- CODEBLOCK -->命令包含多个XML标签的XML标签块<!-- CODEBLOCK -->

We can see in the following example we will comment on the second student which is in red. This means the second student named Ahmet will not processes by XML processors.

我们可以在下面的示例中看到红色的第二个学生的评论。 这意味着第二名名为Ahmet学生将不会通过XML处理器进行处理。

<?xml version="1.0" encoding="ISO-8859-15"?>

<class>
    <student>
        <name>İsmail</name>
        <grade>A+</grade>
    </student>
<!--
    <student>
        <name>Ahmet</name>
        <grade>A-</grade>
    </student> 
-->
</class>

评论单行 (Comment Single Line)

We can comment on a single line with the <!-- SINGLELINE -->. This will only affect the single line and do not comment on upper or lower lines.

我们可以使用<!-- SINGLELINE -->在单行中进行注释。 这只会影响单行,而不会在高行或低行上发表评论。

<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- Student list can be stored here -->
<class>
    <student>
        <name>İsmail</name>
        <grade>A+</grade>
    </student>
    <student>
        <name>Ahmet</name>
        <grade>A-</grade>
    </student>
</class>
LEARN MORE  Javascript Syntax and Basics
了解更多Javascript语法和基础

翻译自: https://www.poftut.com/how-to-comment-in-xml-tag-block-or-single-line/

xml 单行注释

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值