Thanks Giedrius,
that solved the problem - for others' interest:
HashMap ns = new HashMap();
ns.put("urn:oasis:names:tc:SAML:1.0:protocol", "samlp");
ns.put("urn:oasis:names:tc:SAML:1.0:assertion", "saml");
ns.put("http://www.w3.org/2000/09/xmldsig#", "ds");
xmlOptions.setSaveSuggestedPrefixes(ns);
XmlOption.setSaveAggresiveNamespaces looks a handy method but the 2.1.0
API says it's deprecated and to use use
XmlOptions.setSaveAggresiveNamespaces instead!
Is this a typo?
thanks again,
Alistair
--
Alistair Young
Senior Software Engineer
[EMAIL PROTECTED] Mòr Ostaig
Isle of Skye
Scotland
> Hi,
>
> When serializing to XML you need to pass XMLOptions instance.
>
> see:
> http://xmlbeans.apache.org/docs/2.0.0/reference/org/apache/xmlbeans/XmlOptions.html
>
> XmlOptions#setSaveSuggestedPrefixes(Map prefixes) - will put your prefixes
> XmlOptions#setSaveAggresiveNamepsaces() - will reduce number of namespace
> prefix declarations
>
> Thanks,
>
> Giedrius
> *<http://xmlbeans.apache.org/docs/2.0.0/reference/org/apache/xmlbeans/XmlOptions.html#setSaveAggressiveNamespaces%28%29>
> *
>
> On 12/11/05, Alistair Young <[EMAIL PROTECTED]> wrote:
>>
>> I'm playing around with saml and get a namespace prefix problem:
>>
>> <xb:config
>> xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"
>> xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
>> xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
>> ... package stuff ...
>> </xb:config>
>>
>> when saving a document, the namespace URIs are fine but the prefixes
>> aren't there:
>>
>> <Request xmlns="urn:oasis:names:tc:SAML:1.0:protocol">
>> <AttributeQuery>
>> <urn:Subject xmlns:urn="urn:oasis:names:tc:SAML:1.0:assertion">
>> <urn:NameIdentifier>testID</urn:NameIdentifier>
>> </urn:Subject>
>> </AttributeQuery>
>> </Request>
>>
>> is there are way to force <samlp:Request> and <saml:Subject>? It seems
>> to
>> be creating a "default" prefix for non default namespaces -
>> <urn:Subject>
>> - it should be <saml:Subject> and
>> xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" intead of
>> xmlns:urn="urn:oasis:names:tc:SAML:1.0:assertion"
>>
>> thanks,
>>
>> Alistair
>>
>>
>> --
>> Alistair Young
>> Senior Software Engineer
>> [EMAIL PROTECTED] Mòr Ostaig
>> Isle of Skye
>> Scotland
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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]