FileDocCategorySizeDatePackage
InclusiveNamespaces.javaAPI DocJava SE 6 API4852Tue Jun 10 00:23:04 BST 2008com.sun.org.apache.xml.internal.security.transforms.params

InclusiveNamespaces

public class InclusiveNamespaces extends ElementProxy implements TransformParam
This Object serves as Content for the ds:Transforms for exclusive Canonicalization.
It implements the {@link Element} interface and can be used directly in a DOM tree.
author
Christian Geuer-Pollmann

Fields Summary
public static final String
_TAG_EC_INCLUSIVENAMESPACES
Field _TAG_EC_INCLUSIVENAMESPACES
public static final String
_ATT_EC_PREFIXLIST
Field _ATT_EC_PREFIXLIST
public static final String
ExclusiveCanonicalizationNamespace
Field ExclusiveCanonicalizationNamespace
Constructors Summary
public InclusiveNamespaces(Document doc, String prefixList)
Constructor XPathContainer

param
doc
param
prefixList


             
        
      this(doc, InclusiveNamespaces.prefixStr2Set(prefixList));
   
public InclusiveNamespaces(Document doc, Set prefixes)
Constructor InclusiveNamespaces

param
doc
param
prefixes


      super(doc);

      StringBuffer sb = new StringBuffer();
      SortedSet prefixList = new TreeSet(prefixes);


      Iterator it = prefixList.iterator();

      while (it.hasNext()) {
         String prefix = (String) it.next();

         if (prefix.equals("xmlns")) {
            sb.append("#default ");
         } else {
            sb.append(prefix + " ");
         }
      }

      this._constructionElement
         .setAttributeNS(null, InclusiveNamespaces._ATT_EC_PREFIXLIST,
                       sb.toString().trim());
   
public InclusiveNamespaces(Element element, String BaseURI)
Constructor InclusiveNamespaces

param
element
param
BaseURI
throws
XMLSecurityException

      super(element, BaseURI);
   
Methods Summary
public java.lang.StringgetBaseLocalName()
Method getBaseLocalName

inheritDoc

      return InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES;
   
public java.lang.StringgetBaseNamespace()
Method getBaseNamespace

inheritDoc

      return InclusiveNamespaces.ExclusiveCanonicalizationNamespace;
   
public java.lang.StringgetInclusiveNamespaces()
Method getInclusiveNamespaces

return
The Inclusive Namespace string

      return this._constructionElement
         .getAttributeNS(null, InclusiveNamespaces._ATT_EC_PREFIXLIST);
   
public static java.util.SortedSetprefixStr2Set(java.lang.String inclusiveNamespaces)
Decodes the inclusiveNamespaces String and returns all selected namespace prefixes as a Set. The #default namespace token is represented as an empty namespace prefix ("xmlns").
The String inclusiveNamespaces=" xenc ds #default" is returned as a Set containing the following Strings:
  • xmlns
  • xenc
  • ds

param
inclusiveNamespaces
return
A set to string


      SortedSet prefixes = new TreeSet();

      if ((inclusiveNamespaces == null)
              || (inclusiveNamespaces.length() == 0)) {
         return prefixes;
      }

      StringTokenizer st = new StringTokenizer(inclusiveNamespaces, " \t\r\n");

      while (st.hasMoreTokens()) {
         String prefix = st.nextToken();

         if (prefix.equals("#default")) {
            prefixes.add("xmlns" );
         } else {
            prefixes.add( prefix);
         }
      }

      return prefixes;