Hi Jacob,

Ah, just a beginner mistake 
The right call was this:

schlag[j].getBodenart().getStringValue()   => Lts

The method call getBodenart() returns a code type.

Thanks for the hint. ;o)

Cheers,
Pete



> -----Ursprüngliche Nachricht-----
> Von: Jacob Danner [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 14. März 2007 17:03
> An: [email protected]
> Betreff: Re: Howto get tag value if tag contains namespaces?
> 
> Hi Peter,
> I don't think namespaces would prevent you from doing this.
> You should have something like BodenartDocument/Type and from there I
> think there should be a pojo getStringValue() or similar kind of
> method based on the type. Is this not the case?
> -Jacobd
> 
> On 3/14/07, Peter Neu <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I use xml-beans 2.2.0. I have trouble getting the value of tags which
> > include additional namespaces.
> >
> > The xsd definition looks like this:
> >
> > <xsd:element name="Bodenart" type="CodeType"/>
> >
> > The complex type looks like this:
> >
> > <xsd:complexType name="SchlagType">
> >  <xsd:sequence minOccurs="0">
> >
> >     <xsd:element ref="Bodenart" minOccurs="0"/>
> >
> >  </xsd:sequence>
> >         <xsd:attribute name="id" type="xsd:ID"/>
> >         <xsd:attributeGroup ref="AssociationAttributeGroup"/>
> > </xsd:complexType>
> >
> > My sample sample xml is this:
> >
> > <agroxml:Schlag id="ID000008">
> >
> > <agroxml:Bodenart
> >               codeSpace="http://www.agroxml.de/content/SoilTexture.xml";
> > codeListVersionID="1"> Lts
> >     </agroxml:Bodenart>
> >  </agroxml:Schlag>
> >
> > The problem occurs because of the whole codeSpace and codeList
> declaration.
> > XMLBeans returns this:
> >
> > <xml-fragment codeSpace="http://www.agroxml.de/content/SoilTexture.xml";
> > codeListVersionID="1"
> > xmlns:agroxml="http://www.agroxml.de/schema/agroxml1.2";
> > xmlns:xlink="http://www.w3.org/1999/xlink";
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Lts</xml-fragment>
> >
> > I only need the actual value without the other stuff. -> Lts
> >
> > How can I do this?
> >
> > Cheers,
> > Pete
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to