MessageQueueCommand.xml
------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<MessageQueueCommand xmlns="M.Box.MessageQueueCommands" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="M.Box.MessageQueueCommands E:\xsdtest\MessageCommands.xsd">
<InjectionRequestCommand>
<AdditionalInfo Key="myKey1">myValue1</AdditionalInfo>
<AdditionalInfo Key="myKey2">myValue2</AdditionalInfo>
<MessageId>9E479DFE-3360-4A08-9157-71F78D715365</MessageId>
<Msisdn>63125874557458</Msisdn>
<SourceTransactionId>A12324BD1-C</SourceTransactionId>
<TelcoId>1</TelcoId>
<TransmitterName>01RouterProc01</TransmitterName>
<ResponseQueue>MIAB.01RouterProc01.Telco1.Injection.Response</ResponseQueue>
<Amount>1000</Amount>
<CodeType>10 Telco1 Topup</CodeType>
<InjectionType>Topup</InjectionType>
<RetailerGroupId>A100</RetailerGroupId>
<RetailerId>A1001</RetailerId>
<StoreId>A1001_1</StoreId>
<TransactionId>924348347261</TransactionId>
</InjectionRequestCommand>
</MessageQueueCommand>
------------------------------------------------------------------------------------------------------上面的MessageQueueCommand.xml是需用jdom生成的xml文件。现在这个XML文件除了一个地方(红色字体)我不会添加,其他的都解决了。问题也正是此,像红色字体的名称空间使用jdom该如何添加呢?备注:
它是一个本地的xsd文件,用来验证生成的xml文件的有效性。
------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<MessageQueueCommand xmlns="M.Box.MessageQueueCommands" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="M.Box.MessageQueueCommands E:\xsdtest\MessageCommands.xsd">
<InjectionRequestCommand>
<AdditionalInfo Key="myKey1">myValue1</AdditionalInfo>
<AdditionalInfo Key="myKey2">myValue2</AdditionalInfo>
<MessageId>9E479DFE-3360-4A08-9157-71F78D715365</MessageId>
<Msisdn>63125874557458</Msisdn>
<SourceTransactionId>A12324BD1-C</SourceTransactionId>
<TelcoId>1</TelcoId>
<TransmitterName>01RouterProc01</TransmitterName>
<ResponseQueue>MIAB.01RouterProc01.Telco1.Injection.Response</ResponseQueue>
<Amount>1000</Amount>
<CodeType>10 Telco1 Topup</CodeType>
<InjectionType>Topup</InjectionType>
<RetailerGroupId>A100</RetailerGroupId>
<RetailerId>A1001</RetailerId>
<StoreId>A1001_1</StoreId>
<TransactionId>924348347261</TransactionId>
</InjectionRequestCommand>
</MessageQueueCommand>
------------------------------------------------------------------------------------------------------上面的MessageQueueCommand.xml是需用jdom生成的xml文件。现在这个XML文件除了一个地方(红色字体)我不会添加,其他的都解决了。问题也正是此,像红色字体的名称空间使用jdom该如何添加呢?备注:
它是一个本地的xsd文件,用来验证生成的xml文件的有效性。
楼主【IceWee】截止到2008-08-01 12:33:05的历史汇总数据(不包括此帖):
发帖的总数量:8 发帖的总分数:150 每贴平均分数:18
回帖的总数量:11 得分贴总数量:2 回帖的得分率:18%
结贴的总数量:7 结贴的总分数:100
无满意结贴数:2 无满意结贴分:40
未结的帖子数:1 未结的总分数:50
结贴的百分比:87.50 % 结分的百分比:66.67 %
无满意结贴率:28.57 % 无满意结分率:40.00 %
楼主加油
取消马甲机器人,请点这里:http://www.java2000.net/mycsdn/robotStop.jsp?usern=IceWee
xmlns:xsi
不也带冒号吗?
你不也弄进去了?
xmlns:schemaLocation="M.Box.MessageQueueCommands E:\xsdtest\MessageCommands.xsd"> 调用的是element.addNamespaceDeclaration("schemaLocation", "M.Box.MessageQueueCommands E:\\xsdtest\\MessageCommands.xsd")看到了,第一个参数里没加“xsi:”,因为加了会抛异常。不加,JODM就默认给加个xmlns又不能自定义,真是郁闷!要是dom4j随便怎么弄都没事!差距啊~! 没人遇到这个问题么?