【发布时间】:2012-10-12 10:59:55
【问题描述】:
我在使用
创建 xml 时遇到问题 <c:condition>
<a:condition>
<fieldName>fieldName</fieldName>
<fieldTest>fieldTest</fieldTest>
<fieldValues>
<fieldValue>fieldValue</fieldValue>
</fieldValues>
</a:condition>
<operator>operator</operator>
<a:condition>
<fieldName>fieldName</fieldName>
<fieldTest>fieldTest</fieldTest>
<fieldValues>
<fieldValue>fieldValue</fieldValue>
</fieldValues>
</a:condition>
</c:condition>
上面是给我的xml标签。
我需要使用 java 中的 JDOM/XML 创建这个标签。
所以我正在使用
Element complexCondition = new Element("c:condition");
创建“c:condition”标签的代码。
但是我遇到了错误
org.jdom.IllegalNameException: The name "c:condition" is not legal for JDOM/XML elements: Element names cannot contain colons.
所以不知道出了什么问题。 因为我是 xml 和 JDOM 的新手。 请帮我解决这个问题。
【问题讨论】:
-
请参阅:jdom.org/docs/faq.html#a0250 关于结肠。
标签: java xml web-services jdom