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


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]


Reply via email to