久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

JAXB XJC 代碼生成 - “schemaLocation"Marshaller 生成

JAXB XJC code generation - quot;schemaLocationquot; missing in xml generated by Marshaller(JAXB XJC 代碼生成 - “schemaLocationMarshaller 生成的 xml 中缺少)
本文介紹了JAXB XJC 代碼生成 - “schemaLocation"Marshaller 生成的 xml 中缺少的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我使用 XJC 工具為我的 XSD 模式生成 Java 類.當我使用 JAXB Marshaller 將類編組為 XML 有效負載時,我在輸出 XML 中缺少schemaLocation"參數,但我在 xsd 文件中聲明了此參數.如何在輸出 XML 中強制執行schemaLocation"參數?

I Use XJC tool to generate Java classes for my XSD schema. When I use JAXB Marshaller to marshall classes into XML payloads, I'm missing "schemaLocation" parameter in the output XML, but I declare this parameter in xsd file. How to enforce "schemaLocation" parameter in the output XML?

下面是我用于代碼生成的 xsd 架構文件的開頭:

Below is the begining of my xsd schema file used for code generation:

<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="xsdns" xmlns:messages="http://www.exampleURI.com/Schema1" xmlns:datatypes="http://www.exampleURI.com/Schema1" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:schemaLocation="http://www.exampleURI.com/Schema1 ./messages.xsd" targetNamespace="http://www.exampleURI.com/Schema1" elementFormDefault="unqualified" version="true">
<xs:include schemaLocation="datatypes.xsd"/>
<xs:complexType name="execute-system-command-struct">
    <xs:annotation>
        <xs:documentation>The request for system command execution.</xs:documentation>
    </xs:annotation>
    <xs:sequence/>
    <xs:attribute name="action" type="datatypes:system-action-kind-enum" use="required">
        <xs:annotation>
            <xs:documentation>The action that the Voice System has to proceed.</xs:documentation>
        </xs:annotation>
    </xs:attribute>

問候

推薦答案

試試這個:

marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://my.namespace my.schema.xsd");

這篇關于JAXB XJC 代碼生成 - “schemaLocation"Marshaller 生成的 xml 中缺少的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 成人精品视频99在线观看免费 | 国产伦精品一区二区三区视频金莲 | 久久久国产一区 | 青青久在线视频 | 久久久无码精品亚洲日韩按摩 | 四虎影院免费在线 | 国产美女在线看 | 日韩1区 | 欧美黄色网| 亚州综合在线 | 亚洲成人精| 亚洲第一成年免费网站 | 日产久久 | 欧美日韩专区 | 黄色精品视频网站 | 午夜精品在线 | 很很干很很日 | 97国产精品视频人人做人人爱 | 久久久久久久久久久久91 | 日韩一级在线 | 亚洲二区在线 | 成人在线播放网址 | 青青草一区 | 欧美性极品xxxx做受 | 久久黄色精品视频 | 在线高清免费观看视频 | 国产免费观看一级国产 | 九九热视频这里只有精品 | 精品久久久久久亚洲综合网 | 精品一区二区三区免费毛片 | 最新伦理片 | 国产精品不卡一区 | 黑人精品欧美一区二区蜜桃 | 男女午夜激情视频 | 精品国产不卡一区二区三区 | 国产成人精品一区二区三区网站观看 | 精品久久久久久久 | 久久精品二区亚洲w码 | 草草影院ccyy | 亚洲高清免费 | 亚洲网站在线观看 |