Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] Changing namespace declaration

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] Changing namespace declaration


Chronological Thread 
  • From: Chad La Joie <>
  • To:
  • Subject: Re: [OpenSAML] Changing namespace declaration
  • Date: Wed, 21 May 2008 07:49:21 +0200
  • Openpgp: id=146B2514
  • Organization: SWITCH

No, I don't think it is possible. Also, if this matters to the code you're working with than that code has a horribly broken XML Namespace implementation. Knowing that probably doesn't help you, but you may want to keep an eye out for other issues as you go forward.


wrote:
To enable greater compatibility with some of our existing implementations of
code, I am looking to change the namespace declaration on the marshalled
objects but haven't found a way to do this.

Currently have (for example):
<xacml-context:Request
xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os">

Ideally would like to have:
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">

I have tried to clear the namespaces and add a new namespace with no prefix
as follows...

<code>
RequestTypeImplBuilder xacmlRequest = (RequestTypeImplBuilder)builderFactory
.getBuilder(RequestType.DEFAULT_ELEMENT_NAME);

RequestType request = xacmlRequest.buildObject();
request.getNamespaces().clear();
request.getNamespaces().add(new
Namespace("urn:oasis:names:tc:xacml:2.0:context:schema:os", ""));
</code>

...but I get an java.lang.UnsupportedOperationException thrown on request.getNamespaces().clear();. I have
also tried passing in a new QName("urn:oasis:names:tc:xacml:2.0:context:schema:os",
"Request", "") in place of the RequestType.DEFAULT_ELEMENT_NAME to the builderFactory
but that has no effect.

Is it possible to do this? I am using opensaml 2.1.0.

Thanks,


Christina

--
Christina Cunningham
Software Engineer
Belfast eScience Centre (BeSC)
Queen's University, Belfast
e: c.cunningham [at] besc.ac.uk
w: www.besc.ac.uk

--
SWITCH
Serving Swiss Universities
--------------------------
Chad La Joie, Software Engineer, Security
Werdstrasse 2, P.O. Box, 8021 Zürich, Switzerland
phone +41 44 268 15 75, fax +41 44 268 15 68
,
http://www.switch.ch




Archive powered by MHonArc 2.6.16.

Top of Page