when serializing my resources on Jersey, I want to use namespaces in some cases.
Is there any way to customize the namespace prefixes on jersey?
Default:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order xmlns:ns2="http://www.w3.org/2005/Atom">
<price>123</price>
<ns2:link rel="duh" href="/abc/123"/>
<ns2:link rel="abc" href="/def/234"/>
</order>
I want something like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order xmlns:atom="http://www.w3.org/2005/Atom">
<price>123</price>
<atom:link rel="duh" href="/abc/123"/>
<atom:link rel="abc" href="/def/234"/>
</order>
Thanks,
Lucas
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…