[vwnc] XML unmarshalling, href attribute

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] XML unmarshalling, href attribute

Steffen Märcker
Hi,

I've an XMI export from MagicDraw UML to unmarshal. It contains an element  
<packagedElement> which may have an attribute 'href'. While unmarshalling,  
the following error occurs:

Can not resolve reference to id: 'ML_....'

It seems that the unmarshalling framework assumes 'href' to be a reference  
to another element in the same xml file, which is not necessarily the  
case. How can I circumvent this behavior and is there an xml specification  
this assumption is based of?

Thanks in advance!
Steffen
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] XML unmarshalling, href attribute

Kogan, Tamara
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Steffen Märcker
> Sent: Friday, December 18, 2009 9:53 AM
> To: vwnc
> Subject: [vwnc] XML unmarshalling, href attribute
>
> Hi,
>
> I've an XMI export from MagicDraw UML to unmarshal. It
> contains an element  
> <packagedElement> which may have an attribute 'href'. While
> unmarshalling,  
> the following error occurs:
>
> Can not resolve reference to id: 'ML_....'
>
> It seems that the unmarshalling framework assumes 'href' to
> be a reference  
> to another element in the same xml file, which is not
> necessarily the  
> case. How can I circumvent this behavior and is there an xml
> specification  
> this assumption is based of?
>

It doesn't come from XML schema but from Soap encoding. We will fix this behavior when we implement support for Soap 1.2.
There is no way to turn off this option right now. You can try to subclass XMLObjectMarshalingManager and implement
XMLObjectMarshalingManager>>resolveFrom: marshalingContext do: aBlock
Without:
        target := (marshalingContext marshaler unmarshalHRefFrom:  marshalingContext)
                ifTrue: [ marshalingContext value]

Tamara
 

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] XML unmarshalling, href attribute

Steven Kelly
In reply to this post by Steffen Märcker
SOAP 1.1 uses unqualified id and href attributes to allow one element to refer to another, and hence to build structures that are more than just trees. These references are (tend to be?) within a single SOAP message. VW supports this for SOAP, and we've also used it to good effect for XML2Object bindings. For the SOAP definition see the 5th para in "3. Relation to XML" in http://www.w3.org/TR/2000/NOTE-SOAP-20000508/
This refers to the then-current version of XLINK:
http://www.w3.org/TR/2000/CR-xlink-20000703/#link-locators
which refers to the then-current version of XPTR (XPointer). I can't find a specification for id there that exactly matches what SOAP does (unqualified id attribute of arbitrary type).

Later, things evolved:
- The href attribute in SOAP 1.1 (of type xs:anyURI) is called enc:ref in SOAP 1.2 and is of type IDREF.
- Current versions of XLink use xlink:href - the xlink: qualifier distinguishes this from SOAP.

I've never really felt I understood exactly which standards were involved here, so if anybody knows better I'd be delighted!

Steve

PS the most interesting methods are probably:
WebServices.XMLObjectMarshalingManager>>resolveHReference:fromElement:
WebServices.XMLObjectMarshalingManager>>resolveID:for:


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Steffen Märcker
> Sent: 18 December 2009 16:53
> To: vwnc
> Subject: [vwnc] XML unmarshalling, href attribute
>
> Hi,
>
> I've an XMI export from MagicDraw UML to unmarshal. It contains an
> element
> <packagedElement> which may have an attribute 'href'. While
> unmarshalling,
> the following error occurs:
>
> Can not resolve reference to id: 'ML_....'
>
> It seems that the unmarshalling framework assumes 'href' to be a
> reference
> to another element in the same xml file, which is not necessarily the
> case. How can I circumvent this behavior and is there an xml
> specification
> this assumption is based of?
>
> Thanks in advance!
> Steffen
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc