易截截图软件、单文件、免安装、纯绿色、仅160KB

xml 标签类型怎么表示


XML code:
<operation_out type="struct">
<service_name type="string">cc_verify</service_name>
</operation_out>


用的是jdom,正常结构都会拼,关键是 type ,用什么方法呢?element.?

不明白?你需要一个属性来表示“类型”

      Element root = new Element("operation_in").setAttribute("type", "struct");

这么写对不?

引用
Element root = new Element("operation_in").setAttribute("type", "struct");

这么写对不?

设置属性?


结贴结早了~~~还有个问题

Java code:
content.addContent(new CDATA("<?xml version='1.0' encoding='GBK'?><request type='struct'>"+
"<home_city type='int'>"+homeCity+"</home_city><msisdn type='string'>"+phoneNO+"</msisdn></request>"));


问题是 new CDATA后面能不能写成Java code:
request.addContent(home_city);
request.addContent(msisd


相关问答:

求Java如何实现xml文件

已知文件1.xml和数据文件db.xml,如何用java编写程序,得出2.xml文件?
1.已知xml文件 1.xml结构如下:
<cs>
  <cs name="cs1" details="This is cs1" country="China&q ......

wince程序怎么把XML文件传入webservice

我在编写一个wince5.0的程序,想实现把PDA上的一个LIST <STRING>类型的数据序列化为XML,然后在PC上的一个webservice拿到这个XML,转化为Dataset,更新PC上的数据库,我想问怎么把XML传给webservice的呢?
......

请问如何取XML的属性值 - .NET技术 / C#

我有一个XML.想取
<Portfolio _Name="XXXX" _Id="AUD" >
中的属性_Id的值.但是用下面的语句好象不行.
 XmlNode CId = xdoc_Msg.SelectSingleNode("/Portfolio");
&n ......

读取iframe中XML数据问题,跪求高手进

<html>
<head><title></title></head>
<body>
<iframe id="myifr">
<xml version="1.0" encoding="UTF-8" standalone="yes&q ......

一个超复杂的xml文档解析

XML code:
<?php
$XMLstr="<DMResponse><Code>1</Code><Description>Your request was successfully received and processed.</Description><ResultData><Explan ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号