You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by gi...@apache.org on 2011/10/11 20:03:15 UTC

svn commit: r1181995 [24/26] - in /webservices/wss4j/branches/swssf: ./ cxf-integration/ cxf-integration/src/main/java/org/swssf/cxfIntegration/ cxf-integration/src/main/java/org/swssf/cxfIntegration/interceptor/ cxf-integration/src/main/java/org/swssf...

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/DigestMethodType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/DigestMethodType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/DigestMethodType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/DigestMethodType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 import org.w3c.dom.Element;
 
 import javax.xml.bind.annotation.*;
@@ -73,7 +73,7 @@ public class DigestMethodType implements
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Algorithm)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Algorithm)) {
                 this.algorithm = attribute.getValue();
             }
         }
@@ -96,7 +96,7 @@ public class DigestMethodType implements
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_DigestMethod)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_DigestMethod)) {
                     return true;
                 }
                 break;
@@ -105,7 +105,7 @@ public class DigestMethodType implements
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java Tue Oct 11 18:03:00 2011
@@ -18,11 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.SecurityTokenReferenceType;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 import org.w3c.dom.Element;
 
 import javax.xml.bind.JAXBElement;
@@ -84,8 +83,6 @@ public class KeyInfoType implements Pars
     @XmlMixed
     @XmlAnyElement(lax = true)
     protected List<Object> content;
-    @XmlElement(name = "SecurityTokenReference", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
-    protected SecurityTokenReferenceType securityTokenReferenceType;
     @XmlAttribute(name = "Id")
     @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
     @XmlID
@@ -101,7 +98,7 @@ public class KeyInfoType implements Pars
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Id)) {
                 CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
                 this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
             }
@@ -121,18 +118,11 @@ public class KeyInfoType implements Pars
         switch (xmlEvent.getEventType()) {
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
-
-                if (startElement.getName().equals(Constants.TAG_wsse_SecurityTokenReference)) {
-                    currentParseable = this.securityTokenReferenceType = new SecurityTokenReferenceType(startElement);
-                } else {
-                    throw new ParseException("Unsupported Element: " + startElement.getName());
-                }
-
-                break;
+                throw new ParseException("Unsupported Element: " + startElement.getName());
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_KeyInfo)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_KeyInfo)) {
                     return true;
                 }
                 break;
@@ -141,15 +131,12 @@ public class KeyInfoType implements Pars
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
 
     public void validate() throws ParseException {
-        if (securityTokenReferenceType == null) {
-            throw new ParseException("Element \"SecurityTokenReference\" is missing");
-        }
     }
 
     /**
@@ -207,12 +194,4 @@ public class KeyInfoType implements Pars
     public void setId(String value) {
         this.id = value;
     }
-
-    public SecurityTokenReferenceType getSecurityTokenReferenceType() {
-        return securityTokenReferenceType;
-    }
-
-    public void setSecurityTokenReferenceType(SecurityTokenReferenceType securityTokenReferenceType) {
-        this.securityTokenReferenceType = securityTokenReferenceType;
-    }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
@@ -91,12 +91,12 @@ public class ReferenceType implements Pa
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Id)) {
                 CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
                 this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
-            } else if (attribute.getName().equals(Constants.ATT_NULL_URI)) {
-                this.uri = Utils.dropReferenceMarker(attribute.getValue());
-            } else if (attribute.getName().equals(Constants.ATT_NULL_Type)) {
+            } else if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_URI)) {
+                this.uri = XMLSecurityUtils.dropReferenceMarker(attribute.getValue());
+            } else if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Type)) {
                 this.type = attribute.getValue();
             }
         }
@@ -116,11 +116,11 @@ public class ReferenceType implements Pa
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_dsig_Transforms)) {
-                    currentParseable = this.transforms = new TransformsType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_DigestMethod)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_Transforms)) {
+                    currentParseable = this.transforms = newTransformsType(startElement);
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_DigestMethod)) {
                     currentParseable = this.digestMethod = new DigestMethodType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_DigestValue)) {
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_DigestValue)) {
                     currentParseable = new Parseable() {
                         public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
                             switch (xmlEvent.getEventType()) {
@@ -147,7 +147,7 @@ public class ReferenceType implements Pa
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_Reference)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_Reference)) {
                     return true;
                 }
                 break;
@@ -156,11 +156,15 @@ public class ReferenceType implements Pa
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
 
+    protected TransformsType newTransformsType(StartElement startElement) {
+        return new TransformsType(startElement);
+    }
+
     public void validate() throws ParseException {
         if (digestMethod == null || digestValue == null || uri == null) {
             throw new ParseException("Element \"DigestMethod\"|\"DigestValue\" or Attribute \"uri\" is missing");

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureMethodType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureMethodType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureMethodType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureMethodType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.*;
@@ -76,7 +76,7 @@ public class SignatureMethodType impleme
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Algorithm)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Algorithm)) {
                 this.algorithm = attribute.getValue();
             }
         }
@@ -99,12 +99,12 @@ public class SignatureMethodType impleme
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_SignatureMethod)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_SignatureMethod)) {
                     return true;
                 }
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
@@ -87,7 +87,7 @@ public class SignatureType implements Pa
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Id)) {
                 CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
                 this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
             }
@@ -108,12 +108,12 @@ public class SignatureType implements Pa
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_dsig_SignedInfo)) {
-                    currentParseable = this.signedInfo = new SignedInfoType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_SignatureValue)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_SignedInfo)) {
+                    currentParseable = this.signedInfo = newSignedInfoType(startElement);
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_SignatureValue)) {
                     currentParseable = this.signatureValue = new SignatureValueType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_KeyInfo)) {
-                    currentParseable = this.keyInfo = new KeyInfoType(startElement);
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_KeyInfo)) {
+                    currentParseable = this.keyInfo = newKeyInfoType(startElement);
                 } else {
                     throw new ParseException("Unsupported Element: " + startElement.getName());
                 }
@@ -122,7 +122,7 @@ public class SignatureType implements Pa
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_Signature)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_Signature)) {
                     return true;
                 }
                 break;
@@ -131,11 +131,19 @@ public class SignatureType implements Pa
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
 
+    protected SignedInfoType newSignedInfoType(StartElement startElement) {
+        return new SignedInfoType(startElement);
+    }
+
+    protected KeyInfoType newKeyInfoType(StartElement startElement) {
+        return new KeyInfoType(startElement);
+    }
+
     public void validate() throws ParseException {
         if (signedInfo == null || signatureValue == null) {
             throw new ParseException("Element \"SignedInfo\"|\"SignatureValue\" is missing");

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureValueType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureValueType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureValueType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureValueType.java Tue Oct 11 18:03:00 2011
@@ -19,10 +19,10 @@
 package org.w3._2000._09.xmldsig_;
 
 import org.apache.commons.codec.binary.Base64;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
@@ -72,7 +72,7 @@ public class SignatureValueType implemen
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Id)) {
                 CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
                 this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
             }
@@ -96,7 +96,7 @@ public class SignatureValueType implemen
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_SignatureValue)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_SignatureValue)) {
                     return true;
                 }
                 break;
@@ -104,7 +104,7 @@ public class SignatureValueType implemen
                 this.value.append(xmlEvent.asCharacters().getData());
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignedInfoType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignedInfoType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignedInfoType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/SignedInfoType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
@@ -83,7 +83,7 @@ public class SignedInfoType implements P
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Id)) {
                 CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
                 this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
             }
@@ -104,12 +104,12 @@ public class SignedInfoType implements P
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_dsig_CanonicalizationMethod)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_CanonicalizationMethod)) {
                     currentParseable = this.canonicalizationMethod = new CanonicalizationMethodType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_SignatureMethod)) {
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_SignatureMethod)) {
                     currentParseable = this.signatureMethod = new SignatureMethodType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_Reference)) {
-                    ReferenceType referenceType = new ReferenceType(startElement);
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_Reference)) {
+                    ReferenceType referenceType = newReferenceType(startElement);
                     currentParseable = referenceType;
                     getReference().add(referenceType);
                 } else {
@@ -120,7 +120,7 @@ public class SignedInfoType implements P
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_SignedInfo)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_SignedInfo)) {
                     return true;
                 }
                 break;
@@ -129,11 +129,15 @@ public class SignedInfoType implements P
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
 
+    protected ReferenceType newReferenceType(StartElement startElement) {
+        return new ReferenceType(startElement);
+    }
+
     public void validate() throws ParseException {
         if (canonicalizationMethod == null || signatureMethod == null || getReference().size() == 0) {
             throw new ParseException("Element \"CanonicalizationMethod\"|\"SignatureMethod\"|\"Reference\" is missing");

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformType.java Tue Oct 11 18:03:00 2011
@@ -18,11 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.TransformationParametersType;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 import org.w3c.dom.Element;
 
 import javax.xml.bind.JAXBElement;
@@ -70,7 +69,6 @@ public class TransformType implements Pa
     @XmlSchemaType(name = "anyURI")
     protected String algorithm;
     protected String inclusiveNamespaces;
-    protected TransformationParametersType transformationParametersType;
 
     private Parseable currentParseable;
 
@@ -79,7 +77,7 @@ public class TransformType implements Pa
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Algorithm)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Algorithm)) {
                 this.algorithm = attribute.getValue();
             }
         }
@@ -98,8 +96,8 @@ public class TransformType implements Pa
         switch (xmlEvent.getEventType()) {
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
-                if (startElement.getName().equals(Constants.TAG_c14nExcl_InclusiveNamespaces)) {
-                    Attribute attribute = startElement.getAttributeByName(Constants.ATT_NULL_PrefixList);
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces)) {
+                    Attribute attribute = startElement.getAttributeByName(XMLSecurityConstants.ATT_NULL_PrefixList);
                     if (attribute != null) {
                         inclusiveNamespaces = attribute.getValue();
                     }
@@ -120,8 +118,6 @@ public class TransformType implements Pa
                         public void validate() throws ParseException {
                         }
                     };
-                } else if (startElement.getName().equals(Constants.TAG_wsse_TransformationParameters)) {
-                    currentParseable = transformationParametersType = new TransformationParametersType(startElement);
                 } else {
                     throw new ParseException("Unsupported Element: " + startElement.getName());
                 }
@@ -129,7 +125,7 @@ public class TransformType implements Pa
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_Transform)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_Transform)) {
                     return true;
                 }
                 break;
@@ -138,7 +134,7 @@ public class TransformType implements Pa
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
@@ -206,8 +202,4 @@ public class TransformType implements Pa
     public void setInclusiveNamespaces(String inclusiveNamespaces) {
         this.inclusiveNamespaces = inclusiveNamespaces;
     }
-
-    public TransformationParametersType getTransformationParametersType() {
-        return transformationParametersType;
-    }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -80,8 +80,8 @@ public class TransformsType implements P
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_dsig_Transform)) {
-                    TransformType transformType = new TransformType(startElement);
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_Transform)) {
+                    TransformType transformType = newTransformType(startElement);
                     currentParseable = transformType;
                     getTransform().add(transformType);
                 } else {
@@ -92,7 +92,7 @@ public class TransformsType implements P
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_Transforms)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_Transforms)) {
                     return true;
                 }
                 break;
@@ -101,11 +101,15 @@ public class TransformsType implements P
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
 
+    protected TransformType newTransformType(StartElement startElement) {
+        return new TransformType(startElement);
+    }
+
     public void validate() throws ParseException {
         if (transform.size() == 0) {
             throw new ParseException("Element \"Transform\" is missing");

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509DataType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509DataType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509DataType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509DataType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 import org.w3c.dom.Element;
 
 import javax.xml.bind.JAXBElement;
@@ -96,7 +96,7 @@ public class X509DataType implements Par
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_dsig_X509IssuerSerial)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_X509IssuerSerial)) {
                     currentParseable = this.x509IssuerSerialType = new X509IssuerSerialType(startElement);
                 } else {
                     throw new ParseException("Unsupported Element: " + startElement.getName());
@@ -105,7 +105,7 @@ public class X509DataType implements Par
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_X509Data)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_X509Data)) {
                     return true;
                 }
                 break;
@@ -114,7 +114,7 @@ public class X509DataType implements Par
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509IssuerSerialType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509IssuerSerialType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509IssuerSerialType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2000/_09/xmldsig_/X509IssuerSerialType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2000._09.xmldsig_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -84,7 +84,7 @@ public class X509IssuerSerialType implem
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_dsig_X509IssuerName)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_X509IssuerName)) {
                     currentParseable = new Parseable() {
                         public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
                             switch (xmlEvent.getEventType()) {
@@ -103,7 +103,7 @@ public class X509IssuerSerialType implem
                         public void validate() throws ParseException {
                         }
                     };
-                } else if (startElement.getName().equals(Constants.TAG_dsig_X509SerialNumber)) {
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_X509SerialNumber)) {
                     currentParseable = new Parseable() {
                         public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
                             switch (xmlEvent.getEventType()) {
@@ -129,7 +129,7 @@ public class X509IssuerSerialType implem
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_dsig_X509IssuerSerial)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_dsig_X509IssuerSerial)) {
                     return true;
                 }
                 break;
@@ -138,7 +138,7 @@ public class X509IssuerSerialType implem
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/CipherDataType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/CipherDataType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/CipherDataType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/CipherDataType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2001._04.xmlenc_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -84,19 +84,19 @@ public class CipherDataType implements P
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_xenc_CipherValue)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_xenc_CipherValue)) {
                     currentParseable = new Parseable() {
                         public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
                             switch (xmlEvent.getEventType()) {
                                 case XMLStreamConstants.START_ELEMENT:
                                     StartElement startElement = xmlEvent.asStartElement();
-                                    if (!startElement.getName().equals(Constants.TAG_xenc_CipherValue)) {
+                                    if (!startElement.getName().equals(XMLSecurityConstants.TAG_xenc_CipherValue)) {
                                         throw new ParseException("Unsupported Element " + startElement.getName());
                                     }
                                     break;
                                 case XMLStreamConstants.END_ELEMENT:
                                     EndElement endElement = xmlEvent.asEndElement();
-                                    if (endElement.getName().equals(Constants.TAG_xenc_CipherValue)) {
+                                    if (endElement.getName().equals(XMLSecurityConstants.TAG_xenc_CipherValue)) {
                                         return true;
                                     }
                                     break;
@@ -104,7 +104,7 @@ public class CipherDataType implements P
                                     cipherValue.append(xmlEvent.asCharacters().getData());
                                     break;
                                 default:
-                                    throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                                    throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
                             }
                             return false;
                         }
@@ -125,7 +125,7 @@ public class CipherDataType implements P
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_xenc_CipherData)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_xenc_CipherData)) {
                     return true;
                 }
                 break;
@@ -134,7 +134,7 @@ public class CipherDataType implements P
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedKeyType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedKeyType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedKeyType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedKeyType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2001._04.xmlenc_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.stream.XMLStreamConstants;
@@ -91,14 +91,14 @@ public class EncryptedKeyType
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_xenc_ReferenceList)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_xenc_ReferenceList)) {
                     currentParseable = this.referenceList = new ReferenceList(startElement);
                 }
                 break;
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_xenc_EncryptedKey)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_xenc_EncryptedKey)) {
                     return true;
                 }
                 break;
@@ -107,7 +107,7 @@ public class EncryptedKeyType
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptedType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2001._04.xmlenc_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 import org.w3._2000._09.xmldsig_.KeyInfoType;
 
 import javax.xml.bind.annotation.*;
@@ -106,14 +106,14 @@ public abstract class EncryptedType impl
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Id)) {
                 CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
                 this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
-            } else if (attribute.getName().equals(Constants.ATT_NULL_Type)) {
+            } else if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Type)) {
                 this.type = attribute.getValue();
-            } else if (attribute.getName().equals(Constants.ATT_NULL_MimeType)) {
+            } else if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_MimeType)) {
                 this.mimeType = attribute.getValue();
-            } else if (attribute.getName().equals(Constants.ATT_NULL_Encoding)) {
+            } else if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Encoding)) {
                 this.encoding = attribute.getValue();
             }
         }
@@ -133,20 +133,20 @@ public abstract class EncryptedType impl
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_xenc_EncryptionMethod)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_xenc_EncryptionMethod)) {
                     currentParseable = this.encryptionMethod = new EncryptionMethodType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_dsig_KeyInfo)) {
-                    currentParseable = this.keyInfo = new KeyInfoType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_xenc_CipherData)) {
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_dsig_KeyInfo)) {
+                    currentParseable = this.keyInfo = newKeyInfoType(startElement);
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_xenc_CipherData)) {
                     currentParseable = this.cipherData = new CipherDataType(startElement);
-                } else if (startElement.getName().equals(Constants.TAG_xenc_EncryptionProperties)) {
+                } else if (startElement.getName().equals(XMLSecurityConstants.TAG_xenc_EncryptionProperties)) {
                     //currentParseable = this.encryptionProperties = new EncryptionPropertiesType();
                     currentParseable = new Parseable() {
                         public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
                             switch (xmlEvent.getEventType()) {
                                 case XMLStreamConstants.END_ELEMENT:
                                     EndElement endElement = xmlEvent.asEndElement();
-                                    if (endElement.getName().equals(Constants.TAG_xenc_EncryptionProperties)) {
+                                    if (endElement.getName().equals(XMLSecurityConstants.TAG_xenc_EncryptionProperties)) {
                                         return true;
                                     }
                                     break;
@@ -173,11 +173,15 @@ public abstract class EncryptedType impl
             case XMLStreamConstants.COMMENT:
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }
 
+    protected KeyInfoType newKeyInfoType(StartElement startElement) {
+        return new KeyInfoType(startElement);
+    }
+
     public void validate() throws ParseException {
         if (cipherData == null) {
             throw new ParseException("Element \"CipherData\" is missing");

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptionMethodType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptionMethodType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptionMethodType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/EncryptionMethodType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2001._04.xmlenc_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.*;
@@ -80,7 +80,7 @@ public class EncryptionMethodType implem
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_Algorithm)) {
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_Algorithm)) {
                 this.algorithm = attribute.getValue();
             }
         }
@@ -102,12 +102,12 @@ public class EncryptionMethodType implem
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_xenc_EncryptionMethod)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_xenc_EncryptionMethod)) {
                     return true;
                 }
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceList.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceList.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceList.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceList.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2001._04.xmlenc_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.*;
@@ -84,7 +84,7 @@ public class ReferenceList implements Pa
             case XMLStreamConstants.START_ELEMENT:
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(Constants.TAG_xenc_DataReference)) {
+                if (startElement.getName().equals(XMLSecurityConstants.TAG_xenc_DataReference)) {
                     ReferenceType referenceType = new ReferenceType(startElement);
                     currentParseable = referenceType;
                     getDataReferenceOrKeyReference().add(referenceType);
@@ -96,12 +96,12 @@ public class ReferenceList implements Pa
             case XMLStreamConstants.END_ELEMENT:
                 currentParseable = null;
                 EndElement endElement = xmlEvent.asEndElement();
-                if (endElement.getName().equals(Constants.TAG_xenc_ReferenceList)) {
+                if (endElement.getName().equals(XMLSecurityConstants.TAG_xenc_ReferenceList)) {
                     return true;
                 }
                 break;
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
         return false;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceType.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/w3/_2001/_04/xmlenc_/ReferenceType.java Tue Oct 11 18:03:00 2011
@@ -18,10 +18,10 @@
  */
 package org.w3._2001._04.xmlenc_;
 
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityUtils;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.namespace.QName;
@@ -75,8 +75,8 @@ public class ReferenceType implements Pa
         Iterator<Attribute> attributeIterator = startElement.getAttributes();
         while (attributeIterator.hasNext()) {
             Attribute attribute = attributeIterator.next();
-            if (attribute.getName().equals(Constants.ATT_NULL_URI)) {
-                this.uri = Utils.dropReferenceMarker(attribute.getValue());
+            if (attribute.getName().equals(XMLSecurityConstants.ATT_NULL_URI)) {
+                this.uri = XMLSecurityUtils.dropReferenceMarker(attribute.getValue());
             }
         }
     }
@@ -92,7 +92,7 @@ public class ReferenceType implements Pa
             case XMLStreamConstants.START_ELEMENT:
                 throw new ParseException("Unsupported Element: " + xmlEvent.asStartElement().getName());
             default:
-                throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
+                throw new ParseException("Unexpected event received " + XMLSecurityUtils.getXMLEventAsString(xmlEvent));
         }
     }
 

Added: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/messages/errors.properties
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/messages/errors.properties?rev=1181995&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/messages/errors.properties (added)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/messages/errors.properties Tue Oct 11 18:03:00 2011
@@ -0,0 +1,123 @@
+## defines error code - str message mapping
+0 = General security error
+1 = An unsupported token was provided
+2 = An unsupported signature or encryption algorithm was used
+3 = An error was discovered processing the <wsse:Security> header
+4 = An invalid security token was provided
+5 = The security token could not be authenticated or authorized
+6 = The signature or decryption was invalid
+7 = Referenced security token could not be retrieved
+8 = The message has expired
+9 = Cannot encrypt data
+10 = Signature creation failed
+
+## detailed error msgs
+noToken = Reference \"{0}\"
+noReference = <Reference> token could not be retrieved
+badReferenceURI = Reference URI is null
+unhandledToken = Security token supported but currently not handled \"{0}\"
+unsupportedBinaryTokenType = Token type \"{0}\"
+invalidConstructor = Token impl. class \"{0}\" does not provide appropriate constructor
+invalidValueType = Bad ValueType \"{0}\"
+unsupportedKeyInfo = Unsupported KeyInfo type
+invalidX509Data = Unexpected number of X509Data: {0}
+unknownSignatureAlgorithm = An unknown signature algorithm was specified: {0}
+noUserCertsFound = No certificates for user {0} were found for {1}
+noCertsFound = No certificates were found for {0}
+invalidCertData = Unexpected number of certificates: {0}
+noSKIHandling = Error during processing of SKI data: {0}
+invalidDataRef = Cannot handle multiple data references
+noEncryptedData = Referenced encrypted data could not be retrieved. Reference \"{0}\"
+badElement = Bad element, expected \"{0}\" while got \"{1}\"
+badTokenType00 = Bad UsernameToken Type
+badTokenType01 = Bad UsernameToken Values
+failedAuthentication = User ({0}) not authenticated
+missingUsernameToken = UsernameToken is missing
+missingSecurityHeader = Security header is missing
+missingUsername = Username is missing
+missingPassword = Password is missing
+missingPasswordType =Password attribute type is missing
+missingNonce = Nonce is missing
+missingCreated = Created time is missing
+noSecProvider = Specified security provider not available
+noSHA1availabe = Crypto provider does not suppor1 SHA-1 digest
+noHMACSHA1available = Crypto provider does not suppor1 HMACSHA-1 digest
+parseError = Cannot parse/decode the certificate data
+encodeError = Cannot encode the certificate data
+invalidCertForSKI = An X509 certificate with version 3 must be used for SKI. The presented cert has version: {0}
+unsupportedCertType = Certificate type not supported by security provider
+invalidCert = The provided certificate is invalid
+noXMLSig = Cannot setup signature data structure
+keystore = Cannot access/read keystore data
+noCert = No certificate provided
+##
+noSigCryptoFile=WSSecurityEngine: No crypto property file supplied to verify signature
+noDecCryptoFile=WSSecurityEngine: No crypto property file supplied for decryption
+noCallback=WSSecurityEngine: No password callback supplied
+noPassword=WSSecurityEngine: Callback supplied no password for: {0}
+noKey=WSSecurityEngine: Callback supplied no key for: {0}
+noEncAlgo=WSSecurityEngine: xenc:EncryptedKey does not contain xenc:EncryptionMethod/@Algorithm
+unsupportedKeyTransp=unsupported key transport encryption algorithm: {0}
+noCipher=WSSecurityEngine: EncryptedKey does not contain xenc:CipherData/xenc:CipherValue
+noKeyinfo=WSSecurityEngine: EncryptedKey does not contain ds:KeyInfo
+noEncKey=WSSecurityEngine: EncryptedData does not contain xenc:EncryptedKey
+noSecTokRef=WSSecurityEngine: EncryptedKey does not contain ds:KeyInfo/wsse:SecurityTokenReference
+unsupportedKeyId=Unsupported key identification
+dataRef=WSSecurityEngine: DataReference - referenced data not found
+noKeyname=WSSecurityEngine: ds:KeyName does not contain a key name
+noEncElement=WSEncryptBody/WSSignEnvelope: Element to encrypt/sign not found: {0}
+certpath=Error during certificate path validation: {0}
+invalidTimestamp=WSSecurityEngine: Invalid timestamp: {0}
+noKeySupplied=WSEncryptBody: No symmetrical encryption key supplied
+#
+noSAMLdoc=Cannot convert SAML to DOM document
+invalidSAMLsecurity=SAML token security failure
+invalidSAMLToken = Invalid SAML assertion : {0}
+invalidData=Invalid data: {0}
+noKeyInSAMLToken=Provided SAML token does not contain a suitable key
+#
+decoding.divisible.four = It should be divisible by four
+decoding.general = Error while decoding
+
+unknownAction=Unknown Action {0}
+unableToLoadClass=Unable to load class {0}
+
+requiredElementNoID=Element {0} is not signed; it does not have a wsu:Id attribute
+noSignResult=No SIGN result in WSS4J result vector
+requiredElementNotSigned=Element {0} is not included in the signature
+
+invalidKeySize=Invalid keysize
+
+missingSecurityProperties = SecurityProperties must not be null!
+noOutputAction = No outgoing actions specified
+noSignatureUser = Signature user is not set
+noEncryptionUser = Encryption user is not set
+noTokenUser = Token user is not set
+
+decryptionKeyStoreNotSet = Decryption KeyStore is not set
+decryptionCryptoClassWrong = DecryptionCryptoClass must be a sub-class of CryptoBase
+decryptionCryptoFailure = DecryptionCrypto instantiation failed
+
+encryptionKeyStoreNotSet = Encryption KeyStore is not set
+encryptionCryptoClassWrong = EncryptionCryptoClass must be a sub-class of CryptoBase
+encryptionCryptoFailure = EncryptionCrypto instantiation failed
+
+signatureKeyStoreNotSet = Signature KeyStore is not set
+signatureCryptoClassWrong = SignatureCryptoClass must be a sub-class of CryptoBase
+signatureCryptoFailure = SignatureCrypto instantiation failed
+
+signatureVerificationKeyStoreNotSet = Signature verification KeyStore is not set
+signatureVerificationCryptoClassWrong = SignatureVerificationCryptoClass must be a sub-class of CryptoBase
+signatureVerificationCryptoFailure = SignatureVerificationCrypto instantiation failed
+
+aliasIsNull = alias is null
+keyError = Key error: {0}
+unexpectedEndOfXML = Unexpected end of XML
+notAStartElement = Current element is not a start element
+unprocessedEncryptionReferences = Some encryption references where not processed... Probably security header ordering problem?
+unprocessedSignatureReferences = Some signature references where not processed... Probably security header ordering problem?
+duplicateId = Duplicate id encountered!
+unexpectedXMLEvent = "Unexpected event: {0}
+notASOAPMessage = Request is not a valid SOAP Message
+digestVerificationFailed = Digest verification failed for URI {0}
+unsupportedSecurityToken = Unsupported SecurityToken {0}

Added: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/schemas/XMLSchema.dtd
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/schemas/XMLSchema.dtd?rev=1181995&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/schemas/XMLSchema.dtd (added)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/resources/schemas/XMLSchema.dtd Tue Oct 11 18:03:00 2011
@@ -0,0 +1,402 @@
+<!-- DTD for XML Schemas: Part 1: Structures
+     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
+     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
+<!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 ht Exp $ -->
+<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
+<!-- prose copy in the structures REC is the definitive version -->    <!--d-->
+<!-- (which shouldn't differ from this one except for this -->         <!--d-->
+<!-- comment and entity expansions, but just in case) -->              <!--d-->
+<!-- With the exception of cases with multiple namespace
+     prefixes for the XML Schema namespace, any XML document which is
+     not valid per this DTD given redefinitions in its internal subset of the
+     'p' and 's' parameter entities below appropriate to its namespace
+     declaration of the XML Schema namespace is almost certainly not
+     a valid schema. -->
+
+<!-- The simpleType element and its constituent parts
+     are defined in XML Schema: Part 2: Datatypes -->
+<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
+
+<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
+                         schema document to establish a different
+                         namespace prefix -->
+<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
+                         also define %s as the suffix for the appropriate
+                         namespace declaration (e.g. :foo) -->
+<!ENTITY % nds 'xmlns%s;'>
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % schema "%p;schema">
+<!ENTITY % complexType "%p;complexType">
+<!ENTITY % complexContent "%p;complexContent">
+<!ENTITY % simpleContent "%p;simpleContent">
+<!ENTITY % extension "%p;extension">
+<!ENTITY % element "%p;element">
+<!ENTITY % unique "%p;unique">
+<!ENTITY % key "%p;key">
+<!ENTITY % keyref "%p;keyref">
+<!ENTITY % selector "%p;selector">
+<!ENTITY % field "%p;field">
+<!ENTITY % group "%p;group">
+<!ENTITY % all "%p;all">
+<!ENTITY % choice "%p;choice">
+<!ENTITY % sequence "%p;sequence">
+<!ENTITY % any "%p;any">
+<!ENTITY % anyAttribute "%p;anyAttribute">
+<!ENTITY % attribute "%p;attribute">
+<!ENTITY % attributeGroup "%p;attributeGroup">
+<!ENTITY % include "%p;include">
+<!ENTITY % import "%p;import">
+<!ENTITY % redefine "%p;redefine">
+<!ENTITY % notation "%p;notation">
+
+<!-- annotation elements -->
+<!ENTITY % annotation "%p;annotation">
+<!ENTITY % appinfo "%p;appinfo">
+<!ENTITY % documentation "%p;documentation">
+
+<!-- Customisation entities for the ATTLIST of each element type.
+     Define one of these if your schema takes advantage of the
+     anyAttribute='##other' in the schema for schemas -->
+
+<!ENTITY % schemaAttrs ''>
+<!ENTITY % complexTypeAttrs ''>
+<!ENTITY % complexContentAttrs ''>
+<!ENTITY % simpleContentAttrs ''>
+<!ENTITY % extensionAttrs ''>
+<!ENTITY % elementAttrs ''>
+<!ENTITY % groupAttrs ''>
+<!ENTITY % allAttrs ''>
+<!ENTITY % choiceAttrs ''>
+<!ENTITY % sequenceAttrs ''>
+<!ENTITY % anyAttrs ''>
+<!ENTITY % anyAttributeAttrs ''>
+<!ENTITY % attributeAttrs ''>
+<!ENTITY % attributeGroupAttrs ''>
+<!ENTITY % uniqueAttrs ''>
+<!ENTITY % keyAttrs ''>
+<!ENTITY % keyrefAttrs ''>
+<!ENTITY % selectorAttrs ''>
+<!ENTITY % fieldAttrs ''>
+<!ENTITY % includeAttrs ''>
+<!ENTITY % importAttrs ''>
+<!ENTITY % redefineAttrs ''>
+<!ENTITY % notationAttrs ''>
+<!ENTITY % annotationAttrs ''>
+<!ENTITY % appinfoAttrs ''>
+<!ENTITY % documentationAttrs ''>
+
+<!ENTITY % complexDerivationSet "CDATA">
+      <!-- #all or space-separated list drawn from derivationChoice -->
+<!ENTITY % blockSet "CDATA">
+      <!-- #all or space-separated list drawn from
+                      derivationChoice + 'substitution' -->
+
+<!ENTITY % mgs '%all; | %choice; | %sequence;'>
+<!ENTITY % cs '%choice; | %sequence;'>
+<!ENTITY % formValues '(qualified|unqualified)'>
+
+
+<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
+
+<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
+
+<!-- This is used in part2 -->
+<!ENTITY % restriction1 '((%mgs; | %group;)?)'>
+
+%xs-datatypes;
+
+<!-- the duplication below is to produce an unambiguous content model
+     which allows annotation everywhere -->
+<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
+                    ((%simpleType; | %complexType;
+                      | %element; | %attribute;
+                      | %attributeGroup; | %group;
+                      | %notation; ),
+                     (%annotation;)*)* )>
+<!ATTLIST %schema;
+   targetNamespace      %URIref;               #IMPLIED
+   version              CDATA                  #IMPLIED
+   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
+   xmlns                CDATA                  #IMPLIED
+   finalDefault         %complexDerivationSet; ''
+   blockDefault         %blockSet;             ''
+   id                   ID                     #IMPLIED
+   elementFormDefault   %formValues;           'unqualified'
+   attributeFormDefault %formValues;           'unqualified'
+   xml:lang             CDATA                  #IMPLIED
+   %schemaAttrs;>
+<!-- Note the xmlns declaration is NOT in the Schema for Schemas,
+     because at the Infoset level where schemas operate,
+     xmlns(:prefix) is NOT an attribute! -->
+<!-- The declaration of xmlns is a convenience for schema authors -->
+ 
+<!-- The id attribute here and below is for use in external references
+     from non-schemas using simple fragment identifiers.
+     It is NOT used for schema-to-schema reference, internal or
+     external. -->
+
+<!-- a type is a named content type specification which allows attribute
+     declarations-->
+<!-- -->
+
+<!ELEMENT %complexType; ((%annotation;)?,
+                         (%simpleContent;|%complexContent;|
+                          %particleAndAttrs;))>
+
+<!ATTLIST %complexType;
+          name      %NCName;                        #IMPLIED
+          id        ID                              #IMPLIED
+          abstract  %boolean;                       #IMPLIED
+          final     %complexDerivationSet;          #IMPLIED
+          block     %complexDerivationSet;          #IMPLIED
+          mixed (true|false) 'false'
+          %complexTypeAttrs;>
+
+<!-- particleAndAttrs is shorthand for a root type -->
+<!-- mixed is disallowed if simpleContent, overriden if complexContent
+     has one too. -->
+
+<!-- If anyAttribute appears in one or more referenced attributeGroups
+     and/or explicitly, the intersection of the permissions is used -->
+
+<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %complexContent;
+          mixed (true|false) #IMPLIED
+          id    ID           #IMPLIED
+          %complexContentAttrs;>
+
+<!-- restriction should use the branch defined above, not the simple
+     one from part2; extension should use the full model  -->
+
+<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %simpleContent;
+          id    ID           #IMPLIED
+          %simpleContentAttrs;>
+
+<!-- restriction should use the simple branch from part2, not the 
+     one defined above; extension should have no particle  -->
+
+<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
+<!ATTLIST %extension;
+          base  %QName;      #REQUIRED
+          id    ID           #IMPLIED
+          %extensionAttrs;>
+
+<!-- an element is declared by either:
+ a name and a type (either nested or referenced via the type attribute)
+ or a ref to an existing element declaration -->
+
+<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
+                     (%unique; | %key; | %keyref;)*)>
+<!-- simpleType or complexType only if no type|ref attribute -->
+<!-- ref not allowed at top level -->
+<!ATTLIST %element;
+            name               %NCName;               #IMPLIED
+            id                 ID                     #IMPLIED
+            ref                %QName;                #IMPLIED
+            type               %QName;                #IMPLIED
+            minOccurs          %nonNegativeInteger;   #IMPLIED
+            maxOccurs          CDATA                  #IMPLIED
+            nillable           %boolean;              #IMPLIED
+            substitutionGroup  %QName;                #IMPLIED
+            abstract           %boolean;              #IMPLIED
+            final              %complexDerivationSet; #IMPLIED
+            block              %blockSet;             #IMPLIED
+            default            CDATA                  #IMPLIED
+            fixed              CDATA                  #IMPLIED
+            form               %formValues;           #IMPLIED
+            %elementAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- In the absence of type AND ref, type defaults to type of
+     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
+<!-- default and fixed are mutually exclusive -->
+
+<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
+<!ATTLIST %group; 
+          name        %NCName;               #IMPLIED
+          ref         %QName;                #IMPLIED
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %groupAttrs;>
+
+<!ELEMENT %all; ((%annotation;)?, (%element;)*)>
+<!ATTLIST %all;
+          minOccurs   (1)                    #IMPLIED
+          maxOccurs   (1)                    #IMPLIED
+          id          ID                     #IMPLIED
+          %allAttrs;>
+
+<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %choice;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %choiceAttrs;>
+
+<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %sequence;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %sequenceAttrs;>
+
+<!-- an anonymous grouping in a model, or
+     a top-level named group definition, or a reference to same -->
+
+<!-- Note that if order is 'all', group is not allowed inside.
+     If order is 'all' THIS group must be alone (or referenced alone) at
+     the top level of a content model -->
+<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
+<!-- Should allow minOccurs=0 inside order='all' . . . -->
+
+<!ELEMENT %any; (%annotation;)?>
+<!ATTLIST %any;
+            namespace       CDATA                  '##any'
+            processContents (skip|lax|strict)      'strict'
+            minOccurs       %nonNegativeInteger;   '1'
+            maxOccurs       CDATA                  '1'
+            id              ID                     #IMPLIED
+            %anyAttrs;>
+
+<!-- namespace is interpreted as follows:
+                  ##any      - - any non-conflicting WFXML at all
+
+                  ##other    - - any non-conflicting WFXML from namespace other
+                                  than targetNamespace
+
+                  ##local    - - any unqualified non-conflicting WFXML/attribute
+                  one or     - - any non-conflicting WFXML from
+                  more URI        the listed namespaces
+                  references
+
+                  ##targetNamespace ##local may appear in the above list,
+                    with the obvious meaning -->
+
+<!ELEMENT %anyAttribute; (%annotation;)?>
+<!ATTLIST %anyAttribute;
+            namespace       CDATA              '##any'
+            processContents (skip|lax|strict)  'strict'
+            id              ID                 #IMPLIED
+            %anyAttributeAttrs;>
+<!-- namespace is interpreted as for 'any' above -->
+
+<!-- simpleType only if no type|ref attribute -->
+<!-- ref not allowed at top level, name iff at top level -->
+<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
+<!ATTLIST %attribute;
+          name      %NCName;      #IMPLIED
+          id        ID            #IMPLIED
+          ref       %QName;       #IMPLIED
+          type      %QName;       #IMPLIED
+          use       (prohibited|optional|required) #IMPLIED
+          default   CDATA         #IMPLIED
+          fixed     CDATA         #IMPLIED
+          form      %formValues;  #IMPLIED
+          %attributeAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- default for use is optional when nested, none otherwise -->
+<!-- default and fixed are mutually exclusive -->
+<!-- type attr and simpleType content are mutually exclusive -->
+
+<!-- an attributeGroup is a named collection of attribute decls, or a
+     reference thereto -->
+<!ELEMENT %attributeGroup; ((%annotation;)?,
+                       (%attribute; | %attributeGroup;)*,
+                       (%anyAttribute;)?) >
+<!ATTLIST %attributeGroup;
+                 name       %NCName;       #IMPLIED
+                 id         ID             #IMPLIED
+                 ref        %QName;        #IMPLIED
+                 %attributeGroupAttrs;>
+
+<!-- ref iff no content, no name.  ref iff not top level -->
+
+<!-- better reference mechanisms -->
+<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %unique;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %uniqueAttrs;>
+
+<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %key;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyAttrs;>
+
+<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %keyref;
+          name     %NCName;       #REQUIRED
+	  refer    %QName;        #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyrefAttrs;>
+
+<!ELEMENT %selector; ((%annotation;)?)>
+<!ATTLIST %selector;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %selectorAttrs;>
+<!ELEMENT %field; ((%annotation;)?)>
+<!ATTLIST %field;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %fieldAttrs;>
+
+<!-- Schema combination mechanisms -->
+<!ELEMENT %include; (%annotation;)?>
+<!ATTLIST %include;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %includeAttrs;>
+
+<!ELEMENT %import; (%annotation;)?>
+<!ATTLIST %import;
+          namespace      %URIref; #IMPLIED
+          schemaLocation %URIref; #IMPLIED
+          id             ID       #IMPLIED
+          %importAttrs;>
+
+<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
+                      %attributeGroup; | %group;)*>
+<!ATTLIST %redefine;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %redefineAttrs;>
+
+<!ELEMENT %notation; (%annotation;)?>
+<!ATTLIST %notation;
+	  name        %NCName;    #REQUIRED
+	  id          ID          #IMPLIED
+	  public      CDATA       #REQUIRED
+	  system      %URIref;    #IMPLIED
+	  %notationAttrs;>
+
+<!-- Annotation is either application information or documentation -->
+<!-- By having these here they are available for datatypes as well
+     as all the structures elements -->
+
+<!ELEMENT %annotation; (%appinfo; | %documentation;)*>
+<!ATTLIST %annotation; %annotationAttrs;>
+
+<!-- User must define annotation elements in internal subset for this
+     to work -->
+<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
+<!ATTLIST %appinfo;
+          source     %URIref;      #IMPLIED
+          id         ID         #IMPLIED
+          %appinfoAttrs;>
+<!ELEMENT %documentation; ANY>   <!-- too restrictive -->
+<!ATTLIST %documentation;
+          source     %URIref;   #IMPLIED
+          id         ID         #IMPLIED
+          xml:lang   CDATA      #IMPLIED
+          %documentationAttrs;>
+
+<!NOTATION XMLSchemaStructures PUBLIC
+           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
+<!NOTATION XML PUBLIC
+           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >