![](/img/trans.png)
[英]How to Convert Complex Type in to java.lang.string during class generation from schema(.xsd) using JAXB
[英]how to convert java class String to xsd:string type?
以下代碼返回java.lang.string
,我希望它是xsd:string
,如何完成?
Element e = getDocumentBuilder().newDocument().createElement("value");
e.setAttribute("type", v.getClass().toString());
通常,我如何將任何類轉換為xsd:type?
我對您的問題感到困惑,因為xsd:string直接(從XSD / xml文件)映射到java.lang.String。 看到:
http://docs.oracle.com/javaee/5/tutorial/doc/bnazq.html
因此,如果您使用Java,則可以在需要“ xsd:string”的任何地方使用java.lang.String。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.