InclusiveNamespacespublic class InclusiveNamespaces extends ElementProxy implements TransformParamThis 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. |
Fields Summary |
---|
public static final String | _TAG_EC_INCLUSIVENAMESPACESField _TAG_EC_INCLUSIVENAMESPACES | public static final String | _ATT_EC_PREFIXLISTField _ATT_EC_PREFIXLIST | public static final String | ExclusiveCanonicalizationNamespaceField ExclusiveCanonicalizationNamespace |
Constructors Summary |
---|
public InclusiveNamespaces(Document doc, String prefixList)Constructor XPathContainer
this(doc, InclusiveNamespaces.prefixStr2Set(prefixList));
| public InclusiveNamespaces(Document doc, Set prefixes)Constructor InclusiveNamespaces
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
super(element, BaseURI);
|
Methods Summary |
---|
public java.lang.String | getBaseLocalName()Method getBaseLocalName
return InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES;
| public java.lang.String | getBaseNamespace()Method getBaseNamespace
return InclusiveNamespaces.ExclusiveCanonicalizationNamespace;
| public java.lang.String | getInclusiveNamespaces()Method getInclusiveNamespaces
return this._constructionElement
.getAttributeNS(null, InclusiveNamespaces._ATT_EC_PREFIXLIST);
| public static java.util.SortedSet | prefixStr2Set(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:
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;
|
|