Don't understand how to map a node

View: New views
3 Messages — Rating Filter:   Alert me  

Don't understand how to map a node

by Michenux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to map a node using the annotation.

The xml is a xmi file 1.2 ( i have no xsd for that ).

The xml is :

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMI xmi.version="1.2" xmlns:UML="org.omg/UML/1.4">
        <XMI.header>
                <XMI.documentation>
                        <XMI.exporter>Visual Paradigm for UML</XMI.exporter>
                        <XMI.exporterVersion>6.3.0</XMI.exporterVersion>
                </XMI.documentation>
                <XMI.metamodel xmi.name="UML" xmi.version="1.4"/>
        </XMI.header>
        <XMI.content>
                <UML:Model name="export_MI-VP-UML" xmi.id="S4exWtiD.AAAAcUk">
...

I don't manage to read the UML:Model node, i have tried with :
@XmlElement(name="Model")
private UMLModel model ;

@XmlElement(name="Model",namespace="UML")
private UMLModel model ;

@XmlElement(name="UML:Model", namespace="org.omg/UML/1.4")
private UMLModel model ;

But none of these works.
I have no problem with reading the parent node.

Thanks for your help.

Re: Don't understand how to map a node

by Wolfgang Laun-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks as if you just missed the correct combination:

@XmlElement( name = "Model", namespace = "org.omg/UML/1.4" )

The name field is *always* a NCName (without NS prefix and colon).
A namespace field *always* refers to the URI defining the namespace.
A prefix is just a local "shorthand" within an XML document, can be changed w/o influence on the processing SW.

-W


On Sat, Oct 31, 2009 at 2:15 PM, Michenux <lmichenaud@...> wrote:

I'm trying to map a node using the annotation.

The xml is a xmi file 1.2 ( i have no xsd for that ).

The xml is :

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMI xmi.version="1.2" xmlns:UML="org.omg/UML/1.4">
       <XMI.header>
               <XMI.documentation>
                       <XMI.exporter>Visual Paradigm for UML</XMI.exporter>
                       <XMI.exporterVersion>6.3.0</XMI.exporterVersion>
               </XMI.documentation>
               <XMI.metamodel xmi.name="UML" xmi.version="1.4"/>
       </XMI.header>
       <XMI.content>
               <UML:Model name="export_MI-VP-UML" xmi.id="S4exWtiD.AAAAcUk">
...

I don't manage to read the UML:Model node, i have tried with :
@XmlElement(name="Model")
private UMLModel model ;

@XmlElement(name="Model",namespace="UML")
private UMLModel model ;

@XmlElement(name="UML:Model", namespace="org.omg/UML/1.4")
private UMLModel model ;

But none of these works.
I have no problem with reading the parent node.

Thanks for your help.

--
View this message in context: http://old.nabble.com/Don%27t-understand-how-to-map-a-node-tp26142270p26142270.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Don't understand how to map a node

by Michenux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot, it works now.