java - How to specify an attribute namespace in XSD so that JAXB interprets it correctly? -


i have small problem attribute namespaces within existing xsd. have modify xsd in order use functionality of third-party software.
goal mix element namespaced attribute, this:

<graphics type="rectangle" cy:nodelabel="label 1" /> 

the <graphics> element defined in default namespace, attribute cy:nodelabel in specific namespace.

currently, attribute definition in xsd looks this:

<xsd:attribute name="nodelabel" type="xsd:string" form="qualified" xmlns="http://www.cytoscape.org"/> 

the option form="qualified" forces jaxb annotate @xmlattribute namespace="....", takes default namespace, instead of http://www.cytoscape.org. if change manually in generated java classes, xml output desired.

i define attribute namespace within xsd, can rely on jaxb (resp. xjc) generate correct java classes.
how can specify attribute namespace 1 attribute in xsd?

a single xsd file can define single namespace. need separate xsd defines second namespace, import original xsd (and reference attribute accordingly).


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

php - Add the correct number of days for each month -