Skip to Content.
Sympa Menu

mace-opensaml-users - Re: How can I create an instance of a AttributeValue

Subject: OpenSAML user discussion

List archive

Re: How can I create an instance of a AttributeValue


Chronological Thread 
  • From: "Håkon Sagehaug" <>
  • To:
  • Subject: Re: How can I create an instance of a AttributeValue
  • Date: Fri, 29 Feb 2008 16:27:10 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=eYWMJScaHneVtstHyGw/p1m6gUzMTn4xE1/fx21ZQYIe0hRxMqiKSf3YJMaHiyjrhiXumf19b69TeDiomvUgmFOGlGGJKn952DwaMCGWXW/+c4EP0ccn1mau77DH2YJk1cmUsp4sGh9E1KaO0XB5oIxxy07au/AfEP5ljrEp3qg=

Hi

You need a StringBuilder like this

XSStringBuilder xmlStringBuilder = (XSStringBuilder)
        builderFactory.getBuilder(XSString.TYPE_NAME);

and then you make the XSString element like this

XSString value1 = xmlStringBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);

Where AttributeValue.DEFAULT_ELEMENT_NAME is given a Qname.

You get a xmlObjectBuilder = null, because AttributeValue don't have a builder, it's just an interface.

2008/2/29, <>:
How can I create an instance of an AttributeValue of a simple type such as xs:string.

I have tried the following, but the returned XMLObjectBuilder is null.

XMLObjectBuilder xmlObjectBuilder = xmlObjectBuilderFactory.getBuilder(AttributeValue.DEFAULT_ELEMENT_NAME);

XSString xsString = (XSString)xmlObjectBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);

xsString.setValue(value);

Thanks

Regards

Matthew Webb



--
Håkon Sagehaug
Research Assistant
Parallab
Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)


Archive powered by MHonArc 2.6.16.

Top of Page