如何包含?和/在 XML 标记中 [英] How to include ? and / in XML tag
问题描述
我需要一个带有以下标签的 XML
<Customer_In_Rental?>否</Customer_In_Rental?>
?
不被接受,因此我尝试了
即使在此之后,XML 的格式也不是很好.
如何在我的 XML 标记中使用 ?
.同样,我还需要使用 /
<四/六>否四/六>
感谢任何快速帮助.
NameStartChar ::= ":" |[A-Z] |"_" |[a-z] |[#xC0-#xD6] |[#xD8-#xF6] |[#xF8-#x2FF] |[#x370-#x37D] |[#x37F-#x1FFF] |[#x200C-#x200D] |[#x2070-#x218F] |[#x2C00-#x2FEF] |[#x3001-#xD7FF] |[#xF900-#xFDCF] |[#xFDF0-#xFFFD] |[#x10000-#xEFFFF]NameChar ::= NameStartChar |"-" |."|[0-9] |#xB7 |[#x0300-#x036F] |[#x203F-#x2040]名称 ::= NameStartChar (NameChar)*
您必须找到表达意图的替代方式.
对于 ?
,请考虑使用 Boolean
或 Predicate
后缀,或者简单地省略并允许名称本身或模式传达布尔意图.
对于 /
,考虑 -
或 _
.
I need to have an XML with below tag
<Customer_In_Rental?>No</Customer_In_Rental?>
The ?
is not accepted, hence I tried it like
<Customer_In_Rental?>No</Customer_In_Rental?>
the XML is not well-formed even after this.
How to use ?
in my XML tag. Similarly, I need to use /
also
<Four/Six>No</Four/Six>
any quick help is appreciated.
Neither ?
nor /
are allowed in XML tags per the W3C XML BNF for component names:
NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] Name ::= NameStartChar (NameChar)*
You'll have to find alternatives means of expressing your intent.
For ?
, consider a Boolean
or Predicate
suffix, or simply omit and allow the name itself or a schema to communicate the boolean intent.
For /
, consider -
or _
.
这篇关于如何包含?和/在 XML 标记中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!