网页中"<![CDATA[" "]]>"标记

本文介绍了CDATA与PCDATA在XML文档中的应用区别。CDATA用于告知浏览器这部分内容无需解析,适用于如JavaScript等代码片段;而PCDATA则定义了元素内容或属性的取值范围,常见于XML约束文档中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

经常在网页html代码中看见这样的嵌入标签,但实际使用没有用过,特此在记录下:

CDATA是在XML文档里面使用的关键字,用来告诉浏览器,这部分内容不用解析,是给其他程序用的,比如JAVASCRIPT等等。

PCDATA是在 XML约束文档里使用的,如DTD类型的约束文档,在这里面表示元素的内容或属性的取值范围等等,是字符串形式的。

<script>
<![CDATA[
function matchwo(a,b){
if (a < b && a < 0){
return 1;
}else{
return 0;
}
}
]]>
</script>

常常嵌入在script标签中,用于js使用。在javaeye博客中已有详细介绍,具体就不在说明了。

参考:
http://mxdxm.iteye.com/blog/738334
<project> <description>test Upgrade模板</description> <keepDependencies>false</keepDependencies> <properties/> <scm class=“hudson.scm.NullSCM”/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <!-- 已移除定时触发器 --> <!-- 原始触发器配置已删除 --> <concurrentBuild>false</concurrentBuild> <customWorkspace>D:/Jenkins_new</customWorkspace> <builders> <!-- 阶段交换:原第二阶段提到前面 --> <hudson.tasks.BatchFile> <command><![CDATA[ curl -s http:// � � � � � � � � � : agentHost:{agentPort}/beforeUpgrade?jobName=%JOB_BASE_NAME% chcp 65001 @echo on cd %WORKSPACE%/%JOB_BASE_NAME%/ curl -s -X POST -H “Content-Type: application/json” -d " � � � � � � � � � " ℎ � � � : / / paramsStr"http://{agentHost}:${agentPort}/afterUpgrade ]]></command> </hudson.tasks.BatchFile> <!-- 原第一阶段变为第二阶段 --> <hudson.tasks.BatchFile> <command><![CDATA[ @echo off chcp 65001 > nul :LOOP REM 获取并过滤日志 curl -s http:// � � � � � � � � � : agentHost:{agentPort}/logs?serialNumber= � � � � � � � � � � � � ∣ � � � � � � � serialNumber∣findstr{serialNumber} > filtered_log.txt if %errorlevel% equ 0 ( type filtered_log.txt ) else ( echo No matching logs found ) REM 检查服务状态 curl -o status.txt -s -w “%%{http_code}” http:// � � � � � � � � � : agentHost:{agentPort}/status?serialNumber=${serialNumber} set /p status=<status.txt if “%status%” == “200” ( echo Service returned success status. Stopping… exit 0 ) else ( echo Service not ready. Retrying in 10 seconds… ping 127.0.0.1 -n 11 > nul goto LOOP ) ]]></command> </hudson.tasks.BatchFile> </builders> </project> 帮我解决第二阶段jenkins控制台输出中文乱码问题,log接口返回的是"UTF-8"格式,能通过XM配置保证控制台输出格式为UTF-8
最新发布
03-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值