You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Robert Houben <Ro...@fusionware.net> on 2004/05/01 02:10:59 UTC

RE: XSComplexTypeDecl question again

When I did my thing, xerces did not retain annotations in the PSVI.  Has
this changed?

-----Original Message-----
From: Neil Graham [mailto:neilg@ca.ibm.com] 
Sent: Friday, April 30, 2004 2:35 PM
To: xerces-j-user@xml.apache.org
Subject: Re: XSComplexTypeDecl question again






Hi all,

Actually, non-schema attributes do make their contribution to the schema
component model--sort of.  What one has to do is to define an annotation
on
the element that has the schema from the foreign namespace; the foreign
attribute then gets "promoted" to that annotation.  So, the original
example would have to look something like this:

   <complexType
      name="ArrayOfshort">
    <complexContent>
     <restriction
       base="soapenc:Array">
      <attribute ref="soapenc:arrayType"
    wsdl:arrayType="short[]">
            <annotation/>
      </attribute>
     </restriction>
    </complexContent>
   </complexType>

Now you'd have to find that attributeUse in the XSComplexTypeDefinition,
then call XSAttributeUse.getAttributeDeclaration().getAnnotation()
to dig out the annotation.

So you still have to use DOM or SAX to parse the annotation--since
Xerces
stores it as a raw string--but at least this is somewhat easier for you
than creating a whole new DOM for the schema document(s) and trying to
figure out which DOM nodes map to which components.

Note that things would have gotten even worse if the foreign attribute
had
occured on the restriction element, for instance.  Since annotations can
occur in various places in complexTypes, so it's not possible to tell
which
of the complexType, complexContent, or restriction elements actually
contributed the vforeign attribute.  So you'd have to access it by
calling
XSComplexTypeDefinition.getAnnotations() event, then parsing the
annotation(s) that come back.

So better than a raw DOM, but still kludgy without question...

Hope that helps,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  neilg@ca.ibm.com




 

                      jeehongm@parasoft

                      .com (Jeehong            To:
<xe...@xml.apache.org>

                      Min)                     cc:

                                               Subject:  Re:
XSComplexTypeDecl question again

                      04/30/2004 05:18

                      PM

                      Please respond to

                      xerces-j-user

 

 




Thanks Robert and Jeff for replying.  That confirms my suspicions.

Yeah, until SOAP encoding (or RPC encoded) becomes extinct, I guess we
will
have to revert to traversing the DOM.

- Jeehong

----- Original Message -----
From: "Robert Houben" <Ro...@fusionware.net>
To: <xe...@xml.apache.org>
Sent: Friday, April 30, 2004 9:45 AM
Subject: RE: XSComplexTypeDecl question again


I had the same issue and wound up traversing the DOM.  I managed to
determine the "name" of the object that the array was nested within and
used this to find the correct array definition.  I think I can conceive
of situations where my code may not get me the right thing, though, so
I'm not totally happy with that solution...  I agree - bad choice on the
part of the SOAP encoding design!

-----Original Message-----
From: Jeff Greif [mailto:jgreif@alumni.princeton.edu]
Sent: Friday, April 30, 2004 9:32 AM
To: xerces-j-user@xml.apache.org
Subject: Re: XSComplexTypeDecl question again

I'm pretty sure that you get cannot at the wsdl:arrayType attribute in
your
example using the org.apache.xerces.xs interfaces.  This is also a
pretty
murky area of the WXS spec -- the additional attributes from
non-XMLSchema
namespace in an attribute declaration do not appear to contribute to the
infoset or PSVI.  Since that is what is modeled by the XS components,
it's
not surprising you can't get at these items.

I think that to get at this information, you might have to traverse a
DOM
representing the schema (or catch the appropriate SAX events when the
schema
is parsed), rather than extract the information from the XSModel and its
related objects.

If you succeed, I'd definitely be interested in knowing what you did
and/or
seeing your code.

How unfortunate that the soap encoding scheme used this approach!

Jeff

----- Original Message -----
From: Jeehong Min
To: xerces-j-user@xml.apache.org
Sent: Friday, April 30, 2004 9:07 AM
Subject: XSComplexTypeDecl question again


Any Xerces developers or users,

Can anyone answer?

Thanks,

Jeehong

----- Original Message -----
From: Jeehong Min
To: xerces-j-user@xml.apache.org
Sent: Tuesday, April 27, 2004 1:12 PM
Subject: XSComplexTypeDecl question


Sandy et al,

I have a XSComplexTypeDecl that represents the following complexType in
the
schema.

   <complexType
      name="ArrayOfshort">
    <complexContent>
     <restriction
       base="soapenc:Array">
      <attribute ref="soapenc:arrayType"
    wsdl:arrayType="short[]"/>
     </restriction>
    </complexContent>
   </complexType>

Is there any way to get the string "short[]" from the attribute element?

Thanks,

Jeehong Min


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org