English 中文(简体)
您有多种标签,有CDATA部分。
原标题:Can you have multiple tags with xml tag having CDATA section?
  • 时间:2012-05-03 21:37:28
  •  标签:
  • xml
  • cdata

我有一只Xml文档,看着:

 <bookstore>  

 <book category="COOKING">  
   <title lang="en">Everyday Italian</title>  
   <author>Giada De Laurentiis</author>  
   <year>2005</year>  
   <price>30.00</price>  
   <![CDATA[<<port>url=  https://localhost:8080<port>]]>
 </book>

我认为,当处理该问题时,整个谈判方被视为《空运公约》。 你们能否在有CDATA的标签内使用其他标签? 我没有找到任何在线样本。

最佳回答

首先,你似乎不清楚“主角”是什么。 为此:

<a><![CDATA[xyz]]></a>

有两个标的:起始标的<a>和终点标的</a>。 《欧洲自由贸易协定》的章节不是“一面”,而是两面。

So when you say the entire tag is considered as CDATA I think you mean the entire content between the tags is considered as CDATA ; and yes, that is correct. And when you say Can you use other tags inside a tag having CDATA? I think you mean can you have tags inside a CDATA section? , and the answer is no: the only point of using a CDATA section is to prevent any angle brackets inside the section being recognized as markup.

问题回答

牧师忽视了CDATA部分的所有内容。

在您的案例中,<<port>url=https:// localhost:808080<port>。 不能认为XML含有标签,而只是简单案文。

If you d like to have a port element containing a CDATA section you should modify your line to

<port><!

If you look at the definition of a CDATA section all content between the opening <![CDATA[ and closing ]]> tag is considered text input and no processing is done on the information at all.

现在,一旦你在《非洲自由贸易协定》的章节中形成有效的《非洲反洗钱公约》,你就可以单独处理该文件。





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml