我有一個相當複雜的XML樹結構,其中包含很多元素。對於每個元素,提交者可以選擇該值是否保密。目前,我認爲解決的辦法是像下面的例子:具有屬性和內容的元素的XSD模式和JAXB類
<Person>
<Lastname confidential="true">Doe<Lastname>
<Fistname confidential="false">John<Fistname>
<Addresses>
<Address>
<Street confidential="false">aaaaaaa</Street>
<ZipCode confidential="true">75000</ZipCode>
<City confidential="false">Paris</City>
<Country confidential="true">FR</Country>
</Address>
...
<Adresses>
<Email confidential="true">[email protected]<Email>
<Phone confidential="true">+33110111213<Phone>
...
</Person>
我不是專家,但我想,以避免生成特定類型(XSD架構)和特定的類(使用JAXB)爲每個元素。可能嗎 ?否則,你有什麼想法來解決我的問題嗎?
非常感謝您的幫助
你應該爲編輯這些附加信息添加到你的問題,而不是作爲一個答案。 – RCB