[maven-release-plugin] copy for tag xmlsec-2.0.8

git-svn-id: https://svn.apache.org/repos/asf/santuario/xml-security-java/tags/xmlsec-2.0.8@1772195 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index a698e59..8f8841e 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,5 @@
+#Tue Jul 31 16:08:08 IST 2012
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
diff --git a/etc/santuario-pmd-ruleset.xml b/etc/santuario-pmd-ruleset.xml
index 43553ee..595b859 100644
--- a/etc/santuario-pmd-ruleset.xml
+++ b/etc/santuario-pmd-ruleset.xml
@@ -26,7 +26,6 @@
 
   <rule ref="rulesets/java/basic.xml">
      <exclude name="AvoidUsingHardCodedIP" />
-     <exclude name="SimplifiedTernary" />
   </rule>
   <rule ref="rulesets/java/unusedcode.xml"/>
   <rule ref="rulesets/java/imports.xml"/>
diff --git a/pom.xml b/pom.xml
index 5dcf012..d29fa0e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <artifactId>xmlsec</artifactId>
     <packaging>bundle</packaging>
     <name>Apache XML Security for Java</name>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>2.0.8</version>
     <description>
         Apache XML Security for Java supports XML-Signature Syntax and Processing,
         W3C Recommendation 12 February 2002, and XML Encryption Syntax and
@@ -57,12 +57,12 @@
     </licenses>
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/santuario/xml-security-java/trunk/
+            scm:svn:http://svn.apache.org/repos/asf/santuario/xml-security-java/tags/xmlsec-2.0.8
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/santuario/xml-security-java/trunk/
+            scm:svn:https://svn.apache.org/repos/asf/santuario/xml-security-java/tags/xmlsec-2.0.8
         </developerConnection>
-        <url>http://svn.apache.org/repos/asf/santuario/xml-security-java/trunk/</url>
+        <url>http://svn.apache.org/repos/asf/santuario/xml-security-java/tags/xmlsec-2.0.8</url>
     </scm>
     <organization>
         <name>The Apache Software Foundation</name>
@@ -111,7 +111,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-pmd-plugin</artifactId>
-                <version>3.7</version>
+                <version>3.5</version>
                 <configuration>
                     <rulesets>
                         <ruleset>${basedir}/etc/santuario-pmd-ruleset.xml</ruleset>
@@ -166,7 +166,7 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.0.1</version>
+                <version>2.5.4</version>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
@@ -198,7 +198,7 @@
             <plugin>
                 <groupId>org.jvnet.jaxb2.maven2</groupId>
                 <artifactId>maven-jaxb2-plugin</artifactId>
-                <version>0.13.1</version>
+                <version>0.12.3</version>
                 <executions>
                     <execution>
                         <id>bindings</id>
@@ -274,6 +274,54 @@
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <version>2.10.3</version>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                <version>1.14</version>
+                <configuration>
+                    <signature>
+                        <groupId>org.codehaus.mojo.signature</groupId>
+                        <artifactId>java16</artifactId>
+                        <version>1.0</version>
+                   </signature>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>check-java-compatibility</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>enforce-bytecode-version</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <enforceBytecodeVersion>
+                                    <maxJdkVersion>${targetJdk}</maxJdkVersion>
+                                </enforceBytecodeVersion>
+                            </rules>
+                            <fail>true</fail>
+                        </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>extra-enforcer-rules</artifactId>
+                        <version>1.0-beta-3</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
 
         </plugins>
 
@@ -423,7 +471,7 @@
 
     <properties>
         <xml.apis.version>1.4.01</xml.apis.version>
-        <oldxmlsec.version>2.0.7</oldxmlsec.version>
+        <oldxmlsec.version>1.5.8</oldxmlsec.version>
         <slf4j.version>1.7.21</slf4j.version>
         <xalan.version>2.7.2</xalan.version>
         <xerces.version>2.11.0</xerces.version>
@@ -433,10 +481,10 @@
         <xmlunit.version>1.6</xmlunit.version>
         <commons.codec.version>1.10</commons.codec.version>
         <woodstox.core.asl.version>4.4.1</woodstox.core.asl.version>
-        <jetty.version>9.3.9.v20160517</jetty.version>
+        <jetty.version>8.1.22.v20160922</jetty.version>
         <xmlsec.jaxb.context.class />
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <targetJdk>1.8</targetJdk>
+        <targetJdk>1.6</targetJdk>
         <clirr.version>2.7</clirr.version>
 
         <!-- Allow Clirr severity to be overriden by the command-line option -DminSeverity=level -->
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/anonymousReferenceSignature.firstReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/anonymousReferenceSignature.firstReference.txt
new file mode 100644
index 0000000..1147780
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/anonymousReferenceSignature.firstReference.txt
@@ -0,0 +1,3 @@
+<Anonymous xmlns="http://anonymous.com">

+  This XML file is referenced via an anonymous Reference in the XML signature.

+</Anonymous>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.firstReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.firstReference.txt
new file mode 100644
index 0000000..4b63b6f
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.firstReference.txt
@@ -0,0 +1 @@
+<dsig:Manifest xmlns="http://iaik.at#Envelope" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="manifest"><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>KQuoZseibY3bIurUFbyYhLCm9nY=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="../samples/sampleXMLData.xml"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>oUqpQ+ekAvoeCRjlMc1EXzrFJJA=</dsig:DigestValue></dsig:Reference></dsig:Manifest>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.manifest.firstReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.manifest.firstReference.txt
new file mode 100644
index 0000000..da8a841
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.manifest.firstReference.txt
@@ -0,0 +1,5 @@
+<Envelope xmlns="http://iaik.at#Envelope">

+  <DataItem Id="DataItem">

+    Some Data from IAIK

+  </DataItem>

+</Envelope>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.manifest.secondReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.manifest.secondReference.txt
new file mode 100644
index 0000000..c45f0c5
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/manifestReference.manifest.secondReference.txt
@@ -0,0 +1,3 @@
+<Sample xmlns="http://iaik.at#Sample"><DataItem Id="DataItem">

+    Some Data from IAIK

+  </DataItem></Sample>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.fifthReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.fifthReference.txt
new file mode 100644
index 0000000..e0545fd
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.fifthReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns="http://iaik.at#Envelope" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.fourthReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.fourthReference.txt
new file mode 100644
index 0000000..7ed4c72
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.fourthReference.txt
@@ -0,0 +1,3 @@
+<DataItem xmlns="http://iaik.at#Sample" Id="DataItem">

+    Some Data from IAIK

+  </DataItem>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.seventhReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.seventhReference.txt
new file mode 100644
index 0000000..da8a841
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.seventhReference.txt
@@ -0,0 +1,5 @@
+<Envelope xmlns="http://iaik.at#Envelope">

+  <DataItem Id="DataItem">

+    Some Data from IAIK

+  </DataItem>

+</Envelope>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.sixthReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.sixthReference.txt
new file mode 100644
index 0000000..e0545fd
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.sixthReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns="http://iaik.at#Envelope" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.thirdReference.txt b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.thirdReference.txt
new file mode 100644
index 0000000..230aff6
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/digestInputs/signatureTypesSignature.thirdReference.txt
@@ -0,0 +1,3 @@
+<DataItem xmlns="http://iaik.at#Envelope" Id="DataItem">

+    Some Data from IAIK

+  </DataItem>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/samples/anonymousReferenceContent.xml b/samples/data/at/iaik/ixsil/coreFeatures/samples/anonymousReferenceContent.xml
new file mode 100644
index 0000000..707f2af
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/samples/anonymousReferenceContent.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>

+

+<Anonymous xmlns="http://anonymous.com">

+  This XML file is referenced via an anonymous Reference in the XML signature.

+</Anonymous>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/samples/sampleTextData.txt b/samples/data/at/iaik/ixsil/coreFeatures/samples/sampleTextData.txt
new file mode 100644
index 0000000..f0074fe
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/samples/sampleTextData.txt
@@ -0,0 +1 @@
+Some text from IAIK in a file.
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/samples/sampleXMLData.xml b/samples/data/at/iaik/ixsil/coreFeatures/samples/sampleXMLData.xml
new file mode 100644
index 0000000..a109ddb
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/samples/sampleXMLData.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>

+

+<!DOCTYPE Sample

+  [

+    <!ELEMENT Sample (DataItem) >

+    <!ELEMENT DataItem (#PCDATA) >

+    <!ATTLIST DataItem Id ID #IMPLIED>

+  ]

+>

+

+<Sample xmlns="http://iaik.at#Sample">

+  <DataItem Id="DataItem">

+    Some Data from IAIK

+  </DataItem>

+</Sample>

diff --git a/samples/data/at/iaik/ixsil/coreFeatures/signatures/anonymousReferenceSignature.xml b/samples/data/at/iaik/ixsil/coreFeatures/signatures/anonymousReferenceSignature.xml
new file mode 100644
index 0000000..394d636
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/signatures/anonymousReferenceSignature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>7Hfp3yTdKKBv0d7M0ozNxCu7V98=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>mU+8/j7vFJGXG6Xw/VgVRIcRQNl5LtoHV6lHNPqrHXF6SZNQxze6lXvIv/MINnAk
+oZvVWz4sMYoddP6wXaeQJwDPjzO1EQNe2Un73J/njmzZDfIJqSah1SG+zSteMR6m
+J68nKznbRTdxnOknBo+rZirXiAsPgudRR6NUyXn+D8A=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/signatures/manifestSignature.xml b/samples/data/at/iaik/ixsil/coreFeatures/signatures/manifestSignature.xml
new file mode 100644
index 0000000..b16ae11
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/signatures/manifestSignature.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Envelope [
+    <!ATTLIST DataItem Id ID #IMPLIED>
+  ]>
+<Envelope xmlns="http://iaik.at#Envelope">
+  <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>1kF5aUeRTi9Jul2Qz3DmbZ0Od7I=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>M2bF8w1IQvdEedQ6SB9w8zaWc+KDNigoysBviNpifB6htymPhoW+1NBboygfkmAy
+8GSsOhmQ7gbpHoljjm2QPmZmo8BIt7ZGy7izhww1WZiIQxmqczIEaiPeBcsgsxDW
+SfOh7Ev9YXFfLF4UxJ59dfTR3ZTb9CVzGf6CSG4xXJk=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo><dsig:Object><dsig:Manifest Id="manifest"><dsig:Reference URI="../samples/sampleXMLData.xml"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>UXcq2OOH+aMla4fb5UOnYuaY9uQ=</dsig:DigestValue></dsig:Reference></dsig:Manifest></dsig:Object></dsig:Signature><DataItem Id="DataItem">
+    Some Data from IAIK
+  </DataItem>
+</Envelope>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/coreFeatures/signatures/signatureTypesSignature.xml b/samples/data/at/iaik/ixsil/coreFeatures/signatures/signatureTypesSignature.xml
new file mode 100644
index 0000000..8dd15a5
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/coreFeatures/signatures/signatureTypesSignature.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Envelope [
+    <!ATTLIST DataItem Id ID #IMPLIED>
+  ]>
+<Envelope xmlns="http://iaik.at#Envelope">
+  <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="http://www.w3.org/TR/2000/REC-xml-20001006"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>N2sjZsKr2W1kw6UP7mcWwrz7T5I=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="../samples/sampleTextData.txt"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>VyGBEakUjlOuKT4WBI+tDm0tYe0=</dsig:DigestValue></dsig:Reference><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><dsig:XPath xmlns:iaik="http://iaik.at#Envelope">ancestor-or-self::iaik:DataItem</dsig:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>9yMFLtkwiTVLvQaCOzE6+o4HrQE=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="../samples/sampleXMLData.xml"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><dsig:XPath xmlns:iaik="http://iaik.at#Sample">ancestor-or-self::iaik:DataItem</dsig:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>RdeNc+MfZeY8uqSLq8AtQ6DBygs=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="#objectId"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>3x8tHtIyVobZMQ7ZoBIHyiFU7Fk=</dsig:DigestValue></dsig:Reference><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><dsig:XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">ancestor-or-self::dsig:Object</dsig:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>3x8tHtIyVobZMQ7ZoBIHyiFU7Fk=</dsig:DigestValue></dsig:Reference><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>KQuoZseibY3bIurUFbyYhLCm9nY=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>gCAp0wt+ZIG3+GmZA7KKXfCA5d5Qbi7GY5BhMpxVA2BxmVe9M4vmC2h+hcBzCRmH
+wjAuaIkPYxPCaiD/SSa4i27ufMNJbbxMi8AGWPRRtgfOG+/KQZrrvUQtpnxS3c16
+81ClcivlTA1wKVM7xKJOn8li/8IldJNm1ZgN8JQS8sk=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo><dsig:Object Id="objectId">A text from IAIK</dsig:Object></dsig:Signature><DataItem Id="DataItem">
+    Some Data from IAIK
+  </DataItem>
+</Envelope>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/readme.txt b/samples/data/at/iaik/ixsil/readme.txt
new file mode 100644
index 0000000..dc4fea5
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/readme.txt
@@ -0,0 +1,201 @@
+**************************************************************
+This file contains a description of sample sigantures produced
+with the IAIK Signature Library (IXSIL).
+
+Author: Gregor Karlinger
+Date: 15. 11. 2001
+IXSIL Build: 1010
+**************************************************************
+
+signatureAlgorithms/dSASignature.xml
+------------------------------------
+
+  Simple signature using DSA as signature algorithm.
+  DSA public key is encoded as KeyValue.
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/dSASignature.firstReference.txt".
+  
+signatureAlgorithms/rSASignature.xml
+------------------------------------
+
+  Simple signature using RSA as signature algorithm.
+  RSA public key is encoded as KeyValue.
+
+  The input used for the digest computation can be found in file
+  "../digestInputs/rSASignature.firstReference.txt".
+  
+signatureAlgorithms/hMACSignature.xml
+-------------------------------------
+
+  Simple signature using HMAC as authentication algorithm.
+  The secret key is "secret".getBytes("ASCII").
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/hMACSignature.firstReference.txt".
+
+signatureAlgorithms/hMACShortSignature.xml
+------------------------------------------
+
+  Simple signature using HMAC as authentication algorithm.
+  HMAC output length is limited to 40 bits.
+  The secret key is "secret".getBytes("ASCII").
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/hMACShortSignature.firstReference.txt".
+
+coreFeatures/signatureTypesSignature.xml
+----------------------------------------
+
+  Signature containing several References to demonstrate
+  IXSIL's ability to work with enveloping, enveloped and
+  detached signatures.
+  
+  * The first Reference refers to an external source 
+    (http) - detached signature.
+  
+  * The second Reference refers to an external source
+    (file system) - detached signature. The external file
+    is "../samples/sampleTextData.txt"
+    
+  * The third Reference refers to XML data that is a 
+    sibling of the XML Signature, but within the same
+    document - detached signature
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/signatureTypesSignature.thirdReference.txt".
+    
+  * The fourth Reference refers to an external XML file
+    and uses an XPath transform to select parts of the
+    document for signing - detached signature. The external
+    file is "../samples/sampleXMLData.xml"
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/signatureTypesSignature.fourthReference.txt".
+    
+  * The fifth Reference refers to data in an Object of the
+    signature via an ID reference - enveloping signature.
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/signatureTypesSignature.fifthReference.txt".
+    
+  * The sixth Reference refers to data in an Object of the
+    signature via an empty URI (URI="") and using an XPath
+    transform to select the data for signing - enveloping
+    signature.
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/signatureTypesSignature.sixthReference.txt".
+    
+  * The seventh Reference refers to the signature document
+    itself (URI="") and uses an enveloped signature
+    transform - enveloped signature
+  
+    The input used for the digest computation can be found in file
+    "../digestInputs/signatureTypesSignature.seventhReference.txt".
+    
+coreFeatures/manifestSignature.xml
+----------------------------------
+
+  Signature containing a Reference to a Manifest element that
+  is stored in an Object container within the Signature.
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/manifestSignature.firstReference.txt".
+
+  * The first Reference in the Manifest refers to the whole
+    signature document and uses an enveloped signature trans-
+    form to cut out the Signature element.
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/manifestSignature.manifest.firstReference.txt".
+
+  * The second Reference in the Manifest refers an external
+    resource (file system). The external file is
+    "../samples/sampleXMLData.xml".
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/manifestSignature.manifest.secondReference.txt".
+
+coreFeatures/anonymousReferenceSignature.xml
+--------------------------------------------
+
+  Signature containing an anonymous Reference, i.e. the URI
+  attribute of the Reference is missing. In such a case, the
+  application must provide the hint where to find the corres-
+  ponding data. In this case, the data can be found in file
+  "../samples/anonymousReferenceContent.xml".
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/anonymousReferenceSignature.firstReference.txt".
+
+transforms/base64DecodeSignature.xml
+------------------------------------
+
+  Signature containing a Reference to a base64 encoded file.
+  The Reference contains a Base64 transform, i.e. the file
+  will be decoded prior to digest computation. The encoded
+  file is "../samples/sampleBase64EncodedData.txt".
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/base64Signature.firstReference.txt".
+
+transforms/c14nSignature.xml
+----------------------------
+
+  Signature containing two References to an XML file. The 
+  XML file is "../samples/sampleXMLData.xml".
+  
+  * The first Reference contains a canonical XML transform,
+    that is, comments in the XML file will be removed at
+    transformation.
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/c14nSignature.firstReference.txt".
+
+  * The second Reference contains a canonical XML transform
+    with comments, that is, comments in the XML file will be
+    preserved at transformation.
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/c14nSignature.secondReference.txt".
+
+transforms/envelopedSignatureSignature.xml
+------------------------------------------
+
+  Signature containing a single Reference to the signature 
+  file itself (URI=""). The Reference contains an enveloped
+  signature transform to cut out the Signature structure
+  from the XML.
+  
+  The input used for the digest computation can be found in file
+  "../digestInputs/envelopedSignatureSignature.firstReference.txt".
+
+transforms/xPathSignature.xml
+-----------------------------
+
+  Signature containing three internal References to demonstrate
+  document subset selection.
+  
+  * The first Reference contains a reference-only URI ("#objectId").
+    This means that the XML element with its ID attribute set to the
+    value "objectId" is selected; comments will be suppressed.
+    Finally a canonical XML transfrom will be performed prior to
+    digest computation.
+    
+    The input used for the digest computation can be found in file
+    "../digestInputs/xPathSignature.firstReference.txt".
+
+  * The second Reference also contains a reference-only URI 
+    ("#xpointer(id('objectId'))"). This also means that the XML 
+    element with its ID attribute set to the value "objectId"
+    is selected; but contrary to the first Reference, this time
+    comments are preserved. Finally a canonical XML transfrom
+    (preserving comments option chosen) will be performed prior to
+    digest computation.
+
+    The input used for the digest computation can be found in file
+    "../digestInputs/xPathSignature.secondReference.txt".
+
+    
+    
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/dSASignature.firstReference.txt b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/dSASignature.firstReference.txt
new file mode 100644
index 0000000..5089f32
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/dSASignature.firstReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="object">Some text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/hMACShortSignature.firstReference.txt b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/hMACShortSignature.firstReference.txt
new file mode 100644
index 0000000..5089f32
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/hMACShortSignature.firstReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="object">Some text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/hMACSignature.firstReference.txt b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/hMACSignature.firstReference.txt
new file mode 100644
index 0000000..5089f32
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/hMACSignature.firstReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="object">Some text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/rSASignature.firstReference.txt b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/rSASignature.firstReference.txt
new file mode 100644
index 0000000..5089f32
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/digestInputs/rSASignature.firstReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="object">Some text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/dSASignature.xml b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/dSASignature.xml
new file mode 100644
index 0000000..9e554c9
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/dSASignature.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/><dsig:Reference URI="#object"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>3RGQeH5eHK+jJ2GxGYPhwnzbBBc=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>WrfXueeZRTbdpxe3Sam+YDQWvxzragcMRH0SdiL+1zFCPQXn3NdaEA==</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:DSAKeyValue><dsig:P>gn3UnKIFaYTpg3GxNA1dcYOShbJayqOC16w4bpRAhD8KRnqodajByjtwumqXBxL2
+sZntPuxTE/OUCme71p84cilhqwI9F6EzPFIjXZ+30Q6V46Ve+bBPx8kgxXLaesPV
+DyQNu45U2p67cCERxTWC5TWFLp9ZOXmzMlDIhoOWGRc=</dsig:P><dsig:Q>+lB52vo/OrHoCm31vRbyJNj41xs=</dsig:Q><dsig:G>T731LjME8FHBfKVck4G1wX1MIFB2hTRQz9n8crLhsrFvoBBIuP8X56kK4eAYBT40
+2dVh33FMyNySsVG132ZZcGteV8MZotZYO30y0unh8WY+qqxGDc1OZ3A29/m+Cy4W
+oF1pXVuBE6kDyzhjVhq9NkpdbBVmF/oQoyCZ4dI0dxM=</dsig:G><dsig:Y>MBVHib7T0JW8iPaZT++R/2zuoc5SbalCbTHjJDMLe/GWMKzGS8s+FEJldQmZC1R+
+r6jIfAY+wjl3k+UTxRTCjqtM34wEBNvvgVHt95AOgBy/Mam9XKqx/dYLlK0jCk7T
+o/rfWtjhG2BbsJdI6r+68SM0OEBqL5bbYRxRGeWj/P0=</dsig:Y></dsig:DSAKeyValue></dsig:KeyValue></dsig:KeyInfo><dsig:Object Id="object">Some text from IAIK</dsig:Object></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/hMACShortSignature.xml b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/hMACShortSignature.xml
new file mode 100644
index 0000000..b1e0ba4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/hMACShortSignature.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"><dsig:HMACOutputLength>40</dsig:HMACOutputLength></dsig:SignatureMethod><dsig:Reference URI="#object"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>3RGQeH5eHK+jJ2GxGYPhwnzbBBc=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>Cx+HU+8=</dsig:SignatureValue><dsig:Object Id="object">Some text from IAIK</dsig:Object></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/hMACSignature.xml b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/hMACSignature.xml
new file mode 100644
index 0000000..89f6bfc
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/hMACSignature.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"><dsig:HMACOutputLength>160</dsig:HMACOutputLength></dsig:SignatureMethod><dsig:Reference URI="#object"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>3RGQeH5eHK+jJ2GxGYPhwnzbBBc=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>r7UpaFBMK5q7i0H3toGvAeFJLs0=</dsig:SignatureValue><dsig:Object Id="object">Some text from IAIK</dsig:Object></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/rSASignature.xml b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/rSASignature.xml
new file mode 100644
index 0000000..28c384a
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/signatureAlgorithms/signatures/rSASignature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="#object"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>3RGQeH5eHK+jJ2GxGYPhwnzbBBc=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>JbrOi+nMW2K3YyckOpGrmm3UaEfWALq1tuN5WJO018g+Rwteu5wt+Veni3xjZTw8
+755M8vGm7QSxnKTMnTHpH+fgMFPXpP3AcnB8CQgu31GV4L+hpslcqnOeMSQj/Wbd
+BX8TfB1Mcl8eP9P9SgomDRSB+gWTaDnsHL6qdK8lUmE=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo><dsig:Object Id="object">Some text from IAIK</dsig:Object></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/base64Signature.firstReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/base64Signature.firstReference.txt
new file mode 100644
index 0000000..196c4d4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/base64Signature.firstReference.txt
@@ -0,0 +1,341 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

+<html>

+<head>

+<title>Associating Style Sheets with XML documents</title>

+<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-REC">

+<style type="text/css">code { font-family: monospace }</style>

+</head>

+<body>

+<div class="head">

+<a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/WWW/w3c_home" alt="W3C" height="48" width="72"></a>

+<h1>Associating Style Sheets with XML documents<br>Version 1.0</h1>

+<h2>W3C Recommendation 29 June 1999</h2>

+<dl>

+<dt>This version:</dt>

+<dd>

+<a href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629">http://www.w3.org/1999/06/REC-xml-stylesheet-19990629</a>

+<br>

+</dd>

+<dt>Latest version:</dt>

+<dd>

+<a href="http://www.w3.org/TR/xml-stylesheet">http://www.w3.org/TR/xml-stylesheet</a>

+<br>

+</dd>

+<dt>Previous version:</dt>

+<dd>

+<a href="http://www.w3.org/TR/1999/xml-stylesheet-19990428">http://www.w3.org/TR/1999/xml-stylesheet-19990428</a>

+<br>

+</dd>

+<dt>Editor:</dt>

+<dd>

+

+James Clark

+<a href="mailto:jjc@jclark.com">&lt;jjc@jclark.com&gt;</a>

+<br>

+</dd>

+</dl>

+<p class="copyright">

+<a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Copyright">

+    Copyright</a> &nbsp;&copy;&nbsp; 1999 <a href="http://www.w3.org">W3C</a>

+    (<a href="http://www.lcs.mit.edu">MIT</a>,

+    <a href="http://www.inria.fr/">INRIA</a>,

+    <a href="http://www.keio.ac.jp/">Keio</a> ), All Rights Reserved. W3C

+    <a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Legal Disclaimer">liability,</a><a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#W3C Trademarks">trademark</a>,

+    <a href="http://www.w3.org/Consortium/Legal/copyright-documents.html">document use </a>and

+    <a href="http://www.w3.org/Consortium/Legal/copyright-software.html">software licensing </a>rules apply.

+  </p>

+<hr title="Separator for header">

+</div>

+<h2>

+<a name="abstract">Abstract</a>

+</h2>

+

+<p>This document allows a style sheet to be associated with an XML

+document by including one or more processing instructions with a

+target of <code>xml-stylesheet</code> in the document's prolog.</p>

+

+<h2>

+<a name="status">Status of this document</a>

+</h2>

+

+<p>This document has been reviewed by W3C Members and other interested

+parties and has been endorsed by the Director as a W3C <a href="http://www.w3.org/Consortium/Process/#RecsW3C">Recommendation</a>. It

+is a stable document and may be used as reference material or cited as

+a normative reference from other documents. W3C's role in making the

+Recommendation is to draw attention to the specification and to

+promote its widespread deployment. This enhances the functionality and

+interoperability of the Web.</p>

+

+<p>The list of known errors in this specifications is available at

+<a href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/errata">http://www.w3.org/TR/1999/xml-stylesheet-19990629/errata</a>.</p>

+

+<p>Comments on this specification may be sent to &lt;<a href="mailto:www-xml-stylesheet-comments@w3.org">www-xml-stylesheet-comments@w3.org</a>&gt;. The archive of public

+comments is available at <a href="http://www.w3.org/Archives/Public/www-xml-stylesheet-comments">http://w3.org/Archives/Public/www-xml-stylesheet-comments</a>.</p>

+

+<p>A list of current W3C Recommendations and other technical documents

+can be found at <a href="http://www.w3.org/TR">http://www.w3.org/TR</a>.</p>

+

+<p>The Working Group expects additional mechanisms for linking style

+sheets to XML document to be defined in a future specification.</p>

+

+<p>The use of XML processing instructions in this specification should

+not be taken as a precedent.  The W3C does not anticipate recommending

+the use of processing instructions in any future specification.  The

+<a href="#rationale">Rationale</a> explains why they were used in

+this specification.</p>

+

+<p>This document was produced as part of the <a href="http://www.w3.org/XML/Activity">W3C XML Activity</a>.</p>

+

+

+<h2>

+<a name="contents">Table of contents</a>

+</h2>1 <a href="#The xml-stylesheet processing instruction">The xml-stylesheet processing instruction</a>

+<br>

+<h3>Appendices</h3>A <a href="#References">References</a>

+<br>B <a href="#rationale">Rationale</a>

+<br>

+<hr>

+

+<h2>

+<a name="The xml-stylesheet processing instruction"></a>1 The <code>xml-stylesheet</code> processing instruction</h2>

+

+<p>Style Sheets can be associated with an XML<a href="#XML">[XML10]</a>

+document by using a processing instruction whose target is

+<code>xml-stylesheet</code>.  This processing instruction follows the

+behaviour of the HTML 4.0 <code>&lt;LINK

+REL="stylesheet"&gt;</code><a href="#HTML">[HTML40]</a>.</p>

+

+<p>The <code>xml-stylesheet</code> processing instruction is parsed in

+the same way as a start-tag, with the exception that entities other

+than predefined entities must not be referenced.</p>

+

+<p>The following grammar is given using the same notation as the

+grammar in the XML Recommendation<a href="#XML">[XML10]</a>.  Symbols in the

+grammar that are not defined here are defined in the XML

+Recommendation.</p>

+

+<h5>xml-stylesheet processing instruction</h5>

+<table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td>

+<a name="NT-StyleSheetPI"></a>[1]&nbsp;&nbsp;&nbsp;</td>

+<td>StyleSheetPI</td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td>'&lt;?xml-stylesheet' (<a href="http://www.w3.org/TR/REC-xml#NT-S">S</a> <a href="#NT-PseudoAtt">PseudoAtt</a>)* <a href="http://www.w3.org/TR/REC-xml#NT-S">S</a>? '?&gt;'</td>

+<td>

+</td>

+</tr>

+<tr valign="baseline">

+<td>

+<a name="NT-PseudoAtt"></a>[2]&nbsp;&nbsp;&nbsp;</td>

+<td>PseudoAtt</td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td>

+<a href="http://www.w3.org/TR/REC-xml#NT-Name">Name</a> <a href="http://www.w3.org/TR/REC-xml#NT-S">S</a>? '=' <a href="http://www.w3.org/TR/REC-xml#NT-S">S</a>? <a href="#NT-PseudoAttValue">PseudoAttValue</a>

+</td>

+<td>

+</td>

+</tr>

+<tr valign="baseline">

+<td>

+<a name="NT-PseudoAttValue"></a>[3]&nbsp;&nbsp;&nbsp;</td>

+<td>PseudoAttValue</td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td>('"' ([^"&lt;&amp;] | <a href="http://www.w3.org/TR/REC-xml#NT-CharRef">CharRef</a> | <a href="#NT-PredefEntityRef">PredefEntityRef</a>)* '"'</td>

+<td>

+</td>

+</tr>

+<tr valign="baseline">

+<td>

+</td>

+<td>

+</td>

+<td>

+</td>

+<td>| "'" ([^'&lt;&amp;] | <a href="http://www.w3.org/TR/REC-xml#NT-CharRef">CharRef</a> | <a href="#NT-PredefEntityRef">PredefEntityRef</a>)* "'")</td>

+<td>

+</td>

+</tr>

+<tr valign="baseline">

+<td>

+</td>

+<td>

+</td>

+<td>

+</td>

+<td>- (<a href="http://www.w3.org/TR/REC-xml#NT-Char">Char</a>* '?&gt;' <a href="http://www.w3.org/TR/REC-xml#NT-Char">Char</a>*)</td>

+<td>

+</td>

+</tr>

+<tr valign="baseline">

+<td>

+<a name="NT-PredefEntityRef"></a>[4]&nbsp;&nbsp;&nbsp;</td>

+<td>PredefEntityRef</td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td>'&amp;amp;' | '&amp;lt;' | '&amp;gt;' | '&amp;quot;' | '&amp;apos;'</td>

+<td>

+</td>

+</tr>

+</tbody>

+</table>

+

+<p>In <a href="#NT-PseudoAttValue">PseudoAttValue</a>, a <a href="http://www.w3.org/TR/REC-xml#NT-CharRef">CharRef</a> or a <a href="#NT-PredefEntityRef">PredefEntityRef</a> is interpreted in the

+same manner as in a normal XML attribute value.  The actual value of

+the pseudo-attribute is the value after each reference is replaced by

+the character it references.  This replacement is not performed

+automatically by an XML processor.</p>

+

+<p>The <code>xml-stylesheet</code> processing instruction is allowed

+only in the prolog of an XML document. The syntax of XML constrains

+where processing instructions are allowed in the prolog; the

+<code>xml-stylesheet</code> processing instruction is allowed anywhere

+in the prolog that meets these constraints.</p>

+

+<blockquote>

+<b>NOTE: </b>If the <code>xml-stylesheet</code> processing instruction

+occurs in the external DTD subset or in a parameter entity, it is

+possible that it may not be processed by a non-validating XML

+processor (see <a href="#XML">[XML10]</a>).</blockquote>

+

+<p>The following pseudo attributes are defined</p>

+

+<pre>href CDATA #REQUIRED

+type CDATA #REQUIRED

+title CDATA #IMPLIED

+media CDATA #IMPLIED

+charset CDATA #IMPLIED

+alternate (yes|no) "no"</pre>

+

+<p>The semantics of the pseudo-attributes are exactly as with

+<code>&lt;LINK REL="stylesheet"&gt;</code> in HTML 4.0, with the

+exception of the <code>alternate</code> pseudo-attribute.  If

+<code>alternate="yes"</code> is specified, then the processing

+instruction has the semantics of <code>&lt;LINK REL="alternate

+stylesheet"&gt;</code> instead of <code>&lt;LINK

+REL="stylesheet"&gt;</code>.</p>

+

+<blockquote>

+<b>NOTE: </b>Since the value of the <code>href</code> attribute is a URI

+reference, it may be a relative URI and it may contain a fragment

+identifier. In particular the URI reference may contain only a

+fragment identifier.  Such a URI reference is a reference to a part of

+the document containing the <code>xml-stylesheet</code> processing

+instruction (see <a href="#RFC2396">[RFC2396]</a>). The consequence is that the

+<code>xml-stylesheet</code> processing instruction allows style sheets

+to be embedded in the same document as the <code>xml-stylesheet</code>

+processing instruction.</blockquote>

+

+<p>In some cases, style sheets may be linked with an XML document by

+means external to the document. For example, earlier versions of HTTP

+<a href="#RFC2068">[RFC2068]</a> (section 19.6.2.4) allowed style sheets to be

+associated with XML documents by means of the <code>Link</code>

+header.  Any links to style sheets that are specified externally to the

+document are considered to occur before the links specified by the

+<code>xml-stylesheet</code> processing instructions.  This is the same

+as in HTML 4.0 (see <a href="http://www.w3.org/TR/REC-html40/present/styles.html#h-14.6">section

+14.6</a>).</p>

+

+<p>Here are some examples from HTML 4.0 with the corresponding

+processing instruction:</p>

+

+<pre>&lt;LINK href="mystyle.css" rel="style sheet" type="text/css"&gt;

+&lt;?xml-stylesheet href="mystyle.css" type="text/css"?&gt;

+

+&lt;LINK href="mystyle.css" title="Compact" rel="stylesheet"

+type="text/css"&gt;

+&lt;?xml-stylesheet href="mystyle.css" title="Compact" type="text/css"?&gt;

+

+&lt;LINK href="mystyle.css" title="Medium" rel="alternate stylesheet"

+type="text/css"&gt;

+&lt;?xml-stylesheet alternate="yes" href="mystyle.css" title="Medium"

+type="text/css"?&gt;</pre>

+

+<p>Multiple <code>xml-stylesheet</code> processing instructions are

+also allowed with exactly the same semantics as with <code>LINK

+REL="stylesheet"</code>. For example,</p>

+

+<pre>&lt;LINK rel="alternate stylesheet" title="compact" href="small-base.css"

+type="text/css"&gt;

+&lt;LINK rel="alternate stylesheet" title="compact" href="small-extras.css"

+type="text/css"&gt;

+&lt;LINK rel="alternate stylesheet" title="big print" href="bigprint.css"

+type="text/css"&gt;

+&lt;LINK rel="stylesheet" href="common.css" type="text/css"&gt;</pre>

+

+<p>would be equivalent to:</p>

+

+<pre>&lt;?xml-stylesheet alternate="yes" title="compact" href="small-base.css"

+type="text/css"?&gt;

+&lt;?xml-stylesheet alternate="yes" title="compact" href="small-extras.css"

+type="text/css"?&gt;

+&lt;?xml-stylesheet alternate="yes" title="big print" href="bigprint.css"

+type="text/css"?&gt;

+&lt;?xml-stylesheet href="common.css" type="text/css"?&gt;</pre>

+

+

+

+<hr title="Separator from footer">

+

+<h2>

+<a name="References"></a>A References</h2>

+

+<dl>

+

+<dt>

+<a name="HTML">HTML40</a>

+</dt>

+<dd>World Wide Web

+Consortium. <i>HTML 4.0 Specification.</i> W3C Recommendation. See

+<a href="http://www.w3.org/TR/REC-html40">http://www.w3.org/TR/REC-html40</a>

+</dd>

+

+<dt>

+<a name="RFC2068">RFC2068</a>

+</dt>

+<dd>R. Fielding, J. Gettys, J. Mogul,

+H. Frystyk Nielsen, and T. Berners-Lee.  <i>Hypertext Transfer

+Protocol -- HTTP/1.1.</i>. IETF RFC 2068. See <a href="http://www.ietf.org/rfc/rfc2068.txt">http://www.ietf.org/rfc/rfc2068.txt</a>.</dd>

+

+<dt>

+<a name="RFC2396">RFC2396</a>

+</dt>

+<dd>T. Berners-Lee, R. Fielding, and

+L. Masinter.  <i>Uniform Resource Identifiers (URI): Generic

+Syntax</i>. IETF RFC 2396. See <a href="http://www.ietf.org/rfc/rfc2396.txt">http://www.ietf.org/rfc/rfc2396.txt</a>.</dd>

+

+<dt>

+<a name="XML">XML10</a>

+</dt>

+<dd>World Wide Web Consortium. <i>Extensible

+Markup Language (XML) 1.0.</i> W3C Recommendation. See <a href="http://www.w3.org/TR/1998/REC-xml-19980210">http://www.w3.org/TR/1998/REC-xml-19980210</a>

+</dd>

+

+</dl>

+

+

+

+

+<h2>

+<a name="rationale"></a>B Rationale</h2>

+

+<p>There was an urgent requirement for a specification for style sheet

+linking that could be completed in time for the next release from

+major browser vendors.  Only by choosing a simple mechanism closely

+based on a proven existing mechanism could the specification be

+completed in time to meet this requirement.</p>

+

+<p>Use of a processing instruction avoids polluting the main document

+structure with application specific processing information.</p>

+

+<p>The mechanism chosen for this version of the specification is not a

+constraint on the additional mechanisms planned for future versions.

+There is no expectation that these will use processing instructions;

+indeed they may not include the linking information in the source

+document.</p>

+

+

+

+

+</body>

+</html>

diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/c14NSignature.firstReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/c14NSignature.firstReference.txt
new file mode 100644
index 0000000..227159f
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/c14NSignature.firstReference.txt
@@ -0,0 +1,4 @@
+<?xml-stylesheet href="doc.xsl"

+   type="text/xsl"   ?>

+<doc>Hello, world!</doc>

+<?pi-without-data?>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/c14NSignature.secondReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/c14NSignature.secondReference.txt
new file mode 100644
index 0000000..a0b0c46
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/c14NSignature.secondReference.txt
@@ -0,0 +1,6 @@
+<?xml-stylesheet href="doc.xsl"

+   type="text/xsl"   ?>

+<doc>Hello, world!<!-- Comment 1 --></doc>

+<?pi-without-data?>

+<!-- Comment 2 -->

+<!-- Comment 3 -->
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/envelopedSignatureSignature.firstReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/envelopedSignatureSignature.firstReference.txt
new file mode 100644
index 0000000..3bde443
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/envelopedSignatureSignature.firstReference.txt
@@ -0,0 +1,5 @@
+<Envelope xmlns="http://iaik.at#Envelope">

+  <DataItem>

+    Some Data from IAIK

+  </DataItem>

+</Envelope>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.firstReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.firstReference.txt
new file mode 100644
index 0000000..d660df4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.firstReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.secondReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.secondReference.txt
new file mode 100644
index 0000000..3592529
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.secondReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId"><!--A comment from IAIK-->A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.thirdReference.txt b/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.thirdReference.txt
new file mode 100644
index 0000000..d660df4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/digestInputs/xPathSignature.thirdReference.txt
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/samples/sampleBase64EncodedData.txt b/samples/data/at/iaik/ixsil/transforms/samples/sampleBase64EncodedData.txt
new file mode 100644
index 0000000..1efa071
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/samples/sampleBase64EncodedData.txt
Binary files differ
diff --git a/samples/data/at/iaik/ixsil/transforms/samples/sampleXMLData.xml b/samples/data/at/iaik/ixsil/transforms/samples/sampleXMLData.xml
new file mode 100644
index 0000000..c2126d8
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/samples/sampleXMLData.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+
+<?xml-stylesheet   href="doc.xsl"
+   type="text/xsl"   ?>
+
+<doc>Hello, world!<!-- Comment 1 --></doc>
+
+<?pi-without-data     ?>
+
+<!-- Comment 2 -->
+
+<!-- Comment 3 -->
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/base64DecodeSignature.xml b/samples/data/at/iaik/ixsil/transforms/signatures/base64DecodeSignature.xml
new file mode 100644
index 0000000..c53e989
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/base64DecodeSignature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="../samples/sampleBase64EncodedData.txt"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>CFDfVk22iawglDdrEIygmWhpPrj0DyWnxLhPBSgHXp6i31oVbicHAOvThv7TyVKd
+eE6K2b5AKOErBwVncngMBmpwtJIoKOgUhgNe4DskfeSdk44OJkT63h0EJxJhUHqz
+NtBe7QrmynpbFnOedDDZwMA9/I8RU0Eq/jikz9nqNdU=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/c14nSignature.xml b/samples/data/at/iaik/ixsil/transforms/signatures/c14nSignature.xml
new file mode 100644
index 0000000..8d0c0cb
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/c14nSignature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="../samples/sampleXMLData.xml"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>R8S/QfGgzSmfIg0qpQthdjJQGuk=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="../samples/sampleXMLData.xml"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>IGE++R3JwgZ17hxfT3VoGmvNBjU=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>cmn28RkAxN5587v+EPof2okKiUkJivh0wKNHK9FuhbA+xUBWsucUFXrNCrug57s4
+xQFsQtXjVKPn+LGehnhvxZqd0MEK0GLndRk2dKogbtX/tc55BsyT1jRDGpeIxqNR
+OnwTleWlp9tMenLPPsa3vMrzXXUqup2A/J7/mZaNnUY=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/envelopedSignatureSignature.xml b/samples/data/at/iaik/ixsil/transforms/signatures/envelopedSignatureSignature.xml
new file mode 100644
index 0000000..aa24b06
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/envelopedSignatureSignature.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="http://iaik.at#Envelope">
+  <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>cWFVogsTJUrmoCbGrFoP2mE+F5U=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>l82qilvUhkstzFG8tjTY/DAlWmhMTPz6fhnaIM6qetH9/qagjtrceEwGnc8Q7G20
+laxPg+tjXa9qSHB9wUmOgu5axN3oNsncZxukCi7pmmujflMsXfJKl7jTXweYyKU5
+5tJgeJM3Mnjm4QiAE1X9Ftne4UKFFg4348RUWnlZWBE=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo></dsig:Signature><DataItem>
+    Some Data from IAIK
+  </DataItem>
+</Envelope>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml
new file mode 100644
index 0000000..c3c28b4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="#objectId"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>Xg7huUaHvGjhk11T6cBa5jKiCAM=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="#xpointer(id(&apos;objectId&apos;))"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>a1YkQDH/XGdccOaiyxOrP6AQBeM=</dsig:DigestValue></dsig:Reference><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><dsig:XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">ancestor-or-self::dsig:Object</dsig:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>Xg7huUaHvGjhk11T6cBa5jKiCAM=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>dRM9axVQYPMd0vfzkbstaG8taNTtJA9sF9ze3/xW6AeW9KCguIjHpmG2kAuDJheZ
+RXRO9et+whWzrX8daHchUu6RDbkkL5tOBcMnyKJiPD03NRxut7AWtkFKLhhxzRds
++EA7X0uNf59UIanLlMiGh3+ROzctwyO0z8vbKqjGxYU=</dsig:SignatureValue><dsig:KeyInfo><dsig:KeyValue><dsig:RSAKeyValue><dsig:Modulus>sDa5yzUv4IJmBY60GZCnkQSAhpG7tgxepi6sj3DlCzxjTtO5MNrjI9sK3WhimpNi
+NDmagzNEjxP3+x1huxL19GoIxZgr5O7E/F2IInSASVZTQsvWZlNauhRs0KZAszIS
+FchvrihILLoUf4tzaOSe6jgMEq6IkO0dWVpcFpAjXTc=</dsig:Modulus><dsig:Exponent>Aw==</dsig:Exponent></dsig:RSAKeyValue></dsig:KeyValue></dsig:KeyInfo><dsig:Object Id="objectId"><!--A comment from IAIK-->A text from IAIK</dsig:Object></dsig:Signature>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.0.input b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.0.input
new file mode 100644
index 0000000..d660df4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.0.input
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.1.input b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.1.input
new file mode 100644
index 0000000..3592529
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.1.input
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId"><!--A comment from IAIK-->A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.2.input b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.2.input
new file mode 100644
index 0000000..d660df4
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.2.input
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="objectId">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.3.input b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.3.input
new file mode 100644
index 0000000..5cde06d
--- /dev/null
+++ b/samples/data/at/iaik/ixsil/transforms/signatures/xPathSignature.xml.3.input
@@ -0,0 +1 @@
+<dsig:Object xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">A text from IAIK</dsig:Object>
\ No newline at end of file
diff --git a/samples/data/com/pothole/xmldsig/xml-stylesheet.txt b/samples/data/com/pothole/xmldsig/xml-stylesheet.txt
new file mode 100644
index 0000000..1efa071
--- /dev/null
+++ b/samples/data/com/pothole/xmldsig/xml-stylesheet.txt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/Readme.txt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/Readme.txt
new file mode 100644
index 0000000..6f06b13
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/Readme.txt
@@ -0,0 +1,37 @@
+Example Signatures[1]
+
+[1] http://www.w3.org/Signature/Drafts/xmldsig-core/Overview.html
+
+This is an exercise over some key information types, interop
+of which is required for certain standardisation processes.
+
+. signature-keyname.xml
+. signature-retrievalmethod-rawx509crt.xml
+. signature-x509-crt-crl.xml
+. signature-x509-crt.xml
+. signature-x509-is.xml
+. signature-x509-ski.xml
+. signature-x509-sn.xml
+. certs/*.crt
+
+To resolve the key associated with the KeyName in `signature-keyname.xml'
+you must perform a cunning transformation from the name `Xxx' to the
+certificate that resides in the directory `certs/' that has a subject name
+containing the common name `Xxx'. The transformation from this key name to
+the filename under which the certificate is stored `certs/xxx.crt' is a
+trade secret encryption process, the circumvention of which may expose
+you to civil and criminal prosecution under the DMCA and other applicable
+laws.
+
+To resolve the key associated with the X509Data in `signature-x509-is.xml',
+`signature-x509-ski.xml' and `signature-x509-sn.xml' you need to resolve
+the identified certificate from those in the `certs' directory.
+
+In `signature-x509-crt-crl.xml' an X.509 CRL is present which has revoked
+the X.509 certificate used for signing. So verification should be
+qualified.
+
+Merlin Hughes <merlin@baltimore.ie>
+Baltimore Technologies, Ltd.
+
+Tuesday, May 15, 2001
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/badb.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/badb.crt
new file mode 100644
index 0000000..e51df2d
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/badb.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/balor.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/balor.crt
new file mode 100644
index 0000000..05cccd9
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/balor.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/bres.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/bres.crt
new file mode 100644
index 0000000..e386885
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/bres.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/lugh.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/lugh.crt
new file mode 100644
index 0000000..bb955d9
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/lugh.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/macha.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/macha.crt
new file mode 100644
index 0000000..bc57061
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/macha.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/morigu.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/morigu.crt
new file mode 100644
index 0000000..a2b2757
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/morigu.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/nemain.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/nemain.crt
new file mode 100644
index 0000000..1360597
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/nemain.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/nocertifiacte.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/nocertifiacte.crt
new file mode 100644
index 0000000..6f06b13
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs/nocertifiacte.crt
@@ -0,0 +1,37 @@
+Example Signatures[1]
+
+[1] http://www.w3.org/Signature/Drafts/xmldsig-core/Overview.html
+
+This is an exercise over some key information types, interop
+of which is required for certain standardisation processes.
+
+. signature-keyname.xml
+. signature-retrievalmethod-rawx509crt.xml
+. signature-x509-crt-crl.xml
+. signature-x509-crt.xml
+. signature-x509-is.xml
+. signature-x509-ski.xml
+. signature-x509-sn.xml
+. certs/*.crt
+
+To resolve the key associated with the KeyName in `signature-keyname.xml'
+you must perform a cunning transformation from the name `Xxx' to the
+certificate that resides in the directory `certs/' that has a subject name
+containing the common name `Xxx'. The transformation from this key name to
+the filename under which the certificate is stored `certs/xxx.crt' is a
+trade secret encryption process, the circumvention of which may expose
+you to civil and criminal prosecution under the DMCA and other applicable
+laws.
+
+To resolve the key associated with the X509Data in `signature-x509-is.xml',
+`signature-x509-ski.xml' and `signature-x509-sn.xml' you need to resolve
+the identified certificate from those in the `certs' directory.
+
+In `signature-x509-crt-crl.xml' an X.509 CRL is present which has revoked
+the X.509 certificate used for signing. So verification should be
+qualified.
+
+Merlin Hughes <merlin@baltimore.ie>
+Baltimore Technologies, Ltd.
+
+Tuesday, May 15, 2001
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-keyname.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-keyname.xml
new file mode 100644
index 0000000..76f7731
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-keyname.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    KTe1H5Hjp8hwahNFoUqHDuPJNNqhS1U3BBBH5/gByItNIwV18nMiLq4KunzFnOqD
+    xzTuO0/T+wsoYC1xOEuCDxyIujNCaJfLh+rCi5THulnc8KSHHEoPQ+7fA1VjmO31
+    2iw1iENOi7m//wzKlIHuxZCJ5nvolT21PV6nSE4DHlA=
+  </SignatureValue>
+  <KeyInfo>
+    <KeyName>Lugh</KeyName>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-retrievalmethod-rawx509crt.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-retrievalmethod-rawx509crt.xml
new file mode 100644
index 0000000..633c170
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-retrievalmethod-rawx509crt.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    FnwsSCWT6REW/8QnOjv0BK+r3Ly/4aB++pNnZp9pnz8f7+j33eKSj1soyQLq5zmN
+    FwyeeQhnlTbR1kfve014ub9uHVC9A1cfmGZxQF1DC+enHt+AAPJaa278/ocgpMb5
+    Gibl4w7e3HAdBn/RJCrFJH77wY2oU5Ob0zIQtECVNJk=
+  </SignatureValue>
+  <KeyInfo>
+    <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#rawX509Certificate" URI="certs/balor.crt" />
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-crt-crl.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-crt-crl.xml
new file mode 100644
index 0000000..4487751
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-crt-crl.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    DrNVqKOilPswEwCilZ3EkjFyQof5BJAbAdi2I8qZuJAsL7d180nWe/xPAURHC6IR
+    t2xJkNgCxrgdpy9//2UzaeE65URi2THgbPW1fhrp6dVeJyhiq9YfJ0Ofn7oeADkt
+    kd3jZipUUG7UGQ0oz3bMaZ6OaGYLkygnUXWh5EHpg4A=
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509Certificate>
+        MIICwTCCAiqgAwIBAgIGAOZ75aCZMA0GCSqGSIb3DQEBBQUAMG4xCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMRQwEgYDVQQDEwtYL1NlY3Vy
+        ZSBDQTAeFw0wMTA1MTUxMDA1MjRaFw0wMjA1MTUxMDA0MzdaMGcxCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ0wCwYDVQQDEwRCcmVzMIGf
+        MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAQtREqcPJkeGXcCORs/SwcHLh9ySw
+        tQNTUvTQm54hBLbTLhJQ20NJf46Z4YSNoaI7IT4x8fiv+JZLNrQc2ISGZBibMVZ4
+        4ZvSWYls7d9QurRltvQ2oCqDhUMSXcGY3HJmeEzITIfdh6bIuSQ0sDAXNygVhGr/
+        vVaUOyxr1AoutQIDAQABo3EwbzAOBgNVHQ8BAf8EBAMCB4AwEQYDVR0OBAoECIz2
+        q1W6c2KTMDUGA1UdEgQuMCyGKmh0dHA6Ly93d3cuYmFsdGltb3JlLmNvbS9wcm9k
+        dWN0cy94c2VjdXJlLzATBgNVHSMEDDAKgAiF7B8Kj38a0TANBgkqhkiG9w0BAQUF
+        AAOBgQAzFhnxji5+UdJ6tbfRKTfhQG0JWrWiQRy0N3lrAXQnpQBFjOjtRPRiR5ST
+        vRQbRNrGljegIpoFFK12Uj9BxP6x+uZUqzKDfFqWEN0s9Y9YQdkl+DN9jZZwgK6N
+        KYGqh43HIoPKGb1UQ93tTGW+F4ygNxHluvO1Ovtku8aPBn4idQ==
+      </X509Certificate>
+    </X509Data>
+    <X509Data>
+      <X509CRL>
+        MIIBdjCB4AIBATANBgkqhkiG9w0BAQUFADBuMQswCQYDVQQGEwJJRTEPMA0GA1UE
+        CBMGRHVibGluMSUwIwYDVQQKExxCYWx0aW1vcmUgVGVjaG5vbG9naWVzLCBMdGQu
+        MREwDwYDVQQLEwhYL1NlY3VyZTEUMBIGA1UEAxMLWC9TZWN1cmUgQ0EXDTAxMDUx
+        NTEwNDUwMFoXDTAxMDkyMDEwNDUwMFowGTAXAgYA5nvloJkXDTAxMDUxNTEwNDUw
+        MFqgIzAhMAoGA1UdFAQDAgEAMBMGA1UdIwQMMAqACIXsHwqPfxrRMA0GCSqGSIb3
+        DQEBBQUAA4GBADVPiyJ4Q+Kr3B/GGmh/KbVtSPv5x1zffGxp1XwV5cVOmksVrKNx
+        rCw86K0ZLxVgy1rIql8+i1b9u3Ozuo6VhU0el/NF2Tto2jAyy0j+PPK2Xv1/ATQx
+        J2PK+Ty9vkm+7jjurfeJVvAC8D+WFBAh/JWIzmMXA8cMBfTFBRPhZQao
+      </X509CRL>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-crt.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-crt.xml
new file mode 100644
index 0000000..c811820
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-crt.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    ZrROxIcOSBvt5z2krEhQGSVIo4oAwTJwGAoFiWucvvEtY9k0L2R5RVHBnHCzk5GT
+    kHGaT8SUqtnDeiH6W/2FNfciiV/w1pxURvNcyW8cYCn1B5XF68vILXUaptWf0DKw
+    DvCFS+uLh0ACuEUfpe1Dx1fwB85lpK2iQcpx9dPaC4M=
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509Certificate>
+        MIICwzCCAiygAwIBAgIGAOZ75QhHMA0GCSqGSIb3DQEBBQUAMG4xCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMRQwEgYDVQQDEwtYL1NlY3Vy
+        ZSBDQTAeFw0wMTA1MTUxMDA0NDVaFw0wMjA1MTUxMDA0MzdaMGkxCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ8wDQYDVQQDEwZNb3JpZ3Uw
+        gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALT4FJkxu+bB5lOwYa+irIb7sJU7
+        9sRQbYYnfw35D7NQkig+Lvi2LXXoA6ABull2bF+gu+sgRzezzOs6VsTL8z57TIz2
+        48HaMInFjOiqSANmzQKlXv1PjXSxSyHRi/3xc8gMfmCxeSPCZ5VpUiQoJ5ZpWcDz
+        /LKvb0l9X0YBzMZlAgMBAAGjcTBvMA4GA1UdDwEB/wQEAwIHgDARBgNVHQ4ECgQI
+        hbis35lIcu8wNQYDVR0SBC4wLIYqaHR0cDovL3d3dy5iYWx0aW1vcmUuY29tL3By
+        b2R1Y3RzL3hzZWN1cmUvMBMGA1UdIwQMMAqACIXsHwqPfxrRMA0GCSqGSIb3DQEB
+        BQUAA4GBAGSBdPou5CWAiyS5/f46m00mIIqO3xl6ZXOc/DRblF4gWnesd2F5v/s6
+        lAbqK8+wJM6GxvpOkSp6O1q6hZRyzF86QPlXCfhKAXkgzHXtb6PfT2m9t0iawnjy
+        P+oyYofnFU5FFVOCujSrmFx3FCU+Wg6RT3v1jRoM3YfMYZYEzfTT
+      </X509Certificate>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-is.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-is.xml
new file mode 100644
index 0000000..895811e
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-is.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    pjlt4UQxI954TIicsctTxRk4qC4tF/h2Y0kmivXvyUU8EPoaCH8bIrcFWz7I7C3P
+    7NZi341itjSWA9cFnSBKboBPvKxPMMmYShsVMFBDyB2jiF1T3Qc4C/E0BJpR/Ntn
+    uBUNBPNxC0TUjuS7fIYku3NpVVbIv1OP0OqWNi0KDN0=
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509IssuerSerial>
+        <X509IssuerName>
+          CN=X/Secure CA,OU=X/Secure,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
+        </X509IssuerName>
+        <X509SerialNumber>989921098912</X509SerialNumber>
+      </X509IssuerSerial>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-ski.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-ski.xml
new file mode 100644
index 0000000..4a21f4d
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-ski.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    odQDs0dMckjo3hrQVZfx73SBDAR75bKaa/voefbB2f+uKvLMQDF1CeB8wA7vmlDV
+    oJJe3/18vvawSjWgIowN/KR7EZwkcvtw9hnb1QYEddX+CueeCfdEvp553nIPtibg
+    z+77wAbVq1VCOEspx3gn9DZcLJeGHkaeeTQNplYkn84=
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509SKI>
+        iIg+zElCPZ0=
+      </X509SKI>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-sn.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-sn.xml
new file mode 100644
index 0000000..f2a3d38
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/signature-x509-sn.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    L5EGwmlRmiKHu0SuMEhEwAzFK3uNWidqgpc+ZJws8pyD/uTZKdS93GMXlyMup4Dj
+    +E8+AFNj8zJ2JtQUBCkyTOS6XjMvSU4Q4/tlm6srjROtIvqpnwfUF0zEw5YswmlF
+    TpZY92EUQEiAErDt9LL9ZOy3fTAbyxs0WCzQEGoODE8=
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509SubjectName>
+        CN=Badb,OU=X/Secure,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
+      </X509SubjectName>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloped-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloped-dsa.xml
new file mode 100644
index 0000000..e5c63c8
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloped-dsa.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="urn:envelope">
+  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+    <SignedInfo>
+      <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+      <Reference URI="">
+        <Transforms>
+          <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+        </Transforms>
+        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+        <DigestValue>K8M/lPbKnuMDsO0Uzuj75lQtzQI=</DigestValue>
+      </Reference>
+    </SignedInfo>
+    <SignatureValue>
+      DpEylhQoiUKBoKWmYfajXO7LZxiDYgVtUtCNyTgwZgoChzorA2nhkQ==
+    </SignatureValue>
+    <KeyInfo>
+      <KeyValue>
+        <DSAKeyValue>
+          <P>
+            rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+            FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+            UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+          </P>
+          <Q>
+            kEjAFpCe4lcUOdwphpzf+tBaUds=
+          </Q>
+          <G>
+            oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+            SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+            BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+          </G>
+          <Y>
+            pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+            AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+            jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+          </Y>
+        </DSAKeyValue>
+      </KeyValue>
+      <X509Data>
+        <X509Certificate>
+          MIIDbTCCAyygAwIBAgIGAOCdrKxkMAkGByqGSM44BAMwezELMAkGA1UEBhMCSUUx
+          DzANBgNVBAgTBkR1YmxpbjElMCMGA1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2ll
+          cywgTHRkLjERMA8GA1UECxMIWC9TZWN1cmUxITAfBgNVBAMTGFgvU2VjdXJlIDEw
+          MjQtYml0IERTQSBDQTAeFw0wMDA3MjcxNzEzMzNaFw0wMTA3MjcxNzEzMjZaMHwx
+          CzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9y
+          ZSBUZWNobm9sb2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMSIwIAYDVQQD
+          ExlYL1NlY3VyZSAxMDI0LWJpdCBEU0EgY3J0MIIBuDCCASwGByqGSM44BAEwggEf
+          AoGBAKxbaPLj0DOst+BSz5g4eNASyda1awvFXkarroT2eo2DRZELsMZ7v8AryADI
+          bpDwSxRE/GyX/29nn/qKsWWoxG/vPM5WaMhvIP8DHwwR08c/gp6MC2oZwgk2AaeZ
+          LexvKlKGybr48pcI9bLe1fS7LtN4lzF7W4q4lIxWuYFEWrDfAhUAkEjAFpCe4lcU
+          Odwphpzf+tBaUdsCgYEAoe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOW
+          tKXeNK9FS7dWStreDxo2SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTE
+          Lh98mEocsLXkNh24HcH4BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqwD
+          gYUAAoGBAKQOTZ2b3Hee+FkV7jgO2Xwv+y6reHAdDES1rR7m7SaFTmqPYm+a8uK0
+          5NK+nXZzrwCBipLbrcyt8prypXktwzq8GUICfvwQ1g1vJDvUeuqOq3Y4kqGwYv9H
+          NldfnZKjoIxZis9/eZrwjmRoQu36gFYR2rdhIxjzH4EmcgAWu/tZozswOTAPBgNV
+          HQ8BAf8EBQMDAIAAMBEGA1UdDgQKBAiA4IML4dndEDATBgNVHSMEDDAKgAiHoMnY
+          nDxZUDAJBgcqhkjOOAQDAzAAMC0CFQCEXa1E2ueJ8WMX5nP1lCcBWhxC2wIUGUCB
+          b6M6Oj3NQAJbnZsdY63rKa0=
+        </X509Certificate>
+      </X509Data>
+    </KeyInfo>
+  </Signature>
+</Envelope>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-b64-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-b64-dsa.xml
new file mode 100644
index 0000000..e9bf94d
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-b64-dsa.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="#object">
+      <Transforms>
+        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+      </Transforms>
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>N6pjx3OY2VRHMmLhoAV8HmMu2nc=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    W+lrPJcfT0Uyj/AXyu9X2XLsTvBo6Rs8GNZUNUT4/+wx3HYuv/BovQ==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+          FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+          UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+        </P>
+        <Q>
+          kEjAFpCe4lcUOdwphpzf+tBaUds=
+        </Q>
+        <G>
+          oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+          SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+          BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+        </G>
+        <Y>
+          pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+          AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+          jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+    <X509Data>
+      <X509Certificate>
+        MIIDbTCCAyygAwIBAgIGAOCdrKxkMAkGByqGSM44BAMwezELMAkGA1UEBhMCSUUx
+        DzANBgNVBAgTBkR1YmxpbjElMCMGA1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2ll
+        cywgTHRkLjERMA8GA1UECxMIWC9TZWN1cmUxITAfBgNVBAMTGFgvU2VjdXJlIDEw
+        MjQtYml0IERTQSBDQTAeFw0wMDA3MjcxNzEzMzNaFw0wMTA3MjcxNzEzMjZaMHwx
+        CzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9y
+        ZSBUZWNobm9sb2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMSIwIAYDVQQD
+        ExlYL1NlY3VyZSAxMDI0LWJpdCBEU0EgY3J0MIIBuDCCASwGByqGSM44BAEwggEf
+        AoGBAKxbaPLj0DOst+BSz5g4eNASyda1awvFXkarroT2eo2DRZELsMZ7v8AryADI
+        bpDwSxRE/GyX/29nn/qKsWWoxG/vPM5WaMhvIP8DHwwR08c/gp6MC2oZwgk2AaeZ
+        LexvKlKGybr48pcI9bLe1fS7LtN4lzF7W4q4lIxWuYFEWrDfAhUAkEjAFpCe4lcU
+        Odwphpzf+tBaUdsCgYEAoe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOW
+        tKXeNK9FS7dWStreDxo2SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTE
+        Lh98mEocsLXkNh24HcH4BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqwD
+        gYUAAoGBAKQOTZ2b3Hee+FkV7jgO2Xwv+y6reHAdDES1rR7m7SaFTmqPYm+a8uK0
+        5NK+nXZzrwCBipLbrcyt8prypXktwzq8GUICfvwQ1g1vJDvUeuqOq3Y4kqGwYv9H
+        NldfnZKjoIxZis9/eZrwjmRoQu36gFYR2rdhIxjzH4EmcgAWu/tZozswOTAPBgNV
+        HQ8BAf8EBQMDAIAAMBEGA1UdDgQKBAiA4IML4dndEDATBgNVHSMEDDAKgAiHoMnY
+        nDxZUDAJBgcqhkjOOAQDAzAAMC0CFQCEXa1E2ueJ8WMX5nP1lCcBWhxC2wIUGUCB
+        b6M6Oj3NQAJbnZsdY63rKa0=
+      </X509Certificate>
+    </X509Data>
+  </KeyInfo>
+  <Object Id="object">c29tZSB0ZXh0</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-dsa.xml
new file mode 100644
index 0000000..b23cc0b
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-dsa.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    SVsFIWuARkAaD9HZXhNASHShx38UZiDS3IsIb2DS1eBUdD4V70E6MA==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+          FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+          UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+        </P>
+        <Q>
+          kEjAFpCe4lcUOdwphpzf+tBaUds=
+        </Q>
+        <G>
+          oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+          SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+          BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+        </G>
+        <Y>
+          pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+          AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+          jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+    <X509Data>
+      <X509Certificate>
+        MIIDbTCCAyygAwIBAgIGAOCdrKxkMAkGByqGSM44BAMwezELMAkGA1UEBhMCSUUx
+        DzANBgNVBAgTBkR1YmxpbjElMCMGA1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2ll
+        cywgTHRkLjERMA8GA1UECxMIWC9TZWN1cmUxITAfBgNVBAMTGFgvU2VjdXJlIDEw
+        MjQtYml0IERTQSBDQTAeFw0wMDA3MjcxNzEzMzNaFw0wMTA3MjcxNzEzMjZaMHwx
+        CzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9y
+        ZSBUZWNobm9sb2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMSIwIAYDVQQD
+        ExlYL1NlY3VyZSAxMDI0LWJpdCBEU0EgY3J0MIIBuDCCASwGByqGSM44BAEwggEf
+        AoGBAKxbaPLj0DOst+BSz5g4eNASyda1awvFXkarroT2eo2DRZELsMZ7v8AryADI
+        bpDwSxRE/GyX/29nn/qKsWWoxG/vPM5WaMhvIP8DHwwR08c/gp6MC2oZwgk2AaeZ
+        LexvKlKGybr48pcI9bLe1fS7LtN4lzF7W4q4lIxWuYFEWrDfAhUAkEjAFpCe4lcU
+        Odwphpzf+tBaUdsCgYEAoe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOW
+        tKXeNK9FS7dWStreDxo2SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTE
+        Lh98mEocsLXkNh24HcH4BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqwD
+        gYUAAoGBAKQOTZ2b3Hee+FkV7jgO2Xwv+y6reHAdDES1rR7m7SaFTmqPYm+a8uK0
+        5NK+nXZzrwCBipLbrcyt8prypXktwzq8GUICfvwQ1g1vJDvUeuqOq3Y4kqGwYv9H
+        NldfnZKjoIxZis9/eZrwjmRoQu36gFYR2rdhIxjzH4EmcgAWu/tZozswOTAPBgNV
+        HQ8BAf8EBQMDAIAAMBEGA1UdDgQKBAiA4IML4dndEDATBgNVHSMEDDAKgAiHoMnY
+        nDxZUDAJBgcqhkjOOAQDAzAAMC0CFQCEXa1E2ueJ8WMX5nP1lCcBWhxC2wIUGUCB
+        b6M6Oj3NQAJbnZsdY63rKa0=
+      </X509Certificate>
+    </X509Data>
+  </KeyInfo>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-hmac-sha1-40.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-hmac-sha1-40.xml
new file mode 100644
index 0000000..4904d79
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-hmac-sha1-40.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1">
+      <HMACOutputLength>40</HMACOutputLength>
+    </SignatureMethod>
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    HHiqvCU=
+  </SignatureValue>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-hmac-sha1.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-hmac-sha1.xml
new file mode 100644
index 0000000..c0c8343
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-hmac-sha1.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" />
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    JElPttIT4Am7Q+MNoMyv+WDfAZw=
+  </SignatureValue>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-rsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-rsa.xml
new file mode 100644
index 0000000..143192c
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-enveloping-rsa.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    TTx2opM6OcMi6zlasWEhP992di482KhTo80pgheFySZcpvorB47i8FkgDjftdxbn
+    2xlrZh0rp0v2dVVxWtLFjUpvN/Z+fkG/AXiT3kAhzRBqmYYYZxIuCtQM57yoBrIh
+    /nSy3HWs5wDqroFAx9q52qMMbKNbnwHG6Y/K1ZiVnNg=
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <RSAKeyValue>
+        <Modulus>
+          qe5VYmNxjeUSQDEI5lkHNDXxfXpXj95Ni7tcQ9DHDSgUJ1m2dNwKublDVQZDmmlf
+          HJ2n/us+EZTZNUST4GqublhgzcCCvYq9dbU8oqiEz0ktTIWCPy36UvQcaRwufpiV
+          RFaTDNPqjkjWPrM2cnpfyoI7ydbVCBRfI9zISQiR0Mk=
+        </Modulus>
+        <Exponent>
+          AQAB
+        </Exponent>
+      </RSAKeyValue>
+    </KeyValue>
+  </KeyInfo>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-external-b64-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-external-b64-dsa.xml
new file mode 100644
index 0000000..79765c2
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-external-b64-dsa.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://xmldsig.pothole.com/xml-stylesheet.txt">
+      <Transforms>
+        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+      </Transforms>
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    gU0blQcXJFHR5MhUIb2Clq7bcT+NfxOG5yLFUd3Y85QNfTaR5vu+6Q==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+          FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+          UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+        </P>
+        <Q>
+          kEjAFpCe4lcUOdwphpzf+tBaUds=
+        </Q>
+        <G>
+          oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+          SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+          BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+        </G>
+        <Y>
+          pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+          AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+          jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+    <X509Data>
+      <X509Certificate>
+        MIIDbTCCAyygAwIBAgIGAOCdrKxkMAkGByqGSM44BAMwezELMAkGA1UEBhMCSUUx
+        DzANBgNVBAgTBkR1YmxpbjElMCMGA1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2ll
+        cywgTHRkLjERMA8GA1UECxMIWC9TZWN1cmUxITAfBgNVBAMTGFgvU2VjdXJlIDEw
+        MjQtYml0IERTQSBDQTAeFw0wMDA3MjcxNzEzMzNaFw0wMTA3MjcxNzEzMjZaMHwx
+        CzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9y
+        ZSBUZWNobm9sb2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMSIwIAYDVQQD
+        ExlYL1NlY3VyZSAxMDI0LWJpdCBEU0EgY3J0MIIBuDCCASwGByqGSM44BAEwggEf
+        AoGBAKxbaPLj0DOst+BSz5g4eNASyda1awvFXkarroT2eo2DRZELsMZ7v8AryADI
+        bpDwSxRE/GyX/29nn/qKsWWoxG/vPM5WaMhvIP8DHwwR08c/gp6MC2oZwgk2AaeZ
+        LexvKlKGybr48pcI9bLe1fS7LtN4lzF7W4q4lIxWuYFEWrDfAhUAkEjAFpCe4lcU
+        Odwphpzf+tBaUdsCgYEAoe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOW
+        tKXeNK9FS7dWStreDxo2SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTE
+        Lh98mEocsLXkNh24HcH4BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqwD
+        gYUAAoGBAKQOTZ2b3Hee+FkV7jgO2Xwv+y6reHAdDES1rR7m7SaFTmqPYm+a8uK0
+        5NK+nXZzrwCBipLbrcyt8prypXktwzq8GUICfvwQ1g1vJDvUeuqOq3Y4kqGwYv9H
+        NldfnZKjoIxZis9/eZrwjmRoQu36gFYR2rdhIxjzH4EmcgAWu/tZozswOTAPBgNV
+        HQ8BAf8EBQMDAIAAMBEGA1UdDgQKBAiA4IML4dndEDATBgNVHSMEDDAKgAiHoMnY
+        nDxZUDAJBgcqhkjOOAQDAzAAMC0CFQCEXa1E2ueJ8WMX5nP1lCcBWhxC2wIUGUCB
+        b6M6Oj3NQAJbnZsdY63rKa0=
+      </X509Certificate>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-external-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-external-dsa.xml
new file mode 100644
index 0000000..5ff86df
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-fifteen/signature-external-dsa.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    Fj9OwSxpJppDnihohduxEUqu9/p6TR9PpgNGapaiBHGcY2QUDBaOEw==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+          FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+          UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+        </P>
+        <Q>
+          kEjAFpCe4lcUOdwphpzf+tBaUds=
+        </Q>
+        <G>
+          oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+          SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+          BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+        </G>
+        <Y>
+          pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+          AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+          jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+    <X509Data>
+      <X509Certificate>
+        MIIDbTCCAyygAwIBAgIGAOCdrKxkMAkGByqGSM44BAMwezELMAkGA1UEBhMCSUUx
+        DzANBgNVBAgTBkR1YmxpbjElMCMGA1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2ll
+        cywgTHRkLjERMA8GA1UECxMIWC9TZWN1cmUxITAfBgNVBAMTGFgvU2VjdXJlIDEw
+        MjQtYml0IERTQSBDQTAeFw0wMDA3MjcxNzEzMzNaFw0wMTA3MjcxNzEzMjZaMHwx
+        CzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9y
+        ZSBUZWNobm9sb2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMSIwIAYDVQQD
+        ExlYL1NlY3VyZSAxMDI0LWJpdCBEU0EgY3J0MIIBuDCCASwGByqGSM44BAEwggEf
+        AoGBAKxbaPLj0DOst+BSz5g4eNASyda1awvFXkarroT2eo2DRZELsMZ7v8AryADI
+        bpDwSxRE/GyX/29nn/qKsWWoxG/vPM5WaMhvIP8DHwwR08c/gp6MC2oZwgk2AaeZ
+        LexvKlKGybr48pcI9bLe1fS7LtN4lzF7W4q4lIxWuYFEWrDfAhUAkEjAFpCe4lcU
+        Odwphpzf+tBaUdsCgYEAoe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOW
+        tKXeNK9FS7dWStreDxo2SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTE
+        Lh98mEocsLXkNh24HcH4BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqwD
+        gYUAAoGBAKQOTZ2b3Hee+FkV7jgO2Xwv+y6reHAdDES1rR7m7SaFTmqPYm+a8uK0
+        5NK+nXZzrwCBipLbrcyt8prypXktwzq8GUICfvwQ1g1vJDvUeuqOq3Y4kqGwYv9H
+        NldfnZKjoIxZis9/eZrwjmRoQu36gFYR2rdhIxjzH4EmcgAWu/tZozswOTAPBgNV
+        HQ8BAf8EBQMDAIAAMBEGA1UdDgQKBAiA4IML4dndEDATBgNVHSMEDDAKgAiHoMnY
+        nDxZUDAJBgcqhkjOOAQDAzAAMC0CFQCEXa1E2ueJ8WMX5nP1lCcBWhxC2wIUGUCB
+        b6M6Oj3NQAJbnZsdY63rKa0=
+      </X509Certificate>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-sixteen/bad-signature.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-sixteen/bad-signature.xml
new file mode 100644
index 0000000..127ab5e
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-sixteen/bad-signature.xml
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Envelope [
+  <!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
+  <!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
+  <!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
+  <!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
+  <!ATTLIST Notaries Id ID #IMPLIED>
+]>
+<!-- Preamble -->
+<Envelope xmlns:foo="http://www.usps.gov/foo" xmlns="http://www.usps.gov/">
+  <DearSir>foo</DearSir>
+  <Body>bar</Body>
+  <YoursSincerely>
+    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
+      <SignedInfo>
+        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+        <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+        </Reference>
+        <Reference URI="http://xmldsig.pothole.com/xml-stylesheet.txt">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-1">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath>
+                self::text()
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+                ancestor-or-self::dsig:SignedInfo
+                  and
+                count(ancestor-or-self::dsig:Reference |
+                      here()/ancestor::dsig:Reference[1]) &gt;
+                count(ancestor-or-self::dsig:Reference)
+                  or
+                count(ancestor-or-self::node() |
+                      id('notaries')) =
+                count(ancestor-or-self::node())
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>DkRNHKuQgDiTy9XAAMGbyydg3BI=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-2">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>X9dMPL0KeDZXh9GE3vLcOtPsYjI=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#signature-properties-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>7tHLZrC0kqOhPCiYu/WusgG4tBo=</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zbVZy3ycg7CyFcPzNs0C6bA3qio=</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zbVZy3ycg7CyFcPzNs0C6bA3qio=</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zbVZy3ycg7CyFcPzNs0C6bA3qio=</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>ar0/7EQyRfUZmrPPcTQFdVCt2PY=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>0aW4L0GoFzYUo4gyZSfoyZBhpuc=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>0aW4L0GoFzYUo4gyZSfoyZBhpuc=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>0aW4L0GoFzYUo4gyZSfoyZBhpuc=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>1puYWb36Z5TIDmEIVd/JLR3iD8Y=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#reference-2">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>MMtXLCswiEDurKMgg2r+vBPlk8Q=</DigestValue>
+        </Reference>
+        <Reference Id="reference-1" Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#manifest-reference-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>7eI/P8mppgkqXqW0+at2UGj06qs=</DigestValue>
+        </Reference>
+        <Reference Id="reference-2" Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#reference-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>l/bqIouk6Gs8eEjG0Tad0MJJgWw=</DigestValue>
+        </Reference>
+      </SignedInfo>
+      <SignatureValue>
+        SiMb9su56spmMlNjrWWKdkgj1hDhveaWCx5Bwpj5AuJ6T3Zy68NJ/A==
+      </SignatureValue>
+      <KeyInfo>
+        <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#X509Data" URI="#object-4">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+                ancestor-or-self::dsig:X509Data
+              </XPath>
+            </Transform>
+          </Transforms>
+        </RetrievalMethod>
+      </KeyInfo>
+      <Object Id="object-1" MimeType="text/plain">I am the bad text.</Object>
+      <Object Encoding="http://www.w3.org/2000/09/xmldsig#base64" Id="object-2" MimeType="text/plain">aBADSIGN</Object>
+      <Object Id="object-3">
+        <NonCommentandus xmlns=""><!-- BAD Commentandum --></NonCommentandus>
+      </Object>
+      <Object>
+        <Manifest Id="manifest-1">
+          <Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+          </Reference>
+          <Reference Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#reference-1">
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>l/bqIouk6Gs8eEjG0Tad0MJJgWw=</DigestValue>
+          </Reference>
+          <Reference URI="#notaries">
+            <Transforms>
+              <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
+                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
+                  <xsl:output encoding="UTF-8" indent="no" method="xml" />
+                  <xsl:template match="/">
+                    <html>
+                      <head>
+                        <title>Notaries</title>
+                      </head>
+                      <body>
+                        <table>
+                          <xsl:for-each select="Notaries/Notary">
+                            <tr>
+                              <th>
+                                <xsl:value-of select="@name" />
+                              </th>
+                            </tr>
+                          </xsl:for-each>
+                        </table>
+                      </body>
+                    </html>
+                  </xsl:template>
+                </xsl:stylesheet>
+              </Transform>
+              <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+            </Transforms>
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>c7wq5XKos6RqNVJyFy7/fl6+sAs=</DigestValue>
+          </Reference>
+        </Manifest>
+      </Object>
+      <Object>
+        <SignatureProperties Id="signature-properties-1">
+          <SignatureProperty Target="#signature">
+            <SignerAddress xmlns="urn:demo"><IP>192.168.21.138</IP></SignerAddress>
+          </SignatureProperty>
+        </SignatureProperties>
+      </Object>
+      <Object Id="object-4">
+        <X509Data>
+          <X509SubjectName>
+            CN=Merlin Hughes,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
+          </X509SubjectName>
+          <X509IssuerSerial>
+            <X509IssuerName>
+              CN=Test DSA CA,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
+            </X509IssuerName>
+            <X509SerialNumber>970849936</X509SerialNumber>
+          </X509IssuerSerial>
+          <X509Certificate>
+            MIIDNzCCAvWgAwIBAgIEOd3+kDAJBgcqhkjOOAQDMFsxCzAJBgNVBAYTAklFMQ8w
+            DQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9sb2dpZXMs
+            IEx0ZC4xFDASBgNVBAMTC1Rlc3QgRFNBIENBMB4XDTAwMTAwNjE2MzIxNVoXDTAx
+            MTAwNjE2MzIxNFowXTELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjElMCMG
+            A1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2llcywgTHRkLjEWMBQGA1UEAxMNTWVy
+            bGluIEh1Z2hlczCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQDaJjfDTrawMHf8MiUt
+            Y54b37hSmYNnR3KpGT10uU1Dqppcju06uN0iGbqf947DjkBC25hKnqykK31xBw0E
+            CPbYq/KC98kghdf2xJCu6B8aqJ95K9jdVflJ3WP7PQxJn+fmM23zy6HYLXVICpfq
+            etdNj/VHCShZE3bdJiE6VobSFQIVAPQecqS2PaTDprcQnkwx4MHTRXhrAoGAMuGA
+            lqeB1ax+vyO2+Osubjhl7pHxLu47RIH+/M52DjESA9KMSrwzsYx8yNR2WooByrE0
+            t6fu0VncK7UK8olO4t7wpv2z4AFQPRVCKFwo0qgn5aKIkICGMlrRy81avb27wGcW
+            othx3iPPMtFXtoDqK0JItaI9R8zc1msFhM1GKMYDgYQAAoGActA8YGxrtngg/zKV
+            vqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJ
+            tgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LV
+            lMdwZNFNNJoqMcT2ZfCPrfvYvQ2jRzBFMB4GA1UdEQQXMBWBE21lcmxpbkBiYWx0
+            aW1vcmUuaWUwDgYDVR0PAQH/BAQDAgeAMBMGA1UdIwQMMAqACEJZQG0KwRbPMAkG
+            ByqGSM44BAMDMQAwLgIVAK4skWEFYgrggaJA8vYAwSjg12+KAhUAwHTo7wd4tENw
+            9LAKPklQ/74fH18=
+          </X509Certificate>
+        </X509Data>
+      </Object>
+    </Signature>
+  </YoursSincerely>
+  <PostScript>bar</PostScript>
+  <Notaries xmlns="" Id="notaries">
+    <Notary name="Great, A. T." />
+    <Notary name="Hun, A. T." />
+  </Notaries>
+  <!-- Commentary -->
+</Envelope>
+<!-- Postamble -->
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-sixteen/signature.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-sixteen/signature.xml
new file mode 100644
index 0000000..a7f277d
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-sixteen/signature.xml
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Envelope [
+  <!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
+  <!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
+  <!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
+  <!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
+  <!ATTLIST Notaries Id ID #IMPLIED>
+]>
+<!-- Preamble -->
+<Envelope xmlns:foo="http://www.usps.gov/foo" xmlns="http://www.usps.gov/">
+  <DearSir>foo</DearSir>
+  <Body>bar</Body>
+  <YoursSincerely>
+    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
+      <SignedInfo>
+        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+        <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+        </Reference>
+        <Reference URI="http://xmldsig.pothole.com/xml-stylesheet.txt">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-1">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath>
+                self::text()
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+                ancestor-or-self::dsig:SignedInfo
+                  and
+                count(ancestor-or-self::dsig:Reference |
+                      here()/ancestor::dsig:Reference[1]) &gt;
+                count(ancestor-or-self::dsig:Reference)
+                  or
+                count(ancestor-or-self::node() |
+                      id('notaries')) =
+                count(ancestor-or-self::node())
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>DkRNHKuQgDiTy9XAAMGbyydg3BI=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-2">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>X9dMPL0KeDZXh9GE3vLcOtPsYjI=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#signature-properties-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>7tHLZrC0kqOhPCiYu/WusgG4tBo=</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zbVZy3ycg7CyFcPzNs0C6bA3qio=</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zbVZy3ycg7CyFcPzNs0C6bA3qio=</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zbVZy3ycg7CyFcPzNs0C6bA3qio=</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>ar0/7EQyRfUZmrPPcTQFdVCt2PY=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>0aW4L0GoFzYUo4gyZSfoyZBhpuc=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>0aW4L0GoFzYUo4gyZSfoyZBhpuc=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>0aW4L0GoFzYUo4gyZSfoyZBhpuc=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>1puYWb36Z5TIDmEIVd/JLR3iD8Y=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#reference-2">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>MMtXLCswiEDurKMgg2r+vBPlk8Q=</DigestValue>
+        </Reference>
+        <Reference Id="reference-1" Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#manifest-reference-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>7eI/P8mppgkqXqW0+at2UGj06qs=</DigestValue>
+        </Reference>
+        <Reference Id="reference-2" Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#reference-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>l/bqIouk6Gs8eEjG0Tad0MJJgWw=</DigestValue>
+        </Reference>
+      </SignedInfo>
+      <SignatureValue>
+        SiMb9su56spmMlNjrWWKdkgj1hDhveaWCx5Bwpj5AuJ6T3Zy68NJ/A==
+      </SignatureValue>
+      <KeyInfo>
+        <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#X509Data" URI="#object-4">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+                ancestor-or-self::dsig:X509Data
+              </XPath>
+            </Transform>
+          </Transforms>
+        </RetrievalMethod>
+      </KeyInfo>
+      <Object Id="object-1" MimeType="text/plain">I am the text.</Object>
+      <Object Encoding="http://www.w3.org/2000/09/xmldsig#base64" Id="object-2" MimeType="text/plain">SSBhbSB0aGUgdGV4dC4=</Object>
+      <Object Id="object-3">
+        <NonCommentandus xmlns=""><!-- Commentandum --></NonCommentandus>
+      </Object>
+      <Object>
+        <Manifest Id="manifest-1">
+          <Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+          </Reference>
+          <Reference Type="http://www.w3.org/2000/09/xmldsig#Reference" URI="#reference-1">
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>l/bqIouk6Gs8eEjG0Tad0MJJgWw=</DigestValue>
+          </Reference>
+          <Reference URI="#notaries">
+            <Transforms>
+              <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
+                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
+                  <xsl:output encoding="UTF-8" indent="no" method="xml" />
+                  <xsl:template match="/">
+                    <html>
+                      <head>
+                        <title>Notaries</title>
+                      </head>
+                      <body>
+                        <table>
+                          <xsl:for-each select="Notaries/Notary">
+                            <tr>
+                              <th>
+                                <xsl:value-of select="@name" />
+                              </th>
+                            </tr>
+                          </xsl:for-each>
+                        </table>
+                      </body>
+                    </html>
+                  </xsl:template>
+                </xsl:stylesheet>
+              </Transform>
+              <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+            </Transforms>
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>c7wq5XKos6RqNVJyFy7/fl6+sAs=</DigestValue>
+          </Reference>
+        </Manifest>
+      </Object>
+      <Object>
+        <SignatureProperties Id="signature-properties-1">
+          <SignatureProperty Target="#signature">
+            <SignerAddress xmlns="urn:demo"><IP>192.168.21.138</IP></SignerAddress>
+          </SignatureProperty>
+        </SignatureProperties>
+      </Object>
+      <Object Id="object-4">
+        <X509Data>
+          <X509SubjectName>
+            CN=Merlin Hughes,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
+          </X509SubjectName>
+          <X509IssuerSerial>
+            <X509IssuerName>
+              CN=Test DSA CA,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
+            </X509IssuerName>
+            <X509SerialNumber>970849936</X509SerialNumber>
+          </X509IssuerSerial>
+          <X509Certificate>
+            MIIDNzCCAvWgAwIBAgIEOd3+kDAJBgcqhkjOOAQDMFsxCzAJBgNVBAYTAklFMQ8w
+            DQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9sb2dpZXMs
+            IEx0ZC4xFDASBgNVBAMTC1Rlc3QgRFNBIENBMB4XDTAwMTAwNjE2MzIxNVoXDTAx
+            MTAwNjE2MzIxNFowXTELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjElMCMG
+            A1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2llcywgTHRkLjEWMBQGA1UEAxMNTWVy
+            bGluIEh1Z2hlczCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQDaJjfDTrawMHf8MiUt
+            Y54b37hSmYNnR3KpGT10uU1Dqppcju06uN0iGbqf947DjkBC25hKnqykK31xBw0E
+            CPbYq/KC98kghdf2xJCu6B8aqJ95K9jdVflJ3WP7PQxJn+fmM23zy6HYLXVICpfq
+            etdNj/VHCShZE3bdJiE6VobSFQIVAPQecqS2PaTDprcQnkwx4MHTRXhrAoGAMuGA
+            lqeB1ax+vyO2+Osubjhl7pHxLu47RIH+/M52DjESA9KMSrwzsYx8yNR2WooByrE0
+            t6fu0VncK7UK8olO4t7wpv2z4AFQPRVCKFwo0qgn5aKIkICGMlrRy81avb27wGcW
+            othx3iPPMtFXtoDqK0JItaI9R8zc1msFhM1GKMYDgYQAAoGActA8YGxrtngg/zKV
+            vqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJ
+            tgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LV
+            lMdwZNFNNJoqMcT2ZfCPrfvYvQ2jRzBFMB4GA1UdEQQXMBWBE21lcmxpbkBiYWx0
+            aW1vcmUuaWUwDgYDVR0PAQH/BAQDAgeAMBMGA1UdIwQMMAqACEJZQG0KwRbPMAkG
+            ByqGSM44BAMDMQAwLgIVAK4skWEFYgrggaJA8vYAwSjg12+KAhUAwHTo7wd4tENw
+            9LAKPklQ/74fH18=
+          </X509Certificate>
+        </X509Data>
+      </Object>
+    </Signature>
+  </YoursSincerely>
+  <PostScript>bar</PostScript>
+  <Notaries xmlns="" Id="notaries">
+    <Notary name="Great, A. T." />
+    <Notary name="Hun, A. T." />
+  </Notaries>
+  <!-- Commentary -->
+</Envelope>
+<!-- Postamble -->
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/badb.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/badb.crt
new file mode 100644
index 0000000..2d0dec6
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/badb.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/balor.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/balor.crt
new file mode 100644
index 0000000..806d59d
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/balor.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/bres.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/bres.crt
new file mode 100644
index 0000000..c0953f4
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/bres.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/ca.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/ca.crt
new file mode 100644
index 0000000..00861d0
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/ca.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/crl b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/crl
new file mode 100644
index 0000000..a84e7ef
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/crl
@@ -0,0 +1,11 @@
+-----BEGIN CRL-----
+MIIBJDCB5AIBATAJBgcqhkjOOAQDMHYxCzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZE
+dWJsaW4xJDAiBgNVBAoTG0JhbHRpbW9yZSBUZWNobm9sb2dpZXMgTHRkLjERMA8G
+A1UECxMIWC9TZWN1cmUxHTAbBgNVBAMTFEFub3RoZXIgVHJhbnNpZW50IENBFw0w
+MjA0MDQwMjE2NThaFw0xMTA0MDIwMjE2NThaMBkwFwIGAOz5Id5/Fw0wMjA0MDQw
+MjE2NThaoCMwITATBgNVHSMEDDAKgAiKHFYwWjISfTAKBgNVHRQEAwIBADAJBgcq
+hkjOOAQDAzAAMC0CFCEIm38fvGzSJHms284hUs9dNB8nAhUAjEtZr0TGgc6sVRVk
+krEgltdo7Jw=
+-----END CRL-----
+
+
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/lugh.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/lugh.crt
new file mode 100644
index 0000000..2109edf
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/lugh.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/macha.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/macha.crt
new file mode 100644
index 0000000..484ddc2
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/macha.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/morigu.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/morigu.crt
new file mode 100644
index 0000000..ef0d415
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/morigu.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/mullan.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/mullan.crt
new file mode 100644
index 0000000..00729ba
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/mullan.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/nemain.crt b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/nemain.crt
new file mode 100644
index 0000000..f4b62ae
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/nemain.crt
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/xmldsig.jks b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/xmldsig.jks
new file mode 100644
index 0000000..9702fce
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/xmldsig.jks
Binary files differ
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloped-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloped-dsa.xml
new file mode 100644
index 0000000..f5ff1f5
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloped-dsa.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="http://example.org/envelope">
+  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+    <SignedInfo>
+      <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+      <Reference URI="">
+        <Transforms>
+          <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+        </Transforms>
+        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+        <DigestValue>fdy6S2NLpnT4fMdokUHSHsmpcvo=</DigestValue>
+      </Reference>
+    </SignedInfo>
+    <SignatureValue>
+      Z4pBb+o+XOKWME7CpLyXuNqyIYdXOcGvthfUf+ZDLL5immPx+3tK8Q==
+    </SignatureValue>
+    <KeyInfo>
+      <KeyValue>
+        <DSAKeyValue>
+          <P>
+            3eOeAvqnEyFpW+uTSgrdj7YLjaTkpyHecKFIoLu8QZNkGTQI1ciITBH0lqfIkdCH
+            Si8fiUC3DTq3J9FsJef4YVtDF7JpUvHTOQqtq7Zgx6KC8Wxkz6rQCxOr7F0ApOYi
+            89zLRoe4MkDGe6ux0+WtyOTQoVIGNTDDUFXrUQNbLrE=
+          </P>
+          <Q>
+            hDLcFK0GO/Hz1arxOOvsgM/VLyU=
+          </Q>
+          <G>
+            nnx7hbdWozGbtnFgnbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43z
+            Kt7dlEaQL7b5+JTZt3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM
+            8d2rhd2Ui0xHbk0D451nhLxVWulviOSPhzKKvXrbySA=
+          </G>
+          <Y>
+            cfYpihpAQeepbNFS4MAbQRhdXpDi5wLrwxE5hIvoYqo1L8BQVu8fY1TFAPtoae1i
+            Bg/GIJyP3iLfyuBJaDvJJLP30wBH9i/s5J3656PevpOVdTfi777Fi9Gj6y/ib2Vv
+            +OZfJkkp4L50+p5TUhPmQLJtREsgtl+tnIOyJT++G9U=
+          </Y>
+        </DSAKeyValue>
+      </KeyValue>
+    </KeyInfo>
+  </Signature>
+</Envelope>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.xml
new file mode 100644
index 0000000..4e924b0
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="#object">
+      <Transforms>
+        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+      </Transforms>
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>N6pjx3OY2VRHMmLhoAV8HmMu2nc=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    KgAeq8e0yUNfFz+mFlZ3QgyQNMciV+Z3BoDQDvQNker7pazEnJmOIA==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          3eOeAvqnEyFpW+uTSgrdj7YLjaTkpyHecKFIoLu8QZNkGTQI1ciITBH0lqfIkdCH
+          Si8fiUC3DTq3J9FsJef4YVtDF7JpUvHTOQqtq7Zgx6KC8Wxkz6rQCxOr7F0ApOYi
+          89zLRoe4MkDGe6ux0+WtyOTQoVIGNTDDUFXrUQNbLrE=
+        </P>
+        <Q>
+          hDLcFK0GO/Hz1arxOOvsgM/VLyU=
+        </Q>
+        <G>
+          nnx7hbdWozGbtnFgnbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43z
+          Kt7dlEaQL7b5+JTZt3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM
+          8d2rhd2Ui0xHbk0D451nhLxVWulviOSPhzKKvXrbySA=
+        </G>
+        <Y>
+          cfYpihpAQeepbNFS4MAbQRhdXpDi5wLrwxE5hIvoYqo1L8BQVu8fY1TFAPtoae1i
+          Bg/GIJyP3iLfyuBJaDvJJLP30wBH9i/s5J3656PevpOVdTfi777Fi9Gj6y/ib2Vv
+          +OZfJkkp4L50+p5TUhPmQLJtREsgtl+tnIOyJT++G9U=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+  </KeyInfo>
+  <Object Id="object">c29tZSB0ZXh0</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-dsa.xml
new file mode 100644
index 0000000..488ac26
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-dsa.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    PfD92lkxKgc2OKvF4p0ba6cJj6d1eqIDx5Q1hvVYTviotje23Snunw==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          3eOeAvqnEyFpW+uTSgrdj7YLjaTkpyHecKFIoLu8QZNkGTQI1ciITBH0lqfIkdCH
+          Si8fiUC3DTq3J9FsJef4YVtDF7JpUvHTOQqtq7Zgx6KC8Wxkz6rQCxOr7F0ApOYi
+          89zLRoe4MkDGe6ux0+WtyOTQoVIGNTDDUFXrUQNbLrE=
+        </P>
+        <Q>
+          hDLcFK0GO/Hz1arxOOvsgM/VLyU=
+        </Q>
+        <G>
+          nnx7hbdWozGbtnFgnbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43z
+          Kt7dlEaQL7b5+JTZt3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM
+          8d2rhd2Ui0xHbk0D451nhLxVWulviOSPhzKKvXrbySA=
+        </G>
+        <Y>
+          cfYpihpAQeepbNFS4MAbQRhdXpDi5wLrwxE5hIvoYqo1L8BQVu8fY1TFAPtoae1i
+          Bg/GIJyP3iLfyuBJaDvJJLP30wBH9i/s5J3656PevpOVdTfi777Fi9Gj6y/ib2Vv
+          +OZfJkkp4L50+p5TUhPmQLJtREsgtl+tnIOyJT++G9U=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+  </KeyInfo>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.xml
new file mode 100644
index 0000000..4904d79
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1">
+      <HMACOutputLength>40</HMACOutputLength>
+    </SignatureMethod>
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    HHiqvCU=
+  </SignatureValue>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.xml
new file mode 100644
index 0000000..c0c8343
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" />
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    JElPttIT4Am7Q+MNoMyv+WDfAZw=
+  </SignatureValue>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-rsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-rsa.xml
new file mode 100644
index 0000000..1580d83
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-rsa.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="#object">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    ov3HOoPN0w71N3DdGNhN+dSzQm6NJFUB5qGKRp9Q986nVzMb8wCIVxCQu+x3vMtq
+    p4/R3KEcPtEJSaoR+thGq++GPIh2mZXyWJs3xHy9P4xmoTVwli7/l7s8ebDSmnbZ
+    7xZU4Iy1BSMZSxGKnRG+Z/0GJIfTz8jhH6wCe3l03L4=
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <RSAKeyValue>
+        <Modulus>
+          q07hpxA5DGFfvJFZueFl/LI85XxQxrvqgVugL25V090A9MrlLBg5PmAsxFTe+G6a
+          xvWJQwYOVHj/nuiCnNLa9a7uAtPFiTtW+v5H3wlLaY3ws4atRBNOQlYkIBp38sTf
+          QBkk4i8PEU1GQ2M0CLIJq4/2Akfv1wxzSQ9+8oWkArc=
+        </Modulus>
+        <Exponent>
+          AQAB
+        </Exponent>
+      </RSAKeyValue>
+    </KeyValue>
+  </KeyInfo>
+  <Object Id="object">some text</Object>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-external-b64-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-external-b64-dsa.xml
new file mode 100644
index 0000000..1fb5663
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-external-b64-dsa.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/Signature/2002/04/xml-stylesheet.b64">
+      <Transforms>
+        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+      </Transforms>
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    IhOlAjMFaZtkEju5R5bi528h1HpDa4A21sudZynhJRRLjZuQIHZ3eQ==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          3eOeAvqnEyFpW+uTSgrdj7YLjaTkpyHecKFIoLu8QZNkGTQI1ciITBH0lqfIkdCH
+          Si8fiUC3DTq3J9FsJef4YVtDF7JpUvHTOQqtq7Zgx6KC8Wxkz6rQCxOr7F0ApOYi
+          89zLRoe4MkDGe6ux0+WtyOTQoVIGNTDDUFXrUQNbLrE=
+        </P>
+        <Q>
+          hDLcFK0GO/Hz1arxOOvsgM/VLyU=
+        </Q>
+        <G>
+          nnx7hbdWozGbtnFgnbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43z
+          Kt7dlEaQL7b5+JTZt3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM
+          8d2rhd2Ui0xHbk0D451nhLxVWulviOSPhzKKvXrbySA=
+        </G>
+        <Y>
+          cfYpihpAQeepbNFS4MAbQRhdXpDi5wLrwxE5hIvoYqo1L8BQVu8fY1TFAPtoae1i
+          Bg/GIJyP3iLfyuBJaDvJJLP30wBH9i/s5J3656PevpOVdTfi777Fi9Gj6y/ib2Vv
+          +OZfJkkp4L50+p5TUhPmQLJtREsgtl+tnIOyJT++G9U=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-external-dsa.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-external-dsa.xml
new file mode 100644
index 0000000..34d3e6a
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-external-dsa.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    LaL1/t/XodYvDJDgSEbq47GX8ltnlx3FFURdi7o+UFVi+zLf0WyWaQ==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyValue>
+      <DSAKeyValue>
+        <P>
+          3eOeAvqnEyFpW+uTSgrdj7YLjaTkpyHecKFIoLu8QZNkGTQI1ciITBH0lqfIkdCH
+          Si8fiUC3DTq3J9FsJef4YVtDF7JpUvHTOQqtq7Zgx6KC8Wxkz6rQCxOr7F0ApOYi
+          89zLRoe4MkDGe6ux0+WtyOTQoVIGNTDDUFXrUQNbLrE=
+        </P>
+        <Q>
+          hDLcFK0GO/Hz1arxOOvsgM/VLyU=
+        </Q>
+        <G>
+          nnx7hbdWozGbtnFgnbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43z
+          Kt7dlEaQL7b5+JTZt3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM
+          8d2rhd2Ui0xHbk0D451nhLxVWulviOSPhzKKvXrbySA=
+        </G>
+        <Y>
+          cfYpihpAQeepbNFS4MAbQRhdXpDi5wLrwxE5hIvoYqo1L8BQVu8fY1TFAPtoae1i
+          Bg/GIJyP3iLfyuBJaDvJJLP30wBH9i/s5J3656PevpOVdTfi777Fi9Gj6y/ib2Vv
+          +OZfJkkp4L50+p5TUhPmQLJtREsgtl+tnIOyJT++G9U=
+        </Y>
+      </DSAKeyValue>
+    </KeyValue>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-keyname.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-keyname.xml
new file mode 100644
index 0000000..a7c60a3
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-keyname.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    JkJ3GplEU0iDbqSv7ZOXhvv3zeM1KmP+CLphhoc+NPYqpGYQiW6O6w==
+  </SignatureValue>
+  <KeyInfo>
+    <KeyName>Lugh</KeyName>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.xml
new file mode 100644
index 0000000..2e861d9
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    SNB5FI193RFXoG2j8Z9bXWgW7BMPICqNob4Hjh08oou4tkhGxz4+pg==
+  </SignatureValue>
+  <KeyInfo>
+    <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#rawX509Certificate" URI="certs/balor.crt" />
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-crt-crl.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-crt-crl.xml
new file mode 100644
index 0000000..fe01797
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-crt-crl.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    WF6EaX66f8CdGE6NafmzdLpb/1OVYX4kBNsqgGIqHR5JZAu4HpbVQQ==
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509Certificate>
+        MIIDTjCCAw6gAwIBAgIGAOz5Id5/MAkGByqGSM44BAMwdjELMAkGA1UEBhMCSUUx
+        DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+        cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEdMBsGA1UEAxMUQW5vdGhlciBUcmFu
+        c2llbnQgQ0EwHhcNMDIwNDAzMDAwMDI4WhcNMTIwNDAyMjI1OTQ2WjBmMQswCQYD
+        VQQGEwJJRTEPMA0GA1UECBMGRHVibGluMSQwIgYDVQQKExtCYWx0aW1vcmUgVGVj
+        aG5vbG9naWVzIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ0wCwYDVQQDEwRCcmVz
+        MIIBtjCCASsGByqGSM44BAEwggEeAoGBAISKsEonjNGgHs/uh+9YKgnwZ8Bt3T7u
+        yQBJW9dxpMF0cPUXz4dFbSFY4QyW8igCLswpOa+eHHEYsWvE0Nr1lcKHUPXq7u41
+        JJwHNq1RAFeZiU6wa+1FL3v1/T1rAgzepV7xS4iafz4vxdHMlfwgKfoyKfq6JU1z
+        oVM/ahI5xWDDAhUAmEv6eIJrB4KN0fPRABPx3NHYclkCgYAlhuYZ/AzPta7+bE5C
+        QasmSVzc8uM/e+LN7ABlEXwQRk6QfZBcX8TbePNE8ZFng4Uft/QzAOUxALET7kKA
+        ek4Jeytpzc0XYCYyuGJATm4F9ZY1pAJ5yQmUmwvDYdlaZJ4ldGzO/R57Evngn/G4
+        tqjjoi0sx3jq7czvDwdGHnky0AOBhAACgYBgvDFxw1U6Ou2G6P/+347Jfk2wPB1/
+        atr4p3JUVLuT0ExZG6np+rKiXmcBbYKbAhMY37zVkroR9bwo+NgaJGubQ4ex5Y1X
+        N2Q5gIHNhNfKr8G4LPVqWGxf/lFPDYxX3ezqBJPpJCJTREX7s6Hp/VTV2SpQlySv
+        +GRcFKJFPlhD9aM6MDgwDgYDVR0PAQH/BAQDAgeAMBEGA1UdDgQKBAiC+5gx0MHL
+        hTATBgNVHSMEDDAKgAiKHFYwWjISfTAJBgcqhkjOOAQDAy8AMCwCFDTcM5i61uqq
+        /aveERhOJ6NG/LubAhREVDtAeNbTEywXr4O7KvEEvFLUjg==
+      </X509Certificate>
+      <X509CRL>
+        MIIBJDCB5AIBATAJBgcqhkjOOAQDMHYxCzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZE
+        dWJsaW4xJDAiBgNVBAoTG0JhbHRpbW9yZSBUZWNobm9sb2dpZXMgTHRkLjERMA8G
+        A1UECxMIWC9TZWN1cmUxHTAbBgNVBAMTFEFub3RoZXIgVHJhbnNpZW50IENBFw0w
+        MjA0MDQwMjE2NThaFw0xMTA0MDIwMjE2NThaMBkwFwIGAOz5Id5/Fw0wMjA0MDQw
+        MjE2NThaoCMwITATBgNVHSMEDDAKgAiKHFYwWjISfTAKBgNVHRQEAwIBADAJBgcq
+        hkjOOAQDAzAAMC0CFCEIm38fvGzSJHms284hUs9dNB8nAhUAjEtZr0TGgc6sVRVk
+        krEgltdo7Jw=
+      </X509CRL>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-crt.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-crt.xml
new file mode 100644
index 0000000..2048fd2
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-crt.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    GCQVmBq+1H7e9IjvKfe+egLM1Jlp3L1JCGkl9SlJ0eaDh2MKYUUnHA==
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509Certificate>
+        MIIDUDCCAxCgAwIBAgIGAOz5IVHTMAkGByqGSM44BAMwdjELMAkGA1UEBhMCSUUx
+        DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+        cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEdMBsGA1UEAxMUQW5vdGhlciBUcmFu
+        c2llbnQgQ0EwHhcNMDIwNDAyMjM1OTUyWhcNMTIwNDAyMjI1OTQ2WjBoMQswCQYD
+        VQQGEwJJRTEPMA0GA1UECBMGRHVibGluMSQwIgYDVQQKExtCYWx0aW1vcmUgVGVj
+        aG5vbG9naWVzIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ8wDQYDVQQDEwZNb3Jp
+        Z3UwggG2MIIBKwYHKoZIzjgEATCCAR4CgYEAhIqwSieM0aAez+6H71gqCfBnwG3d
+        Pu7JAElb13GkwXRw9RfPh0VtIVjhDJbyKAIuzCk5r54ccRixa8TQ2vWVwodQ9eru
+        7jUknAc2rVEAV5mJTrBr7UUve/X9PWsCDN6lXvFLiJp/Pi/F0cyV/CAp+jIp+rol
+        TXOhUz9qEjnFYMMCFQCYS/p4gmsHgo3R89EAE/Hc0dhyWQKBgCWG5hn8DM+1rv5s
+        TkJBqyZJXNzy4z974s3sAGURfBBGTpB9kFxfxNt480TxkWeDhR+39DMA5TEAsRPu
+        QoB6Tgl7K2nNzRdgJjK4YkBObgX1ljWkAnnJCZSbC8Nh2VpkniV0bM79HnsS+eCf
+        8bi2qOOiLSzHeOrtzO8PB0YeeTLQA4GEAAKBgH1NBJ9Az5TwY4tDE0dPYVHHABt+
+        yLspnT3k9G6YWUMFhZ/+3RuqEPjnKrPfUoXTTJGIACgPU3/PkqwrPVD0JMdpOcnZ
+        LHiJ/P7QRQeMwDRoBrs7genB1bDd4pSJrEUcjrkA5uRrIj2Z5fL+UuLiLGPO2rM7
+        BNQRIq3QFPdX++NuozowODAOBgNVHQ8BAf8EBAMCB4AwEQYDVR0OBAoECIK7Ljjh
+        +EsfMBMGA1UdIwQMMAqACIocVjBaMhJ9MAkGByqGSM44BAMDLwAwLAIUEJJCOHw8
+        ppxoRyz3s+Vmb4NKIfMCFDgJoZn9zh/3WoYNBURODwLvyBOy
+      </X509Certificate>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-is.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-is.xml
new file mode 100644
index 0000000..b7a01f8
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-is.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    bmKMy/w1DO9dHA6E7Dt0B8IFkYAj1/UD3TqcdqIcfkMT7evE8+NBgg==
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509IssuerSerial>
+        <X509IssuerName>
+          CN=Another Transient CA,OU=X/Secure,O=Baltimore Technologies Ltd.,ST=Dublin,C=IE
+        </X509IssuerName>
+        <X509SerialNumber>1017792003066</X509SerialNumber>
+      </X509IssuerSerial>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-ski.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-ski.xml
new file mode 100644
index 0000000..c71bfce
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-ski.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    F9nEU1Us48iKTml8n7E4wt7HtFJ5gaLIgox0J9WbujGndW0oQJbeGg==
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509SKI>
+        hf10xKfSnIg=
+      </X509SKI>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-sn.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-sn.xml
new file mode 100644
index 0000000..d5b0808
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-x509-sn.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    MUOjiqG0dbjvR6+qYYPL85nKSt2FeZGQBQkYudv48KyJhJLG1Bp+bA==
+  </SignatureValue>
+  <KeyInfo>
+    <X509Data>
+      <X509SubjectName>
+        CN=Badb,OU=X/Secure,O=Baltimore Technologies Ltd.,ST=Dublin,C=IE
+      </X509SubjectName>
+    </X509Data>
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature.tmpl b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature.tmpl
new file mode 100644
index 0000000..d10d36f
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature.tmpl
@@ -0,0 +1,265 @@
+<?xml version="1.0"?>
+<!DOCTYPE envelope [
+  <!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
+  <!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
+  <!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
+  <!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
+  <!ATTLIST Notaries Id ID #IMPLIED>
+]>
+<!-- Preamble -->
+<Envelope xmlns="http://example.org/usps" xmlns:foo="http://example.org/foo">
+  <DearSir>foo</DearSir>
+  <Body>bar</Body>
+  <YoursSincerely>
+    <Signature Id="signature" xmlns="&dsig;">
+      <SignedInfo>
+        <CanonicalizationMethod Algorithm="" />
+        <SignatureMethod Algorithm="" />
+        <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="http://www.w3.org/Signature/2002/04/xml-stylesheet.b64">
+          <Transforms>
+            <Transform Algorithm="&dsig;base64" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#object-1" Type="&dsig;Object">
+          <Transforms>
+            <Transform Algorithm="&xpath;">
+              <XPath>
+                self::text()
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="" Type="&dsig;Object">
+          <Transforms>
+            <Transform Algorithm="&xpath;">
+              <XPath xmlns:dsig="&dsig;">
+                ancestor-or-self::dsig:SignedInfo
+                  and
+                count(ancestor-or-self::dsig:Reference |
+                      here()/ancestor::dsig:Reference[1]) &gt;
+                count(ancestor-or-self::dsig:Reference)
+                  or
+                count(ancestor-or-self::node() |
+                      id('notaries')) =
+                count(ancestor-or-self::node())
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#object-2" Type="&dsig;Object">
+          <Transforms>
+            <Transform Algorithm="&dsig;base64" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#manifest-1" Type="&dsig;Manifest">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#signature-properties-1" Type="&dsig;SignatureProperties">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="&dsig;enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="&dsig;enveloped-signature" />
+            <Transform Algorithm="&c14n;#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="&dsig;enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="&dsig;enveloped-signature" />
+            <Transform Algorithm="&c14n;#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#object-3" Type="&dsig;Object">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#object-3" Type="&dsig;Object">
+          <Transforms>
+            <Transform Algorithm="&c14n;#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(id('object-3'))" Type="&dsig;Object">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(id('object-3'))" Type="&dsig;Object">
+          <Transforms>
+            <Transform Algorithm="&c14n;#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference URI="#reference-2">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference Id="reference-1" URI="#manifest-reference-1">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+        <Reference Id="reference-2" URI="#reference-1">
+          <DigestMethod Algorithm="" />
+          <DigestValue>aaaa</DigestValue>
+        </Reference>
+      </SignedInfo>
+      <SignatureValue>aaaa</SignatureValue>
+      <KeyInfo>
+        <RetrievalMethod URI="#object-4" Type="&dsig;X509Data">
+          <Transforms>
+            <Transform Algorithm="&xpath;">
+              <XPath xmlns:dsig="&dsig;">
+                ancestor-or-self::dsig:X509Data
+              </XPath>
+            </Transform>
+          </Transforms>
+        </RetrievalMethod>
+      </KeyInfo>
+      <Object Id="object-1" MimeType="text/plain">I am the text.</Object>
+      <Object Id="object-2" MimeType="text/plain" Encoding="&dsig;base64">SSBhbSB0aGUgdGV4dC4=</Object>
+      <Object Id="object-3"><NonCommentandus xmlns=""><!-- Commentandum --></NonCommentandus></Object>
+      <Object>
+        <Manifest Id="manifest-1">
+          <Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
+            <DigestMethod Algorithm="" />
+            <DigestValue>aaaa</DigestValue>
+          </Reference>
+          <Reference URI="#reference-1">
+            <DigestMethod Algorithm="" />
+            <DigestValue>aaaa</DigestValue>
+          </Reference>
+          <Reference URI="#notaries">
+            <Transforms>
+              <Transform Algorithm="&xslt;">
+                <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/TR/xhtml1/strict" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="foo">
+                  <xsl:output method="xml" indent="no" encoding="UTF-8"/>
+                  <xsl:template match="/">
+                    <html>
+                      <head>
+                        <title>Notaries</title>
+                      </head>
+                      <body>
+                        <table>
+                          <xsl:for-each select="Notaries/Notary">
+                            <tr>
+                              <th>
+                                <xsl:value-of select="@name"/>
+                              </th>
+                            </tr>
+                          </xsl:for-each>
+                        </table>
+                      </body>
+                    </html>
+                  </xsl:template>
+                </xsl:stylesheet>
+              </Transform>
+              <Transform Algorithm="&c14n;" />
+            </Transforms>
+            <DigestMethod Algorithm="" />
+            <DigestValue>aaaa</DigestValue>
+          </Reference>
+        </Manifest>
+      </Object>
+      <Object>
+        <SignatureProperties Id="signature-properties-1">
+          <SignatureProperty Target="#signature">
+            <SignerAddress xmlns="urn:demo"><IP>192.168.21.138</IP></SignerAddress>
+          </SignatureProperty>
+        </SignatureProperties>
+      </Object>
+      <Object Id="object-4">
+        <X509Data>
+          <X509SubjectName>
+            CN=Merlin Hughes,OU=X/Secure,O=Baltimore Technologies Ltd.,ST=Dublin,C=IE
+          </X509SubjectName>
+          <X509IssuerSerial>
+            <X509IssuerName>
+              CN=Transient CA,OU=X/Secure,O=Baltimore Technologies Ltd.,ST=Dublin,C=IE
+            </X509IssuerName>
+            <X509SerialNumber>1017788370348</X509SerialNumber>
+          </X509IssuerSerial>
+          <X509Certificate>
+            MIIDUDCCAxCgAwIBAgIGAOz46g2sMAkGByqGSM44BAMwbjELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEVMBMGA1UEAxMMVHJhbnNpZW50IENB
+            MB4XDTAyMDQwMjIyNTkzMFoXDTEyMDQwMjIxNTkyNVowbzELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEWMBQGA1UEAxMNTWVybGluIEh1Z2hl
+            czCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQDd454C+qcTIWlb65NKCt2PtguNpOSn
+            Id5woUigu7xBk2QZNAjVyIhMEfSWp8iR0IdKLx+JQLcNOrcn0Wwl5/hhW0MXsmlS
+            8dM5Cq2rtmDHooLxbGTPqtALE6vsXQCk5iLz3MtGh7gyQMZ7q7HT5a3I5NChUgY1
+            MMNQVetRA1susQIVAIQy3BStBjvx89Wq8Tjr7IDP1S8lAoGBAJ58e4W3VqMxm7Zx
+            YJ2xZ6KX0Ze10WnKZDyURn+T9iFIFbKRFElKDeotXwwXwYON8yre3ZRGkC+2+fiU
+            2bdzIWTT6LMbIMVbk+07P4OZOxJ6XWL9GuYcOQcNvX42xh34DPHdq4XdlItMR25N
+            A+OdZ4S8VVrpb4jkj4cyir1628kgA4GEAAKBgHH2KYoaQEHnqWzRUuDAG0EYXV6Q
+            4ucC68MROYSL6GKqNS/AUFbvH2NUxQD7aGntYgYPxiCcj94i38rgSWg7ySSz99MA
+            R/Yv7OSd+uej3r6TlXU34u++xYvRo+sv4m9lb/jmXyZJKeC+dPqeU1IT5kCybURL
+            ILZfrZyDsiU/vhvVozowODAOBgNVHQ8BAf8EBAMCB4AwEQYDVR0OBAoECIatY7SE
+            lXEOMBMGA1UdIwQMMAqACIOGPkB2MuKTMAkGByqGSM44BAMDLwAwLAIUSvT02iQj
+            Q5da4Wpe0Bvs7GuCcVsCFCEcQpbjUfnxXFXNWiFyQ49ZrWqn
+          </X509Certificate>
+          <X509Certificate>
+            MIIDSzCCAwugAwIBAgIGAOz46fwJMAkGByqGSM44BAMwbjELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEVMBMGA1UEAxMMVHJhbnNpZW50IENB
+            MB4XDTAyMDQwMjIyNTkyNVoXDTEyMDQwMjIxNTkyNVowbjELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEVMBMGA1UEAxMMVHJhbnNpZW50IENB
+            MIIBtzCCASwGByqGSM44BAEwggEfAoGBAN3jngL6pxMhaVvrk0oK3Y+2C42k5Kch
+            3nChSKC7vEGTZBk0CNXIiEwR9JanyJHQh0ovH4lAtw06tyfRbCXn+GFbQxeyaVLx
+            0zkKrau2YMeigvFsZM+q0AsTq+xdAKTmIvPcy0aHuDJAxnursdPlrcjk0KFSBjUw
+            w1BV61EDWy6xAhUAhDLcFK0GO/Hz1arxOOvsgM/VLyUCgYEAnnx7hbdWozGbtnFg
+            nbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43zKt7dlEaQL7b5+JTZ
+            t3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM8d2rhd2Ui0xHbk0D
+            451nhLxVWulviOSPhzKKvXrbySADgYQAAoGAfag+HCABIJadDD9Aarhgc2QR3Lp7
+            PpMOh0lAwLiIsvkO4UlbeOS0IJC8bcqLjM1fVw6FGSaxmq+4y1ag2m9k6IdE0Qh5
+            NxB/xFkmdwqXFRIJVp44OeUygB47YK76NmUIYG3DdfiPPU3bqzjvtOtETiCHvo25
+            4D6UjwPpYErXRUajNjA0MA4GA1UdDwEB/wQEAwICBDAPBgNVHRMECDAGAQH/AgEA
+            MBEGA1UdDgQKBAiDhj5AdjLikzAJBgcqhkjOOAQDAy8AMCwCFELu0nuweqW7Wf0s
+            gk/CAGGL0BGKAhRNdgQGr5iyZKoH4oqPm0VJ9TjXLg==
+          </X509Certificate>
+        </X509Data>
+      </Object>
+    </Signature>
+  </YoursSincerely>
+  <PostScript>bar</PostScript>
+  <Notaries Id="notaries" xmlns="">
+    <Notary name="Great, A. T." />
+    <Notary name="Hun, A. T." />
+  </Notaries>
+  <!-- Commentary -->
+</Envelope>
+<!-- Postamble -->
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature.xml b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature.xml
new file mode 100644
index 0000000..504fbe1
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature.xml
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Envelope [
+  <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+  <!ENTITY c14n 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>
+  <!ENTITY xpath 'http://www.w3.org/TR/1999/REC-xpath-19991116'>
+  <!ENTITY xslt 'http://www.w3.org/TR/1999/REC-xslt-19991116'>
+  <!ATTLIST Notaries Id ID #IMPLIED>
+]>
+<!-- Preamble -->
+<Envelope xmlns:foo="http://example.org/foo" xmlns="http://example.org/usps">
+  <DearSir>foo</DearSir>
+  <Body>bar</Body>
+  <YoursSincerely>
+    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
+      <SignedInfo>
+        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+        <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+        </Reference>
+        <Reference URI="http://www.w3.org/Signature/2002/04/xml-stylesheet.b64">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-1">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath>
+                self::text()
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+                ancestor-or-self::dsig:SignedInfo
+                  and
+                count(ancestor-or-self::dsig:Reference |
+                      here()/ancestor::dsig:Reference[1]) &gt;
+                count(ancestor-or-self::dsig:Reference)
+                  or
+                count(ancestor-or-self::node() |
+                      id('notaries')) =
+                count(ancestor-or-self::node())
+              </XPath>
+            </Transform>
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>tQiE3GUKiBenPyp3J0Ei6rJMFv4=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-2">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>qg4HFwsN+/WX32uH85WlJU9l45k=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#signature-properties-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>ETlEI3y7hvvAtMe9wQSz7LhbHEE=</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>J/O0HhdaPXxx49fgGWMESL09GpA=</DigestValue>
+        </Reference>
+        <Reference URI="">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>J/O0HhdaPXxx49fgGWMESL09GpA=</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>J/O0HhdaPXxx49fgGWMESL09GpA=</DigestValue>
+        </Reference>
+        <Reference URI="#xpointer(/)">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>MkL9CX8yeABBth1RChyPx58Ls8w=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>yamSIokKmjA3hB/s3Fu07wDO3vM=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>yamSIokKmjA3hB/s3Fu07wDO3vM=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>yamSIokKmjA3hB/s3Fu07wDO3vM=</DigestValue>
+        </Reference>
+        <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
+          </Transforms>
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>419CYgyTWOTGYGBhzieWklNf7Bk=</DigestValue>
+        </Reference>
+        <Reference URI="#reference-2">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>VzK45P9Ksjqq5oXlKQpkGgB2CNY=</DigestValue>
+        </Reference>
+        <Reference Id="reference-1" URI="#manifest-reference-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>7/9fR+NIDz9owc1Lfsxu1JBr8uo=</DigestValue>
+        </Reference>
+        <Reference Id="reference-2" URI="#reference-1">
+          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+          <DigestValue>qURlo3LSq4TWQtygBZJ0iXQ9E14=</DigestValue>
+        </Reference>
+      </SignedInfo>
+      <SignatureValue>
+        WvZUJAJ/3QNqzQvwne2vvy7U5Pck8ZZ5UTa6pIwR7GE+PoGi6A1kyw==
+      </SignatureValue>
+      <KeyInfo>
+        <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#X509Data" URI="#object-4">
+          <Transforms>
+            <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
+              <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+                ancestor-or-self::dsig:X509Data
+              </XPath>
+            </Transform>
+          </Transforms>
+        </RetrievalMethod>
+      </KeyInfo>
+      <Object Id="object-1" MimeType="text/plain">I am the text.</Object>
+      <Object Encoding="http://www.w3.org/2000/09/xmldsig#base64" Id="object-2" MimeType="text/plain">SSBhbSB0aGUgdGV4dC4=</Object>
+      <Object Id="object-3">
+        <NonCommentandus xmlns=""><!-- Commentandum --></NonCommentandus>
+      </Object>
+      <Object>
+        <Manifest Id="manifest-1">
+          <Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+          </Reference>
+          <Reference URI="#reference-1">
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>qURlo3LSq4TWQtygBZJ0iXQ9E14=</DigestValue>
+          </Reference>
+          <Reference URI="#notaries">
+            <Transforms>
+              <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
+                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
+                  <xsl:output encoding="UTF-8" indent="no" method="xml" />
+                  <xsl:template match="/">
+                    <html>
+                      <head>
+                        <title>Notaries</title>
+                      </head>
+                      <body>
+                        <table>
+                          <xsl:for-each select="Notaries/Notary">
+                            <tr>
+                              <th>
+                                <xsl:value-of select="@name" />
+                              </th>
+                            </tr>
+                          </xsl:for-each>
+                        </table>
+                      </body>
+                    </html>
+                  </xsl:template>
+                </xsl:stylesheet>
+              </Transform>
+              <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+            </Transforms>
+            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+            <DigestValue>c7wq5XKos6RqNVJyFy7/fl6+sAs=</DigestValue>
+          </Reference>
+        </Manifest>
+      </Object>
+      <Object>
+        <SignatureProperties Id="signature-properties-1">
+          <SignatureProperty Target="#signature">
+            <SignerAddress xmlns="urn:demo"><IP>192.168.21.138</IP></SignerAddress>
+          </SignatureProperty>
+        </SignatureProperties>
+      </Object>
+      <Object Id="object-4">
+        <X509Data>
+          <X509SubjectName>
+            CN=Merlin Hughes,OU=X/Secure,O=Baltimore Technologies Ltd.,ST=Dublin,C=IE
+          </X509SubjectName>
+          <X509IssuerSerial>
+            <X509IssuerName>
+              CN=Transient CA,OU=X/Secure,O=Baltimore Technologies Ltd.,ST=Dublin,C=IE
+            </X509IssuerName>
+            <X509SerialNumber>1017788370348</X509SerialNumber>
+          </X509IssuerSerial>
+          <X509Certificate>
+            MIIDUDCCAxCgAwIBAgIGAOz46g2sMAkGByqGSM44BAMwbjELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEVMBMGA1UEAxMMVHJhbnNpZW50IENB
+            MB4XDTAyMDQwMjIyNTkzMFoXDTEyMDQwMjIxNTkyNVowbzELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEWMBQGA1UEAxMNTWVybGluIEh1Z2hl
+            czCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQDd454C+qcTIWlb65NKCt2PtguNpOSn
+            Id5woUigu7xBk2QZNAjVyIhMEfSWp8iR0IdKLx+JQLcNOrcn0Wwl5/hhW0MXsmlS
+            8dM5Cq2rtmDHooLxbGTPqtALE6vsXQCk5iLz3MtGh7gyQMZ7q7HT5a3I5NChUgY1
+            MMNQVetRA1susQIVAIQy3BStBjvx89Wq8Tjr7IDP1S8lAoGBAJ58e4W3VqMxm7Zx
+            YJ2xZ6KX0Ze10WnKZDyURn+T9iFIFbKRFElKDeotXwwXwYON8yre3ZRGkC+2+fiU
+            2bdzIWTT6LMbIMVbk+07P4OZOxJ6XWL9GuYcOQcNvX42xh34DPHdq4XdlItMR25N
+            A+OdZ4S8VVrpb4jkj4cyir1628kgA4GEAAKBgHH2KYoaQEHnqWzRUuDAG0EYXV6Q
+            4ucC68MROYSL6GKqNS/AUFbvH2NUxQD7aGntYgYPxiCcj94i38rgSWg7ySSz99MA
+            R/Yv7OSd+uej3r6TlXU34u++xYvRo+sv4m9lb/jmXyZJKeC+dPqeU1IT5kCybURL
+            ILZfrZyDsiU/vhvVozowODAOBgNVHQ8BAf8EBAMCB4AwEQYDVR0OBAoECIatY7SE
+            lXEOMBMGA1UdIwQMMAqACIOGPkB2MuKTMAkGByqGSM44BAMDLwAwLAIUSvT02iQj
+            Q5da4Wpe0Bvs7GuCcVsCFCEcQpbjUfnxXFXNWiFyQ49ZrWqn
+          </X509Certificate>
+          <X509Certificate>
+            MIIDSzCCAwugAwIBAgIGAOz46fwJMAkGByqGSM44BAMwbjELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEVMBMGA1UEAxMMVHJhbnNpZW50IENB
+            MB4XDTAyMDQwMjIyNTkyNVoXDTEyMDQwMjIxNTkyNVowbjELMAkGA1UEBhMCSUUx
+            DzANBgNVBAgTBkR1YmxpbjEkMCIGA1UEChMbQmFsdGltb3JlIFRlY2hub2xvZ2ll
+            cyBMdGQuMREwDwYDVQQLEwhYL1NlY3VyZTEVMBMGA1UEAxMMVHJhbnNpZW50IENB
+            MIIBtzCCASwGByqGSM44BAEwggEfAoGBAN3jngL6pxMhaVvrk0oK3Y+2C42k5Kch
+            3nChSKC7vEGTZBk0CNXIiEwR9JanyJHQh0ovH4lAtw06tyfRbCXn+GFbQxeyaVLx
+            0zkKrau2YMeigvFsZM+q0AsTq+xdAKTmIvPcy0aHuDJAxnursdPlrcjk0KFSBjUw
+            w1BV61EDWy6xAhUAhDLcFK0GO/Hz1arxOOvsgM/VLyUCgYEAnnx7hbdWozGbtnFg
+            nbFnopfRl7XRacpkPJRGf5P2IUgVspEUSUoN6i1fDBfBg43zKt7dlEaQL7b5+JTZ
+            t3MhZNPosxsgxVuT7Ts/g5k7EnpdYv0a5hw5Bw29fjbGHfgM8d2rhd2Ui0xHbk0D
+            451nhLxVWulviOSPhzKKvXrbySADgYQAAoGAfag+HCABIJadDD9Aarhgc2QR3Lp7
+            PpMOh0lAwLiIsvkO4UlbeOS0IJC8bcqLjM1fVw6FGSaxmq+4y1ag2m9k6IdE0Qh5
+            NxB/xFkmdwqXFRIJVp44OeUygB47YK76NmUIYG3DdfiPPU3bqzjvtOtETiCHvo25
+            4D6UjwPpYErXRUajNjA0MA4GA1UdDwEB/wQEAwICBDAPBgNVHRMECDAGAQH/AgEA
+            MBEGA1UdDgQKBAiDhj5AdjLikzAJBgcqhkjOOAQDAy8AMCwCFELu0nuweqW7Wf0s
+            gk/CAGGL0BGKAhRNdgQGr5iyZKoH4oqPm0VJ9TjXLg==
+          </X509Certificate>
+        </X509Data>
+      </Object>
+    </Signature>
+  </YoursSincerely>
+  <PostScript>bar</PostScript>
+  <Notaries xmlns="" Id="notaries">
+    <Notary name="Great, A. T." />
+    <Notary name="Hun, A. T." />
+  </Notaries>
+  <!-- Commentary -->
+</Envelope>
+<!-- Postamble -->
diff --git a/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/xml-stylesheet.b64 b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/xml-stylesheet.b64
new file mode 100644
index 0000000..eb9a11a
--- /dev/null
+++ b/samples/data/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/xml-stylesheet.b64
@@ -0,0 +1,274 @@
+PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFu
+c2l0aW9uYWwvL0VOIj4KPGh0bWw+CjxoZWFkPgo8dGl0bGU+QXNzb2NpYXRpbmcg
+U3R5bGUgU2hlZXRzIHdpdGggWE1MIGRvY3VtZW50czwvdGl0bGU+CjxsaW5rIHJl
+bD0ic3R5bGVzaGVldCIgdHlwZT0idGV4dC9jc3MiIGhyZWY9Imh0dHA6Ly93d3cu
+dzMub3JnL1N0eWxlU2hlZXRzL1RSL1czQy1SRUMiPgo8c3R5bGUgdHlwZT0idGV4
+dC9jc3MiPmNvZGUgeyBmb250LWZhbWlseTogbW9ub3NwYWNlIH08L3N0eWxlPgo8
+L2hlYWQ+Cjxib2R5Pgo8ZGl2IGNsYXNzPSJoZWFkIj4KPGEgaHJlZj0iaHR0cDov
+L3d3dy53My5vcmcvIj48aW1nIHNyYz0iaHR0cDovL3d3dy53My5vcmcvSWNvbnMv
+V1dXL3czY19ob21lIiBhbHQ9IlczQyIgaGVpZ2h0PSI0OCIgd2lkdGg9IjcyIj48
+L2E+CjxoMT5Bc3NvY2lhdGluZyBTdHlsZSBTaGVldHMgd2l0aCBYTUwgZG9jdW1l
+bnRzPGJyPlZlcnNpb24gMS4wPC9oMT4KPGgyPlczQyBSZWNvbW1lbmRhdGlvbiAy
+OSBKdW5lIDE5OTk8L2gyPgo8ZGw+CjxkdD5UaGlzIHZlcnNpb246PC9kdD4KPGRk
+Pgo8YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzA2L1JFQy14bWwtc3R5
+bGVzaGVldC0xOTk5MDYyOSI+aHR0cDovL3d3dy53My5vcmcvMTk5OS8wNi9SRUMt
+eG1sLXN0eWxlc2hlZXQtMTk5OTA2Mjk8L2E+Cjxicj4KPC9kZD4KPGR0PkxhdGVz
+dCB2ZXJzaW9uOjwvZHQ+CjxkZD4KPGEgaHJlZj0iaHR0cDovL3d3dy53My5vcmcv
+VFIveG1sLXN0eWxlc2hlZXQiPmh0dHA6Ly93d3cudzMub3JnL1RSL3htbC1zdHls
+ZXNoZWV0PC9hPgo8YnI+CjwvZGQ+CjxkdD5QcmV2aW91cyB2ZXJzaW9uOjwvZHQ+
+CjxkZD4KPGEgaHJlZj0iaHR0cDovL3d3dy53My5vcmcvVFIvMTk5OS94bWwtc3R5
+bGVzaGVldC0xOTk5MDQyOCI+aHR0cDovL3d3dy53My5vcmcvVFIvMTk5OS94bWwt
+c3R5bGVzaGVldC0xOTk5MDQyODwvYT4KPGJyPgo8L2RkPgo8ZHQ+RWRpdG9yOjwv
+ZHQ+CjxkZD4KCkphbWVzIENsYXJrCjxhIGhyZWY9Im1haWx0bzpqamNAamNsYXJr
+LmNvbSI+Jmx0O2pqY0BqY2xhcmsuY29tJmd0OzwvYT4KPGJyPgo8L2RkPgo8L2Rs
+Pgo8cCBjbGFzcz0iY29weXJpZ2h0Ij4KPGEgaHJlZj0iaHR0cDovL3d3dy53My5v
+cmcvQ29uc29ydGl1bS9MZWdhbC9pcHItbm90aWNlLmh0bWwjQ29weXJpZ2h0Ij4K
+CQlDb3B5cmlnaHQ8L2E+ICZuYnNwOyZjb3B5OyZuYnNwOyAxOTk5IDxhIGhyZWY9
+Imh0dHA6Ly93d3cudzMub3JnIj5XM0M8L2E+CgkJKDxhIGhyZWY9Imh0dHA6Ly93
+d3cubGNzLm1pdC5lZHUiPk1JVDwvYT4sCgkJPGEgaHJlZj0iaHR0cDovL3d3dy5p
+bnJpYS5mci8iPklOUklBPC9hPiwKCQk8YSBocmVmPSJodHRwOi8vd3d3LmtlaW8u
+YWMuanAvIj5LZWlvPC9hPiApLCBBbGwgUmlnaHRzIFJlc2VydmVkLiBXM0MKCQk8
+YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy9Db25zb3J0aXVtL0xlZ2FsL2lwci1u
+b3RpY2UuaHRtbCNMZWdhbCBEaXNjbGFpbWVyIj5saWFiaWxpdHksPC9hPjxhIGhy
+ZWY9Imh0dHA6Ly93d3cudzMub3JnL0NvbnNvcnRpdW0vTGVnYWwvaXByLW5vdGlj
+ZS5odG1sI1czQyBUcmFkZW1hcmtzIj50cmFkZW1hcms8L2E+LAoJCTxhIGhyZWY9
+Imh0dHA6Ly93d3cudzMub3JnL0NvbnNvcnRpdW0vTGVnYWwvY29weXJpZ2h0LWRv
+Y3VtZW50cy5odG1sIj5kb2N1bWVudCB1c2UgPC9hPmFuZAoJCTxhIGhyZWY9Imh0
+dHA6Ly93d3cudzMub3JnL0NvbnNvcnRpdW0vTGVnYWwvY29weXJpZ2h0LXNvZnR3
+YXJlLmh0bWwiPnNvZnR3YXJlIGxpY2Vuc2luZyA8L2E+cnVsZXMgYXBwbHkuCgk8
+L3A+CjxociB0aXRsZT0iU2VwYXJhdG9yIGZvciBoZWFkZXIiPgo8L2Rpdj4KPGgy
+Pgo8YSBuYW1lPSJhYnN0cmFjdCI+QWJzdHJhY3Q8L2E+CjwvaDI+Cgo8cD5UaGlz
+IGRvY3VtZW50IGFsbG93cyBhIHN0eWxlIHNoZWV0IHRvIGJlIGFzc29jaWF0ZWQg
+d2l0aCBhbiBYTUwKZG9jdW1lbnQgYnkgaW5jbHVkaW5nIG9uZSBvciBtb3JlIHBy
+b2Nlc3NpbmcgaW5zdHJ1Y3Rpb25zIHdpdGggYQp0YXJnZXQgb2YgPGNvZGU+eG1s
+LXN0eWxlc2hlZXQ8L2NvZGU+IGluIHRoZSBkb2N1bWVudCdzIHByb2xvZy48L3A+
+Cgo8aDI+CjxhIG5hbWU9InN0YXR1cyI+U3RhdHVzIG9mIHRoaXMgZG9jdW1lbnQ8
+L2E+CjwvaDI+Cgo8cD5UaGlzIGRvY3VtZW50IGhhcyBiZWVuIHJldmlld2VkIGJ5
+IFczQyBNZW1iZXJzIGFuZCBvdGhlciBpbnRlcmVzdGVkCnBhcnRpZXMgYW5kIGhh
+cyBiZWVuIGVuZG9yc2VkIGJ5IHRoZSBEaXJlY3RvciBhcyBhIFczQyA8YSBocmVm
+PSJodHRwOi8vd3d3LnczLm9yZy9Db25zb3J0aXVtL1Byb2Nlc3MvI1JlY3NXM0Mi
+PlJlY29tbWVuZGF0aW9uPC9hPi4gSXQKaXMgYSBzdGFibGUgZG9jdW1lbnQgYW5k
+IG1heSBiZSB1c2VkIGFzIHJlZmVyZW5jZSBtYXRlcmlhbCBvciBjaXRlZCBhcwph
+IG5vcm1hdGl2ZSByZWZlcmVuY2UgZnJvbSBvdGhlciBkb2N1bWVudHMuIFczQydz
+IHJvbGUgaW4gbWFraW5nIHRoZQpSZWNvbW1lbmRhdGlvbiBpcyB0byBkcmF3IGF0
+dGVudGlvbiB0byB0aGUgc3BlY2lmaWNhdGlvbiBhbmQgdG8KcHJvbW90ZSBpdHMg
+d2lkZXNwcmVhZCBkZXBsb3ltZW50LiBUaGlzIGVuaGFuY2VzIHRoZSBmdW5jdGlv
+bmFsaXR5IGFuZAppbnRlcm9wZXJhYmlsaXR5IG9mIHRoZSBXZWIuPC9wPgoKPHA+
+VGhlIGxpc3Qgb2Yga25vd24gZXJyb3JzIGluIHRoaXMgc3BlY2lmaWNhdGlvbnMg
+aXMgYXZhaWxhYmxlIGF0CjxhIGhyZWY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkv
+MDYvUkVDLXhtbC1zdHlsZXNoZWV0LTE5OTkwNjI5L2VycmF0YSI+aHR0cDovL3d3
+dy53My5vcmcvVFIvMTk5OS94bWwtc3R5bGVzaGVldC0xOTk5MDYyOS9lcnJhdGE8
+L2E+LjwvcD4KCjxwPkNvbW1lbnRzIG9uIHRoaXMgc3BlY2lmaWNhdGlvbiBtYXkg
+YmUgc2VudCB0byAmbHQ7PGEgaHJlZj0ibWFpbHRvOnd3dy14bWwtc3R5bGVzaGVl
+dC1jb21tZW50c0B3My5vcmciPnd3dy14bWwtc3R5bGVzaGVldC1jb21tZW50c0B3
+My5vcmc8L2E+Jmd0Oy4gVGhlIGFyY2hpdmUgb2YgcHVibGljCmNvbW1lbnRzIGlz
+IGF2YWlsYWJsZSBhdCA8YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy9BcmNoaXZl
+cy9QdWJsaWMvd3d3LXhtbC1zdHlsZXNoZWV0LWNvbW1lbnRzIj5odHRwOi8vdzMu
+b3JnL0FyY2hpdmVzL1B1YmxpYy93d3cteG1sLXN0eWxlc2hlZXQtY29tbWVudHM8
+L2E+LjwvcD4KCjxwPkEgbGlzdCBvZiBjdXJyZW50IFczQyBSZWNvbW1lbmRhdGlv
+bnMgYW5kIG90aGVyIHRlY2huaWNhbCBkb2N1bWVudHMKY2FuIGJlIGZvdW5kIGF0
+IDxhIGhyZWY9Imh0dHA6Ly93d3cudzMub3JnL1RSIj5odHRwOi8vd3d3LnczLm9y
+Zy9UUjwvYT4uPC9wPgoKPHA+VGhlIFdvcmtpbmcgR3JvdXAgZXhwZWN0cyBhZGRp
+dGlvbmFsIG1lY2hhbmlzbXMgZm9yIGxpbmtpbmcgc3R5bGUKc2hlZXRzIHRvIFhN
+TCBkb2N1bWVudCB0byBiZSBkZWZpbmVkIGluIGEgZnV0dXJlIHNwZWNpZmljYXRp
+b24uPC9wPgoKPHA+VGhlIHVzZSBvZiBYTUwgcHJvY2Vzc2luZyBpbnN0cnVjdGlv
+bnMgaW4gdGhpcyBzcGVjaWZpY2F0aW9uIHNob3VsZApub3QgYmUgdGFrZW4gYXMg
+YSBwcmVjZWRlbnQuICBUaGUgVzNDIGRvZXMgbm90IGFudGljaXBhdGUgcmVjb21t
+ZW5kaW5nCnRoZSB1c2Ugb2YgcHJvY2Vzc2luZyBpbnN0cnVjdGlvbnMgaW4gYW55
+IGZ1dHVyZSBzcGVjaWZpY2F0aW9uLiAgVGhlCjxhIGhyZWY9IiNyYXRpb25hbGUi
+PlJhdGlvbmFsZTwvYT4gZXhwbGFpbnMgd2h5IHRoZXkgd2VyZSB1c2VkIGluCnRo
+aXMgc3BlY2lmaWNhdGlvbi48L3A+Cgo8cD5UaGlzIGRvY3VtZW50IHdhcyBwcm9k
+dWNlZCBhcyBwYXJ0IG9mIHRoZSA8YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy9Y
+TUwvQWN0aXZpdHkiPlczQyBYTUwgQWN0aXZpdHk8L2E+LjwvcD4KCgo8aDI+Cjxh
+IG5hbWU9ImNvbnRlbnRzIj5UYWJsZSBvZiBjb250ZW50czwvYT4KPC9oMj4xIDxh
+IGhyZWY9IiNUaGUgeG1sLXN0eWxlc2hlZXQgcHJvY2Vzc2luZyBpbnN0cnVjdGlv
+biI+VGhlIHhtbC1zdHlsZXNoZWV0IHByb2Nlc3NpbmcgaW5zdHJ1Y3Rpb248L2E+
+Cjxicj4KPGgzPkFwcGVuZGljZXM8L2gzPkEgPGEgaHJlZj0iI1JlZmVyZW5jZXMi
+PlJlZmVyZW5jZXM8L2E+Cjxicj5CIDxhIGhyZWY9IiNyYXRpb25hbGUiPlJhdGlv
+bmFsZTwvYT4KPGJyPgo8aHI+Cgo8aDI+CjxhIG5hbWU9IlRoZSB4bWwtc3R5bGVz
+aGVldCBwcm9jZXNzaW5nIGluc3RydWN0aW9uIj48L2E+MSBUaGUgPGNvZGU+eG1s
+LXN0eWxlc2hlZXQ8L2NvZGU+IHByb2Nlc3NpbmcgaW5zdHJ1Y3Rpb248L2gyPgoK
+PHA+U3R5bGUgU2hlZXRzIGNhbiBiZSBhc3NvY2lhdGVkIHdpdGggYW4gWE1MPGEg
+aHJlZj0iI1hNTCI+W1hNTDEwXTwvYT4KZG9jdW1lbnQgYnkgdXNpbmcgYSBwcm9j
+ZXNzaW5nIGluc3RydWN0aW9uIHdob3NlIHRhcmdldCBpcwo8Y29kZT54bWwtc3R5
+bGVzaGVldDwvY29kZT4uICBUaGlzIHByb2Nlc3NpbmcgaW5zdHJ1Y3Rpb24gZm9s
+bG93cyB0aGUKYmVoYXZpb3VyIG9mIHRoZSBIVE1MIDQuMCA8Y29kZT4mbHQ7TElO
+SwpSRUw9InN0eWxlc2hlZXQiJmd0OzwvY29kZT48YSBocmVmPSIjSFRNTCI+W0hU
+TUw0MF08L2E+LjwvcD4KCjxwPlRoZSA8Y29kZT54bWwtc3R5bGVzaGVldDwvY29k
+ZT4gcHJvY2Vzc2luZyBpbnN0cnVjdGlvbiBpcyBwYXJzZWQgaW4KdGhlIHNhbWUg
+d2F5IGFzIGEgc3RhcnQtdGFnLCB3aXRoIHRoZSBleGNlcHRpb24gdGhhdCBlbnRp
+dGllcyBvdGhlcgp0aGFuIHByZWRlZmluZWQgZW50aXRpZXMgbXVzdCBub3QgYmUg
+cmVmZXJlbmNlZC48L3A+Cgo8cD5UaGUgZm9sbG93aW5nIGdyYW1tYXIgaXMgZ2l2
+ZW4gdXNpbmcgdGhlIHNhbWUgbm90YXRpb24gYXMgdGhlCmdyYW1tYXIgaW4gdGhl
+IFhNTCBSZWNvbW1lbmRhdGlvbjxhIGhyZWY9IiNYTUwiPltYTUwxMF08L2E+LiAg
+U3ltYm9scyBpbiB0aGUKZ3JhbW1hciB0aGF0IGFyZSBub3QgZGVmaW5lZCBoZXJl
+IGFyZSBkZWZpbmVkIGluIHRoZSBYTUwKUmVjb21tZW5kYXRpb24uPC9wPgoKPGg1
+PnhtbC1zdHlsZXNoZWV0IHByb2Nlc3NpbmcgaW5zdHJ1Y3Rpb248L2g1Pgo8dGFi
+bGUgY2xhc3M9InNjcmFwIj4KPHRib2R5Pgo8dHIgdmFsaWduPSJiYXNlbGluZSI+
+Cjx0ZD4KPGEgbmFtZT0iTlQtU3R5bGVTaGVldFBJIj48L2E+WzFdJm5ic3A7Jm5i
+c3A7Jm5ic3A7PC90ZD4KPHRkPlN0eWxlU2hlZXRQSTwvdGQ+Cjx0ZD4mbmJzcDsm
+bmJzcDsmbmJzcDs6Oj0mbmJzcDsmbmJzcDsmbmJzcDs8L3RkPgo8dGQ+JyZsdDs/
+eG1sLXN0eWxlc2hlZXQnICg8YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy9UUi9S
+RUMteG1sI05ULVMiPlM8L2E+IDxhIGhyZWY9IiNOVC1Qc2V1ZG9BdHQiPlBzZXVk
+b0F0dDwvYT4pKiA8YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy9UUi9SRUMteG1s
+I05ULVMiPlM8L2E+PyAnPyZndDsnPC90ZD4KPHRkPgo8L3RkPgo8L3RyPgo8dHIg
+dmFsaWduPSJiYXNlbGluZSI+Cjx0ZD4KPGEgbmFtZT0iTlQtUHNldWRvQXR0Ij48
+L2E+WzJdJm5ic3A7Jm5ic3A7Jm5ic3A7PC90ZD4KPHRkPlBzZXVkb0F0dDwvdGQ+
+Cjx0ZD4mbmJzcDsmbmJzcDsmbmJzcDs6Oj0mbmJzcDsmbmJzcDsmbmJzcDs8L3Rk
+Pgo8dGQ+CjxhIGhyZWY9Imh0dHA6Ly93d3cudzMub3JnL1RSL1JFQy14bWwjTlQt
+TmFtZSI+TmFtZTwvYT4gPGEgaHJlZj0iaHR0cDovL3d3dy53My5vcmcvVFIvUkVD
+LXhtbCNOVC1TIj5TPC9hPj8gJz0nIDxhIGhyZWY9Imh0dHA6Ly93d3cudzMub3Jn
+L1RSL1JFQy14bWwjTlQtUyI+UzwvYT4/IDxhIGhyZWY9IiNOVC1Qc2V1ZG9BdHRW
+YWx1ZSI+UHNldWRvQXR0VmFsdWU8L2E+CjwvdGQ+Cjx0ZD4KPC90ZD4KPC90cj4K
+PHRyIHZhbGlnbj0iYmFzZWxpbmUiPgo8dGQ+CjxhIG5hbWU9Ik5ULVBzZXVkb0F0
+dFZhbHVlIj48L2E+WzNdJm5ic3A7Jm5ic3A7Jm5ic3A7PC90ZD4KPHRkPlBzZXVk
+b0F0dFZhbHVlPC90ZD4KPHRkPiZuYnNwOyZuYnNwOyZuYnNwOzo6PSZuYnNwOyZu
+YnNwOyZuYnNwOzwvdGQ+Cjx0ZD4oJyInIChbXiImbHQ7JmFtcDtdIHwgPGEgaHJl
+Zj0iaHR0cDovL3d3dy53My5vcmcvVFIvUkVDLXhtbCNOVC1DaGFyUmVmIj5DaGFy
+UmVmPC9hPiB8IDxhIGhyZWY9IiNOVC1QcmVkZWZFbnRpdHlSZWYiPlByZWRlZkVu
+dGl0eVJlZjwvYT4pKiAnIic8L3RkPgo8dGQ+CjwvdGQ+CjwvdHI+Cjx0ciB2YWxp
+Z249ImJhc2VsaW5lIj4KPHRkPgo8L3RkPgo8dGQ+CjwvdGQ+Cjx0ZD4KPC90ZD4K
+PHRkPnwgIiciIChbXicmbHQ7JmFtcDtdIHwgPGEgaHJlZj0iaHR0cDovL3d3dy53
+My5vcmcvVFIvUkVDLXhtbCNOVC1DaGFyUmVmIj5DaGFyUmVmPC9hPiB8IDxhIGhy
+ZWY9IiNOVC1QcmVkZWZFbnRpdHlSZWYiPlByZWRlZkVudGl0eVJlZjwvYT4pKiAi
+JyIpPC90ZD4KPHRkPgo8L3RkPgo8L3RyPgo8dHIgdmFsaWduPSJiYXNlbGluZSI+
+Cjx0ZD4KPC90ZD4KPHRkPgo8L3RkPgo8dGQ+CjwvdGQ+Cjx0ZD4tICg8YSBocmVm
+PSJodHRwOi8vd3d3LnczLm9yZy9UUi9SRUMteG1sI05ULUNoYXIiPkNoYXI8L2E+
+KiAnPyZndDsnIDxhIGhyZWY9Imh0dHA6Ly93d3cudzMub3JnL1RSL1JFQy14bWwj
+TlQtQ2hhciI+Q2hhcjwvYT4qKTwvdGQ+Cjx0ZD4KPC90ZD4KPC90cj4KPHRyIHZh
+bGlnbj0iYmFzZWxpbmUiPgo8dGQ+CjxhIG5hbWU9Ik5ULVByZWRlZkVudGl0eVJl
+ZiI+PC9hPls0XSZuYnNwOyZuYnNwOyZuYnNwOzwvdGQ+Cjx0ZD5QcmVkZWZFbnRp
+dHlSZWY8L3RkPgo8dGQ+Jm5ic3A7Jm5ic3A7Jm5ic3A7Ojo9Jm5ic3A7Jm5ic3A7
+Jm5ic3A7PC90ZD4KPHRkPicmYW1wO2FtcDsnIHwgJyZhbXA7bHQ7JyB8ICcmYW1w
+O2d0OycgfCAnJmFtcDtxdW90OycgfCAnJmFtcDthcG9zOyc8L3RkPgo8dGQ+Cjwv
+dGQ+CjwvdHI+CjwvdGJvZHk+CjwvdGFibGU+Cgo8cD5JbiA8YSBocmVmPSIjTlQt
+UHNldWRvQXR0VmFsdWUiPlBzZXVkb0F0dFZhbHVlPC9hPiwgYSA8YSBocmVmPSJo
+dHRwOi8vd3d3LnczLm9yZy9UUi9SRUMteG1sI05ULUNoYXJSZWYiPkNoYXJSZWY8
+L2E+IG9yIGEgPGEgaHJlZj0iI05ULVByZWRlZkVudGl0eVJlZiI+UHJlZGVmRW50
+aXR5UmVmPC9hPiBpcyBpbnRlcnByZXRlZCBpbiB0aGUKc2FtZSBtYW5uZXIgYXMg
+aW4gYSBub3JtYWwgWE1MIGF0dHJpYnV0ZSB2YWx1ZS4gIFRoZSBhY3R1YWwgdmFs
+dWUgb2YKdGhlIHBzZXVkby1hdHRyaWJ1dGUgaXMgdGhlIHZhbHVlIGFmdGVyIGVh
+Y2ggcmVmZXJlbmNlIGlzIHJlcGxhY2VkIGJ5CnRoZSBjaGFyYWN0ZXIgaXQgcmVm
+ZXJlbmNlcy4gIFRoaXMgcmVwbGFjZW1lbnQgaXMgbm90IHBlcmZvcm1lZAphdXRv
+bWF0aWNhbGx5IGJ5IGFuIFhNTCBwcm9jZXNzb3IuPC9wPgoKPHA+VGhlIDxjb2Rl
+PnhtbC1zdHlsZXNoZWV0PC9jb2RlPiBwcm9jZXNzaW5nIGluc3RydWN0aW9uIGlz
+IGFsbG93ZWQKb25seSBpbiB0aGUgcHJvbG9nIG9mIGFuIFhNTCBkb2N1bWVudC4g
+VGhlIHN5bnRheCBvZiBYTUwgY29uc3RyYWlucwp3aGVyZSBwcm9jZXNzaW5nIGlu
+c3RydWN0aW9ucyBhcmUgYWxsb3dlZCBpbiB0aGUgcHJvbG9nOyB0aGUKPGNvZGU+
+eG1sLXN0eWxlc2hlZXQ8L2NvZGU+IHByb2Nlc3NpbmcgaW5zdHJ1Y3Rpb24gaXMg
+YWxsb3dlZCBhbnl3aGVyZQppbiB0aGUgcHJvbG9nIHRoYXQgbWVldHMgdGhlc2Ug
+Y29uc3RyYWludHMuPC9wPgoKPGJsb2NrcXVvdGU+CjxiPk5PVEU6IDwvYj5JZiB0
+aGUgPGNvZGU+eG1sLXN0eWxlc2hlZXQ8L2NvZGU+IHByb2Nlc3NpbmcgaW5zdHJ1
+Y3Rpb24Kb2NjdXJzIGluIHRoZSBleHRlcm5hbCBEVEQgc3Vic2V0IG9yIGluIGEg
+cGFyYW1ldGVyIGVudGl0eSwgaXQgaXMKcG9zc2libGUgdGhhdCBpdCBtYXkgbm90
+IGJlIHByb2Nlc3NlZCBieSBhIG5vbi12YWxpZGF0aW5nIFhNTApwcm9jZXNzb3Ig
+KHNlZSA8YSBocmVmPSIjWE1MIj5bWE1MMTBdPC9hPikuPC9ibG9ja3F1b3RlPgoK
+PHA+VGhlIGZvbGxvd2luZyBwc2V1ZG8gYXR0cmlidXRlcyBhcmUgZGVmaW5lZDwv
+cD4KCjxwcmU+aHJlZiBDREFUQSAjUkVRVUlSRUQKdHlwZSBDREFUQSAjUkVRVUlS
+RUQKdGl0bGUgQ0RBVEEgI0lNUExJRUQKbWVkaWEgQ0RBVEEgI0lNUExJRUQKY2hh
+cnNldCBDREFUQSAjSU1QTElFRAphbHRlcm5hdGUgKHllc3xubykgIm5vIjwvcHJl
+PgoKPHA+VGhlIHNlbWFudGljcyBvZiB0aGUgcHNldWRvLWF0dHJpYnV0ZXMgYXJl
+IGV4YWN0bHkgYXMgd2l0aAo8Y29kZT4mbHQ7TElOSyBSRUw9InN0eWxlc2hlZXQi
+Jmd0OzwvY29kZT4gaW4gSFRNTCA0LjAsIHdpdGggdGhlCmV4Y2VwdGlvbiBvZiB0
+aGUgPGNvZGU+YWx0ZXJuYXRlPC9jb2RlPiBwc2V1ZG8tYXR0cmlidXRlLiAgSWYK
+PGNvZGU+YWx0ZXJuYXRlPSJ5ZXMiPC9jb2RlPiBpcyBzcGVjaWZpZWQsIHRoZW4g
+dGhlIHByb2Nlc3NpbmcKaW5zdHJ1Y3Rpb24gaGFzIHRoZSBzZW1hbnRpY3Mgb2Yg
+PGNvZGU+Jmx0O0xJTksgUkVMPSJhbHRlcm5hdGUKc3R5bGVzaGVldCImZ3Q7PC9j
+b2RlPiBpbnN0ZWFkIG9mIDxjb2RlPiZsdDtMSU5LClJFTD0ic3R5bGVzaGVldCIm
+Z3Q7PC9jb2RlPi48L3A+Cgo8YmxvY2txdW90ZT4KPGI+Tk9URTogPC9iPlNpbmNl
+IHRoZSB2YWx1ZSBvZiB0aGUgPGNvZGU+aHJlZjwvY29kZT4gYXR0cmlidXRlIGlz
+IGEgVVJJCnJlZmVyZW5jZSwgaXQgbWF5IGJlIGEgcmVsYXRpdmUgVVJJIGFuZCBp
+dCBtYXkgY29udGFpbiBhIGZyYWdtZW50CmlkZW50aWZpZXIuIEluIHBhcnRpY3Vs
+YXIgdGhlIFVSSSByZWZlcmVuY2UgbWF5IGNvbnRhaW4gb25seSBhCmZyYWdtZW50
+IGlkZW50aWZpZXIuICBTdWNoIGEgVVJJIHJlZmVyZW5jZSBpcyBhIHJlZmVyZW5j
+ZSB0byBhIHBhcnQgb2YKdGhlIGRvY3VtZW50IGNvbnRhaW5pbmcgdGhlIDxjb2Rl
+PnhtbC1zdHlsZXNoZWV0PC9jb2RlPiBwcm9jZXNzaW5nCmluc3RydWN0aW9uIChz
+ZWUgPGEgaHJlZj0iI1JGQzIzOTYiPltSRkMyMzk2XTwvYT4pLiBUaGUgY29uc2Vx
+dWVuY2UgaXMgdGhhdCB0aGUKPGNvZGU+eG1sLXN0eWxlc2hlZXQ8L2NvZGU+IHBy
+b2Nlc3NpbmcgaW5zdHJ1Y3Rpb24gYWxsb3dzIHN0eWxlIHNoZWV0cwp0byBiZSBl
+bWJlZGRlZCBpbiB0aGUgc2FtZSBkb2N1bWVudCBhcyB0aGUgPGNvZGU+eG1sLXN0
+eWxlc2hlZXQ8L2NvZGU+CnByb2Nlc3NpbmcgaW5zdHJ1Y3Rpb24uPC9ibG9ja3F1
+b3RlPgoKPHA+SW4gc29tZSBjYXNlcywgc3R5bGUgc2hlZXRzIG1heSBiZSBsaW5r
+ZWQgd2l0aCBhbiBYTUwgZG9jdW1lbnQgYnkKbWVhbnMgZXh0ZXJuYWwgdG8gdGhl
+IGRvY3VtZW50LiBGb3IgZXhhbXBsZSwgZWFybGllciB2ZXJzaW9ucyBvZiBIVFRQ
+CjxhIGhyZWY9IiNSRkMyMDY4Ij5bUkZDMjA2OF08L2E+IChzZWN0aW9uIDE5LjYu
+Mi40KSBhbGxvd2VkIHN0eWxlIHNoZWV0cyB0byBiZQphc3NvY2lhdGVkIHdpdGgg
+WE1MIGRvY3VtZW50cyBieSBtZWFucyBvZiB0aGUgPGNvZGU+TGluazwvY29kZT4K
+aGVhZGVyLiAgQW55IGxpbmtzIHRvIHN0eWxlIHNoZWV0cyB0aGF0IGFyZSBzcGVj
+aWZpZWQgZXh0ZXJuYWxseSB0byB0aGUKZG9jdW1lbnQgYXJlIGNvbnNpZGVyZWQg
+dG8gb2NjdXIgYmVmb3JlIHRoZSBsaW5rcyBzcGVjaWZpZWQgYnkgdGhlCjxjb2Rl
+PnhtbC1zdHlsZXNoZWV0PC9jb2RlPiBwcm9jZXNzaW5nIGluc3RydWN0aW9ucy4g
+IFRoaXMgaXMgdGhlIHNhbWUKYXMgaW4gSFRNTCA0LjAgKHNlZSA8YSBocmVmPSJo
+dHRwOi8vd3d3LnczLm9yZy9UUi9SRUMtaHRtbDQwL3ByZXNlbnQvc3R5bGVzLmh0
+bWwjaC0xNC42Ij5zZWN0aW9uCjE0LjY8L2E+KS48L3A+Cgo8cD5IZXJlIGFyZSBz
+b21lIGV4YW1wbGVzIGZyb20gSFRNTCA0LjAgd2l0aCB0aGUgY29ycmVzcG9uZGlu
+Zwpwcm9jZXNzaW5nIGluc3RydWN0aW9uOjwvcD4KCjxwcmU+Jmx0O0xJTksgaHJl
+Zj0ibXlzdHlsZS5jc3MiIHJlbD0ic3R5bGUgc2hlZXQiIHR5cGU9InRleHQvY3Nz
+IiZndDsKJmx0Oz94bWwtc3R5bGVzaGVldCBocmVmPSJteXN0eWxlLmNzcyIgdHlw
+ZT0idGV4dC9jc3MiPyZndDsKCiZsdDtMSU5LIGhyZWY9Im15c3R5bGUuY3NzIiB0
+aXRsZT0iQ29tcGFjdCIgcmVsPSJzdHlsZXNoZWV0Igp0eXBlPSJ0ZXh0L2NzcyIm
+Z3Q7CiZsdDs/eG1sLXN0eWxlc2hlZXQgaHJlZj0ibXlzdHlsZS5jc3MiIHRpdGxl
+PSJDb21wYWN0IiB0eXBlPSJ0ZXh0L2NzcyI/Jmd0OwoKJmx0O0xJTksgaHJlZj0i
+bXlzdHlsZS5jc3MiIHRpdGxlPSJNZWRpdW0iIHJlbD0iYWx0ZXJuYXRlIHN0eWxl
+c2hlZXQiCnR5cGU9InRleHQvY3NzIiZndDsKJmx0Oz94bWwtc3R5bGVzaGVldCBh
+bHRlcm5hdGU9InllcyIgaHJlZj0ibXlzdHlsZS5jc3MiIHRpdGxlPSJNZWRpdW0i
+CnR5cGU9InRleHQvY3NzIj8mZ3Q7PC9wcmU+Cgo8cD5NdWx0aXBsZSA8Y29kZT54
+bWwtc3R5bGVzaGVldDwvY29kZT4gcHJvY2Vzc2luZyBpbnN0cnVjdGlvbnMgYXJl
+CmFsc28gYWxsb3dlZCB3aXRoIGV4YWN0bHkgdGhlIHNhbWUgc2VtYW50aWNzIGFz
+IHdpdGggPGNvZGU+TElOSwpSRUw9InN0eWxlc2hlZXQiPC9jb2RlPi4gRm9yIGV4
+YW1wbGUsPC9wPgoKPHByZT4mbHQ7TElOSyByZWw9ImFsdGVybmF0ZSBzdHlsZXNo
+ZWV0IiB0aXRsZT0iY29tcGFjdCIgaHJlZj0ic21hbGwtYmFzZS5jc3MiCnR5cGU9
+InRleHQvY3NzIiZndDsKJmx0O0xJTksgcmVsPSJhbHRlcm5hdGUgc3R5bGVzaGVl
+dCIgdGl0bGU9ImNvbXBhY3QiIGhyZWY9InNtYWxsLWV4dHJhcy5jc3MiCnR5cGU9
+InRleHQvY3NzIiZndDsKJmx0O0xJTksgcmVsPSJhbHRlcm5hdGUgc3R5bGVzaGVl
+dCIgdGl0bGU9ImJpZyBwcmludCIgaHJlZj0iYmlncHJpbnQuY3NzIgp0eXBlPSJ0
+ZXh0L2NzcyImZ3Q7CiZsdDtMSU5LIHJlbD0ic3R5bGVzaGVldCIgaHJlZj0iY29t
+bW9uLmNzcyIgdHlwZT0idGV4dC9jc3MiJmd0OzwvcHJlPgoKPHA+d291bGQgYmUg
+ZXF1aXZhbGVudCB0bzo8L3A+Cgo8cHJlPiZsdDs/eG1sLXN0eWxlc2hlZXQgYWx0
+ZXJuYXRlPSJ5ZXMiIHRpdGxlPSJjb21wYWN0IiBocmVmPSJzbWFsbC1iYXNlLmNz
+cyIKdHlwZT0idGV4dC9jc3MiPyZndDsKJmx0Oz94bWwtc3R5bGVzaGVldCBhbHRl
+cm5hdGU9InllcyIgdGl0bGU9ImNvbXBhY3QiIGhyZWY9InNtYWxsLWV4dHJhcy5j
+c3MiCnR5cGU9InRleHQvY3NzIj8mZ3Q7CiZsdDs/eG1sLXN0eWxlc2hlZXQgYWx0
+ZXJuYXRlPSJ5ZXMiIHRpdGxlPSJiaWcgcHJpbnQiIGhyZWY9ImJpZ3ByaW50LmNz
+cyIKdHlwZT0idGV4dC9jc3MiPyZndDsKJmx0Oz94bWwtc3R5bGVzaGVldCBocmVm
+PSJjb21tb24uY3NzIiB0eXBlPSJ0ZXh0L2NzcyI/Jmd0OzwvcHJlPgoKCgo8aHIg
+dGl0bGU9IlNlcGFyYXRvciBmcm9tIGZvb3RlciI+Cgo8aDI+CjxhIG5hbWU9IlJl
+ZmVyZW5jZXMiPjwvYT5BIFJlZmVyZW5jZXM8L2gyPgoKPGRsPgoKPGR0Pgo8YSBu
+YW1lPSJIVE1MIj5IVE1MNDA8L2E+CjwvZHQ+CjxkZD5Xb3JsZCBXaWRlIFdlYgpD
+b25zb3J0aXVtLiA8aT5IVE1MIDQuMCBTcGVjaWZpY2F0aW9uLjwvaT4gVzNDIFJl
+Y29tbWVuZGF0aW9uLiBTZWUKPGEgaHJlZj0iaHR0cDovL3d3dy53My5vcmcvVFIv
+UkVDLWh0bWw0MCI+aHR0cDovL3d3dy53My5vcmcvVFIvUkVDLWh0bWw0MDwvYT4K
+PC9kZD4KCjxkdD4KPGEgbmFtZT0iUkZDMjA2OCI+UkZDMjA2ODwvYT4KPC9kdD4K
+PGRkPlIuIEZpZWxkaW5nLCBKLiBHZXR0eXMsIEouIE1vZ3VsLApILiBGcnlzdHlr
+IE5pZWxzZW4sIGFuZCBULiBCZXJuZXJzLUxlZS4gIDxpPkh5cGVydGV4dCBUcmFu
+c2ZlcgpQcm90b2NvbCAtLSBIVFRQLzEuMS48L2k+LiBJRVRGIFJGQyAyMDY4LiBT
+ZWUgPGEgaHJlZj0iaHR0cDovL3d3dy5pZXRmLm9yZy9yZmMvcmZjMjA2OC50eHQi
+Pmh0dHA6Ly93d3cuaWV0Zi5vcmcvcmZjL3JmYzIwNjgudHh0PC9hPi48L2RkPgoK
+PGR0Pgo8YSBuYW1lPSJSRkMyMzk2Ij5SRkMyMzk2PC9hPgo8L2R0Pgo8ZGQ+VC4g
+QmVybmVycy1MZWUsIFIuIEZpZWxkaW5nLCBhbmQKTC4gTWFzaW50ZXIuICA8aT5V
+bmlmb3JtIFJlc291cmNlIElkZW50aWZpZXJzIChVUkkpOiBHZW5lcmljClN5bnRh
+eDwvaT4uIElFVEYgUkZDIDIzOTYuIFNlZSA8YSBocmVmPSJodHRwOi8vd3d3Lmll
+dGYub3JnL3JmYy9yZmMyMzk2LnR4dCI+aHR0cDovL3d3dy5pZXRmLm9yZy9yZmMv
+cmZjMjM5Ni50eHQ8L2E+LjwvZGQ+Cgo8ZHQ+CjxhIG5hbWU9IlhNTCI+WE1MMTA8
+L2E+CjwvZHQ+CjxkZD5Xb3JsZCBXaWRlIFdlYiBDb25zb3J0aXVtLiA8aT5FeHRl
+bnNpYmxlCk1hcmt1cCBMYW5ndWFnZSAoWE1MKSAxLjAuPC9pPiBXM0MgUmVjb21t
+ZW5kYXRpb24uIFNlZSA8YSBocmVmPSJodHRwOi8vd3d3LnczLm9yZy9UUi8xOTk4
+L1JFQy14bWwtMTk5ODAyMTAiPmh0dHA6Ly93d3cudzMub3JnL1RSLzE5OTgvUkVD
+LXhtbC0xOTk4MDIxMDwvYT4KPC9kZD4KCjwvZGw+CgoKCgo8aDI+CjxhIG5hbWU9
+InJhdGlvbmFsZSI+PC9hPkIgUmF0aW9uYWxlPC9oMj4KCjxwPlRoZXJlIHdhcyBh
+biB1cmdlbnQgcmVxdWlyZW1lbnQgZm9yIGEgc3BlY2lmaWNhdGlvbiBmb3Igc3R5
+bGUgc2hlZXQKbGlua2luZyB0aGF0IGNvdWxkIGJlIGNvbXBsZXRlZCBpbiB0aW1l
+IGZvciB0aGUgbmV4dCByZWxlYXNlIGZyb20KbWFqb3IgYnJvd3NlciB2ZW5kb3Jz
+LiAgT25seSBieSBjaG9vc2luZyBhIHNpbXBsZSBtZWNoYW5pc20gY2xvc2VseQpi
+YXNlZCBvbiBhIHByb3ZlbiBleGlzdGluZyBtZWNoYW5pc20gY291bGQgdGhlIHNw
+ZWNpZmljYXRpb24gYmUKY29tcGxldGVkIGluIHRpbWUgdG8gbWVldCB0aGlzIHJl
+cXVpcmVtZW50LjwvcD4KCjxwPlVzZSBvZiBhIHByb2Nlc3NpbmcgaW5zdHJ1Y3Rp
+b24gYXZvaWRzIHBvbGx1dGluZyB0aGUgbWFpbiBkb2N1bWVudApzdHJ1Y3R1cmUg
+d2l0aCBhcHBsaWNhdGlvbiBzcGVjaWZpYyBwcm9jZXNzaW5nIGluZm9ybWF0aW9u
+LjwvcD4KCjxwPlRoZSBtZWNoYW5pc20gY2hvc2VuIGZvciB0aGlzIHZlcnNpb24g
+b2YgdGhlIHNwZWNpZmljYXRpb24gaXMgbm90IGEKY29uc3RyYWludCBvbiB0aGUg
+YWRkaXRpb25hbCBtZWNoYW5pc21zIHBsYW5uZWQgZm9yIGZ1dHVyZSB2ZXJzaW9u
+cy4KVGhlcmUgaXMgbm8gZXhwZWN0YXRpb24gdGhhdCB0aGVzZSB3aWxsIHVzZSBw
+cm9jZXNzaW5nIGluc3RydWN0aW9uczsKaW5kZWVkIHRoZXkgbWF5IG5vdCBpbmNs
+dWRlIHRoZSBsaW5raW5nIGluZm9ybWF0aW9uIGluIHRoZSBzb3VyY2UKZG9jdW1l
+bnQuPC9wPgoKCgoKPC9ib2R5Pgo8L2h0bWw+Cg==
diff --git a/samples/data/keystore.jks b/samples/data/keystore.jks
new file mode 100644
index 0000000..31a0214
--- /dev/null
+++ b/samples/data/keystore.jks
Binary files differ
diff --git a/samples/data/org/apache/xml/security/temp/extension.xsl b/samples/data/org/apache/xml/security/temp/extension.xsl
new file mode 100644
index 0000000..0c16e06
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/extension.xsl
@@ -0,0 +1,13 @@
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"

+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

+	xmlns:pe="xalan://org.xmlsecurity.temp.TestProperties"

+	extension-element-prefixes="pe"

+	version="1.0">

+

+	<xsl:output indent="yes" omit-xml-declaration="yes"/>

+	<xsl:template match="/">

+		<pe:properties>

+		   <xsl:apply-templates />

+		</pe:properties>

+	</xsl:template>

+</xsl:stylesheet>

diff --git a/samples/data/org/apache/xml/security/temp/id.xml b/samples/data/org/apache/xml/security/temp/id.xml
new file mode 100644
index 0000000..544a243
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/id.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>

+

+<!DOCTYPE doc [

+<!ATTLIST e9 Id ID #IMPLIED>

+]>

+

+

+<doc>

+   <e9 Id="NO3"></e9>

+   <e9 Id="id2"></e9>

+</doc> 

diff --git a/samples/data/org/apache/xml/security/temp/id2.xml b/samples/data/org/apache/xml/security/temp/id2.xml
new file mode 100644
index 0000000..a27d4b3
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/id2.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>

+<!DOCTYPE doc [

+<!ATTLIST e9 Id ID #IMPLIED>

+]>

+<doc>

+   <!-- A comment -->

+   <e9 Id='N3'><!-- A comment -->Das N3 Element</e9>

+   <e9 Id='id2'><!-- A comment --> Das id2 Element</e9>

+</doc> 

diff --git a/samples/data/org/apache/xml/security/temp/key/dsavalue.xml b/samples/data/org/apache/xml/security/temp/key/dsavalue.xml
new file mode 100644
index 0000000..9fa8846
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/key/dsavalue.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <P>
+    rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+    FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+    UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+  </P>
+  <Q>
+    kEjAFpCe4lcUOdwphpzf+tBaUds=
+  </Q>
+  <G>
+    oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+    SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+    BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+  </G>
+  <Y>
+    pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+    AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+    jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+  </Y>
+</DSAKeyValue>
diff --git a/samples/data/org/apache/xml/security/temp/key/retrieval-from-same-doc-key.xml b/samples/data/org/apache/xml/security/temp/key/retrieval-from-same-doc-key.xml
new file mode 100644
index 0000000..445e76a
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/key/retrieval-from-same-doc-key.xml
@@ -0,0 +1 @@
+<X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Certificate></X509Certificate></X509Data>
\ No newline at end of file
diff --git a/samples/data/org/apache/xml/security/temp/key/retrieval-from-same-doc.xml b/samples/data/org/apache/xml/security/temp/key/retrieval-from-same-doc.xml
new file mode 100644
index 0000000..5139ece
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/key/retrieval-from-same-doc.xml
@@ -0,0 +1,60 @@
+<Document>

+  <KeyMaterials Id="thecert" xmlns="http://www.xmlsecurity.org/temp/mytempns">

+    <X509Data xmlns="http://www.w3.org/2000/09/xmldsig#">

+        <X509Certificate>

+            MIICwzCCAiygAwIBAgIGAOZ75QhHMA0GCSqGSIb3DQEBBQUAMG4xCzAJBgNVBAYT

+            AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s

+            b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMRQwEgYDVQQDEwtYL1NlY3Vy

+            ZSBDQTAeFw0wMTA1MTUxMDA0NDVaFw0wMjA1MTUxMDA0MzdaMGkxCzAJBgNVBAYT

+            AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s

+            b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ8wDQYDVQQDEwZNb3JpZ3Uw

+            gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALT4FJkxu+bB5lOwYa+irIb7sJU7

+            9sRQbYYnfw35D7NQkig+Lvi2LXXoA6ABull2bF+gu+sgRzezzOs6VsTL8z57TIz2

+            48HaMInFjOiqSANmzQKlXv1PjXSxSyHRi/3xc8gMfmCxeSPCZ5VpUiQoJ5ZpWcDz

+            /LKvb0l9X0YBzMZlAgMBAAGjcTBvMA4GA1UdDwEB/wQEAwIHgDARBgNVHQ4ECgQI

+            hbis35lIcu8wNQYDVR0SBC4wLIYqaHR0cDovL3d3dy5iYWx0aW1vcmUuY29tL3By

+            b2R1Y3RzL3hzZWN1cmUvMBMGA1UdIwQMMAqACIXsHwqPfxrRMA0GCSqGSIb3DQEB

+            BQUAA4GBAGSBdPou5CWAiyS5/f46m00mIIqO3xl6ZXOc/DRblF4gWnesd2F5v/s6

+            lAbqK8+wJM6GxvpOkSp6O1q6hZRyzF86QPlXCfhKAXkgzHXtb6PfT2m9t0iawnjy

+            P+oyYofnFU5FFVOCujSrmFx3FCU+Wg6RT3v1jRoM3YfMYZYEzfTT

+        </X509Certificate>

+    </X509Data>

+  </KeyMaterials>

+  <KeyMaterials Id="hjdsbadcret" xmlns="http://www.xmlsecurity.org/temp/mytempns">

+    <X509Data xmlns="http://www.w3.org/2000/09/xmldsig#">

+        <X509Certificate>

+            This is no valid base64 encoded X509 Certificate so if the XPath

+               ancestor::my:KeyMaterials[@Id="hjdsbadcret"]

+            would have been used this wouldn't resolve to a valid key

+        </X509Certificate>

+    </X509Data>

+  </KeyMaterials>

+  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">

+    <SignedInfo>

+      <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />

+      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />

+      <Reference URI="http://www.w3.org/TR/xml-stylesheet">

+        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />

+        <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>

+      </Reference>

+    </SignedInfo>

+    <SignatureValue>

+      FnwsSCWT6REW/8QnOjv0BK+r3Ly/4aB++pNnZp9pnz8f7+j33eKSj1soyQLq5zmN

+      FwyeeQhnlTbR1kfve014ub9uHVC9A1cfmGZxQF1DC+enHt+AAPJaa278/ocgpMb5

+      Gibl4w7e3HAdBn/RJCrFJH77wY2oU5Ob0zIQtECVNJk=

+    </SignatureValue>

+    <KeyInfo>

+      <RetrievalMethod URI="" Type="http://www.w3.org/2000/09/xmldsig#X509Data">

+        <Transforms>

+          <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">

+            <XPath xmlns:my="http://www.xmlsecurity.org/temp/mytempns" 

+                   xmlns:ds="http://www.w3.org/2000/09/xmldsig#">

+               ancestor::my:KeyMaterials[@Id="thecert"]

+            </XPath>

+          </Transform>

+        </Transforms>

+      </RetrievalMethod>

+    </KeyInfo>

+  </Signature>

+</Document>

+  
\ No newline at end of file
diff --git a/samples/data/org/apache/xml/security/temp/key/signature-retrievalmethod-dsavalue.xml b/samples/data/org/apache/xml/security/temp/key/signature-retrievalmethod-dsavalue.xml
new file mode 100644
index 0000000..e24575c
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/key/signature-retrievalmethod-dsavalue.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    Fj9OwSxpJppDnihohduxEUqu9/p6TR9PpgNGapaiBHGcY2QUDBaOEw==
+  </SignatureValue>
+  <KeyInfo>
+    <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#DSAKeyValue" URI="dsavalue.xml" />
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/org/apache/xml/security/temp/key/signature-retrievalmethod-x509data.xml b/samples/data/org/apache/xml/security/temp/key/signature-retrievalmethod-x509data.xml
new file mode 100644
index 0000000..e00bd86
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/key/signature-retrievalmethod-x509data.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+  <SignedInfo>
+    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
+    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+    <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+    </Reference>
+  </SignedInfo>
+  <SignatureValue>
+    ZrROxIcOSBvt5z2krEhQGSVIo4oAwTJwGAoFiWucvvEtY9k0L2R5RVHBnHCzk5GT
+    kHGaT8SUqtnDeiH6W/2FNfciiV/w1pxURvNcyW8cYCn1B5XF68vILXUaptWf0DKw
+    DvCFS+uLh0ACuEUfpe1Dx1fwB85lpK2iQcpx9dPaC4M=
+  </SignatureValue>
+  <KeyInfo>
+    <!--
+    <X509Data>
+      <X509Certificate>
+        MIICwzCCAiygAwIBAgIGAOZ75QhHMA0GCSqGSIb3DQEBBQUAMG4xCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMRQwEgYDVQQDEwtYL1NlY3Vy
+        ZSBDQTAeFw0wMTA1MTUxMDA0NDVaFw0wMjA1MTUxMDA0MzdaMGkxCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ8wDQYDVQQDEwZNb3JpZ3Uw
+        gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALT4FJkxu+bB5lOwYa+irIb7sJU7
+        9sRQbYYnfw35D7NQkig+Lvi2LXXoA6ABull2bF+gu+sgRzezzOs6VsTL8z57TIz2
+        48HaMInFjOiqSANmzQKlXv1PjXSxSyHRi/3xc8gMfmCxeSPCZ5VpUiQoJ5ZpWcDz
+        /LKvb0l9X0YBzMZlAgMBAAGjcTBvMA4GA1UdDwEB/wQEAwIHgDARBgNVHQ4ECgQI
+        hbis35lIcu8wNQYDVR0SBC4wLIYqaHR0cDovL3d3dy5iYWx0aW1vcmUuY29tL3By
+        b2R1Y3RzL3hzZWN1cmUvMBMGA1UdIwQMMAqACIXsHwqPfxrRMA0GCSqGSIb3DQEB
+        BQUAA4GBAGSBdPou5CWAiyS5/f46m00mIIqO3xl6ZXOc/DRblF4gWnesd2F5v/s6
+        lAbqK8+wJM6GxvpOkSp6O1q6hZRyzF86QPlXCfhKAXkgzHXtb6PfT2m9t0iawnjy
+        P+oyYofnFU5FFVOCujSrmFx3FCU+Wg6RT3v1jRoM3YfMYZYEzfTT
+      </X509Certificate>
+    </X509Data>
+    -->
+    <RetrievalMethod URI="./x509data.xml" />
+    <!-- Type="http://www.w3.org/2000/09/xmldsig#X509Data"  -->
+  </KeyInfo>
+</Signature>
diff --git a/samples/data/org/apache/xml/security/temp/key/x509data.xml b/samples/data/org/apache/xml/security/temp/key/x509data.xml
new file mode 100644
index 0000000..2a73f15
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/key/x509data.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<X509Data xmlns="http://www.w3.org/2000/09/xmldsig#">
+    <X509Certificate>
+        MIICwzCCAiygAwIBAgIGAOZ75QhHMA0GCSqGSIb3DQEBBQUAMG4xCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMRQwEgYDVQQDEwtYL1NlY3Vy
+        ZSBDQTAeFw0wMTA1MTUxMDA0NDVaFw0wMjA1MTUxMDA0MzdaMGkxCzAJBgNVBAYT
+        AklFMQ8wDQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9s
+        b2dpZXMsIEx0ZC4xETAPBgNVBAsTCFgvU2VjdXJlMQ8wDQYDVQQDEwZNb3JpZ3Uw
+        gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALT4FJkxu+bB5lOwYa+irIb7sJU7
+        9sRQbYYnfw35D7NQkig+Lvi2LXXoA6ABull2bF+gu+sgRzezzOs6VsTL8z57TIz2
+        48HaMInFjOiqSANmzQKlXv1PjXSxSyHRi/3xc8gMfmCxeSPCZ5VpUiQoJ5ZpWcDz
+        /LKvb0l9X0YBzMZlAgMBAAGjcTBvMA4GA1UdDwEB/wQEAwIHgDARBgNVHQ4ECgQI
+        hbis35lIcu8wNQYDVR0SBC4wLIYqaHR0cDovL3d3dy5iYWx0aW1vcmUuY29tL3By
+        b2R1Y3RzL3hzZWN1cmUvMBMGA1UdIwQMMAqACIXsHwqPfxrRMA0GCSqGSIb3DQEB
+        BQUAA4GBAGSBdPou5CWAiyS5/f46m00mIIqO3xl6ZXOc/DRblF4gWnesd2F5v/s6
+        lAbqK8+wJM6GxvpOkSp6O1q6hZRyzF86QPlXCfhKAXkgzHXtb6PfT2m9t0iawnjy
+        P+oyYofnFU5FFVOCujSrmFx3FCU+Wg6RT3v1jRoM3YfMYZYEzfTT
+    </X509Certificate>
+</X509Data>
diff --git a/samples/data/org/apache/xml/security/temp/nuehomepage b/samples/data/org/apache/xml/security/temp/nuehomepage
new file mode 100644
index 0000000..0cce7df
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/nuehomepage
@@ -0,0 +1,29 @@
+<HTML>

+<HEAD>

+	<!-- Style sheet added (21.09.99)-->

+	<link rel="stylesheet" type="text/css" href="NUE_Style.css">

+<!-- Last modification: 10.11.98 by Niko Schweitzer -->

+	<META Name="description" Content="Institut fuer Nachrichtenuebermittlung, UNI-Siegen">

+   <META Name="keywords" Content="UNI,Siegen,Institut,Nachrichtenübermittlung,Institute,Data,Communications,Security,Sicherheit,Kryptographie,Cryptography,Digitale,Mobilfunksysteme,Digital,Communication,Information,ATM,GSM,PDH,SDH,PKI,Access,Rights,Profile,Certificate,Management">

+   <META NAME="Content-Language" CONTENT="de"> 

+

+<!------------------------------------------------------------------>

+<title>Home-Page des Instituts fuer Nachrichtenuebermittlung</title>

+<!------------------------------------------------------------------>

+

+

+<FRAMESET COLS="170,*" BORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 FRAMESPACING=0>

+	<FRAME NAME="contents_frame" SRC="contents.html" SCROLLING="Auto" BORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 FRAMESPACING=0>

+	<FRAMESET ><!--ROWS="80,*"> -->

+		<!-- <frame name="header_frame" src="header.html" scrolling="No" FRAMEBORDER="No"> -->

+		<frame name="main_frame" src="start.html" scrolling="Auto" FRAMEBORDER="No">

+	</FRAMESET>

+</FRAMESET>

+

+

+</HEAD>

+

+<BODY> 

+

+</BODY>

+</HTML>
\ No newline at end of file
diff --git a/samples/data/org/apache/xml/security/temp/signature/signature-bad-c14n-algo.xml b/samples/data/org/apache/xml/security/temp/signature/signature-bad-c14n-algo.xml
new file mode 100644
index 0000000..edc297b
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/signature/signature-bad-c14n-algo.xml
@@ -0,0 +1,55 @@
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.apache.org/bad-c14n-algo"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"></ds:SignatureMethod>
+<ds:Reference URI="#TheFirstObject">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>ipbs0UyafkdRIcfIo9zyZLce+CE=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>W1C5ZT2nQwXd+zIeZ1NUFjx5qn0ERyiLnSeYSS+FDG9yOpK1FK8AVA==</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:X509Data>
+<ds:X509Certificate>
+MIIC9jCCArQCBDruqiowCwYHKoZIzjgEAwUAMGExCzAJBgNVBAYTAkRFMR0wGwYDVQQKExRVbml2
+ZXJzaXR5IG9mIFNpZWdlbjEQMA4GA1UECxMHRkIxMk5VRTEhMB8GA1UEAxMYQ2hyaXN0aWFuIEdl
+dWVyLVBvbGxtYW5uMB4XDTAxMDUwMTEyMjA1OFoXDTA2MTAyMjEyMjA1OFowYTELMAkGA1UEBhMC
+REUxHTAbBgNVBAoTFFVuaXZlcnNpdHkgb2YgU2llZ2VuMRAwDgYDVQQLEwdGQjEyTlVFMSEwHwYD
+VQQDExhDaHJpc3RpYW4gR2V1ZXItUG9sbG1hbm4wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9T
+gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv
+8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX
+Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSv
+u/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64e
+K7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAAC
+gYASWfn+G1k/nWntj9jX7Nk5JKaiLZ9BLR16eJJxqff33THLfdGs98Xmh2oRWZVh9PMV8oTP3hpR
+cRipjZUZVEIqsBlOGTVLCg4H5TJ81JWOiprh+mkhClNqUr8l5Hu7FBSvQB6inryeva7j0aKNiIvK
+8vfHTiUZpnyNRhkveBlM0jALBgcqhkjOOAQDBQADLwAwLAIUPDd/UmB9GeHqvGjny30Bvjt0AkUC
+FA9ab72kKuB5geYGeckbBrcgPnZk
+</ds:X509Certificate>
+</ds:X509Data>
+<ds:KeyValue>
+<ds:DSAKeyValue>
+<ds:P>
+/X9TgR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuA
+HTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOu
+K2HXKu/yIgMZndFIAcc=
+</ds:P>
+<ds:Q>l2BQjxUjC8yykrmCouuEC/BYHPU=</ds:Q>
+<ds:G>
+9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3
+zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKL
+Zl6Ae1UlZAFMO/7PSSo=
+</ds:G>
+<ds:Y>
+Eln5/htZP51p7Y/Y1+zZOSSmoi2fQS0deniScan3990xy33RrPfF5odqEVmVYfTzFfKEz94aUXEY
+qY2VGVRCKrAZThk1SwoOB+UyfNSVjoqa4fppIQpTalK/JeR7uxQUr0Aeop68nr2u49GijYiLyvL3
+x04lGaZ8jUYZL3gZTNI=
+</ds:Y>
+</ds:DSAKeyValue>
+</ds:KeyValue>
+</ds:KeyInfo>
+<ds:Object Id="TheFirstObject"><InsideObject>A text in a box</InsideObject></ds:Object>
+</ds:Signature>
diff --git a/samples/data/org/apache/xml/security/temp/signature/signature-bad-sig-algo.xml b/samples/data/org/apache/xml/security/temp/signature/signature-bad-sig-algo.xml
new file mode 100644
index 0000000..5dabe5e
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/signature/signature-bad-sig-algo.xml
@@ -0,0 +1,55 @@
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.apache.org/bad-sig-algo"></ds:SignatureMethod>
+<ds:Reference URI="#TheFirstObject">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>ipbs0UyafkdRIcfIo9zyZLce+CE=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>W1C5ZT2nQwXd+zIeZ1NUFjx5qn0ERyiLnSeYSS+FDG9yOpK1FK8AVA==</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:X509Data>
+<ds:X509Certificate>
+MIIC9jCCArQCBDruqiowCwYHKoZIzjgEAwUAMGExCzAJBgNVBAYTAkRFMR0wGwYDVQQKExRVbml2
+ZXJzaXR5IG9mIFNpZWdlbjEQMA4GA1UECxMHRkIxMk5VRTEhMB8GA1UEAxMYQ2hyaXN0aWFuIEdl
+dWVyLVBvbGxtYW5uMB4XDTAxMDUwMTEyMjA1OFoXDTA2MTAyMjEyMjA1OFowYTELMAkGA1UEBhMC
+REUxHTAbBgNVBAoTFFVuaXZlcnNpdHkgb2YgU2llZ2VuMRAwDgYDVQQLEwdGQjEyTlVFMSEwHwYD
+VQQDExhDaHJpc3RpYW4gR2V1ZXItUG9sbG1hbm4wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9T
+gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv
+8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX
+Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSv
+u/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64e
+K7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAAC
+gYASWfn+G1k/nWntj9jX7Nk5JKaiLZ9BLR16eJJxqff33THLfdGs98Xmh2oRWZVh9PMV8oTP3hpR
+cRipjZUZVEIqsBlOGTVLCg4H5TJ81JWOiprh+mkhClNqUr8l5Hu7FBSvQB6inryeva7j0aKNiIvK
+8vfHTiUZpnyNRhkveBlM0jALBgcqhkjOOAQDBQADLwAwLAIUPDd/UmB9GeHqvGjny30Bvjt0AkUC
+FA9ab72kKuB5geYGeckbBrcgPnZk
+</ds:X509Certificate>
+</ds:X509Data>
+<ds:KeyValue>
+<ds:DSAKeyValue>
+<ds:P>
+/X9TgR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuA
+HTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOu
+K2HXKu/yIgMZndFIAcc=
+</ds:P>
+<ds:Q>l2BQjxUjC8yykrmCouuEC/BYHPU=</ds:Q>
+<ds:G>
+9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3
+zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKL
+Zl6Ae1UlZAFMO/7PSSo=
+</ds:G>
+<ds:Y>
+Eln5/htZP51p7Y/Y1+zZOSSmoi2fQS0deniScan3990xy33RrPfF5odqEVmVYfTzFfKEz94aUXEY
+qY2VGVRCKrAZThk1SwoOB+UyfNSVjoqa4fppIQpTalK/JeR7uxQUr0Aeop68nr2u49GijYiLyvL3
+x04lGaZ8jUYZL3gZTNI=
+</ds:Y>
+</ds:DSAKeyValue>
+</ds:KeyValue>
+</ds:KeyInfo>
+<ds:Object Id="TheFirstObject"><InsideObject>A text in a box</InsideObject></ds:Object>
+</ds:Signature>
diff --git a/samples/data/org/apache/xml/security/temp/signature/signature-bad-transform-algo.xml b/samples/data/org/apache/xml/security/temp/signature/signature-bad-transform-algo.xml
new file mode 100644
index 0000000..32c4713
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/signature/signature-bad-transform-algo.xml
@@ -0,0 +1,55 @@
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"></ds:SignatureMethod>
+<ds:Reference URI="#TheFirstObject">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.apache.org/bad-transform-algo"></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>ipbs0UyafkdRIcfIo9zyZLce+CE=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>W1C5ZT2nQwXd+zIeZ1NUFjx5qn0ERyiLnSeYSS+FDG9yOpK1FK8AVA==</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:X509Data>
+<ds:X509Certificate>
+MIIC9jCCArQCBDruqiowCwYHKoZIzjgEAwUAMGExCzAJBgNVBAYTAkRFMR0wGwYDVQQKExRVbml2
+ZXJzaXR5IG9mIFNpZWdlbjEQMA4GA1UECxMHRkIxMk5VRTEhMB8GA1UEAxMYQ2hyaXN0aWFuIEdl
+dWVyLVBvbGxtYW5uMB4XDTAxMDUwMTEyMjA1OFoXDTA2MTAyMjEyMjA1OFowYTELMAkGA1UEBhMC
+REUxHTAbBgNVBAoTFFVuaXZlcnNpdHkgb2YgU2llZ2VuMRAwDgYDVQQLEwdGQjEyTlVFMSEwHwYD
+VQQDExhDaHJpc3RpYW4gR2V1ZXItUG9sbG1hbm4wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9T
+gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv
+8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX
+Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSv
+u/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64e
+K7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAAC
+gYASWfn+G1k/nWntj9jX7Nk5JKaiLZ9BLR16eJJxqff33THLfdGs98Xmh2oRWZVh9PMV8oTP3hpR
+cRipjZUZVEIqsBlOGTVLCg4H5TJ81JWOiprh+mkhClNqUr8l5Hu7FBSvQB6inryeva7j0aKNiIvK
+8vfHTiUZpnyNRhkveBlM0jALBgcqhkjOOAQDBQADLwAwLAIUPDd/UmB9GeHqvGjny30Bvjt0AkUC
+FA9ab72kKuB5geYGeckbBrcgPnZk
+</ds:X509Certificate>
+</ds:X509Data>
+<ds:KeyValue>
+<ds:DSAKeyValue>
+<ds:P>
+/X9TgR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuA
+HTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOu
+K2HXKu/yIgMZndFIAcc=
+</ds:P>
+<ds:Q>l2BQjxUjC8yykrmCouuEC/BYHPU=</ds:Q>
+<ds:G>
+9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3
+zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKL
+Zl6Ae1UlZAFMO/7PSSo=
+</ds:G>
+<ds:Y>
+Eln5/htZP51p7Y/Y1+zZOSSmoi2fQS0deniScan3990xy33RrPfF5odqEVmVYfTzFfKEz94aUXEY
+qY2VGVRCKrAZThk1SwoOB+UyfNSVjoqa4fppIQpTalK/JeR7uxQUr0Aeop68nr2u49GijYiLyvL3
+x04lGaZ8jUYZL3gZTNI=
+</ds:Y>
+</ds:DSAKeyValue>
+</ds:KeyValue>
+</ds:KeyInfo>
+<ds:Object Id="TheFirstObject"><InsideObject>A text in a box</InsideObject></ds:Object>
+</ds:Signature>
diff --git a/samples/data/org/apache/xml/security/temp/signature/signature-good.xml b/samples/data/org/apache/xml/security/temp/signature/signature-good.xml
new file mode 100644
index 0000000..13e33ac
--- /dev/null
+++ b/samples/data/org/apache/xml/security/temp/signature/signature-good.xml
@@ -0,0 +1,55 @@
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"></ds:SignatureMethod>
+<ds:Reference URI="#TheFirstObject">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>ipbs0UyafkdRIcfIo9zyZLce+CE=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>W1C5ZT2nQwXd+zIeZ1NUFjx5qn0ERyiLnSeYSS+FDG9yOpK1FK8AVA==</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:X509Data>
+<ds:X509Certificate>
+MIIC9jCCArQCBDruqiowCwYHKoZIzjgEAwUAMGExCzAJBgNVBAYTAkRFMR0wGwYDVQQKExRVbml2
+ZXJzaXR5IG9mIFNpZWdlbjEQMA4GA1UECxMHRkIxMk5VRTEhMB8GA1UEAxMYQ2hyaXN0aWFuIEdl
+dWVyLVBvbGxtYW5uMB4XDTAxMDUwMTEyMjA1OFoXDTA2MTAyMjEyMjA1OFowYTELMAkGA1UEBhMC
+REUxHTAbBgNVBAoTFFVuaXZlcnNpdHkgb2YgU2llZ2VuMRAwDgYDVQQLEwdGQjEyTlVFMSEwHwYD
+VQQDExhDaHJpc3RpYW4gR2V1ZXItUG9sbG1hbm4wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9T
+gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv
+8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX
+Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSv
+u/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64e
+K7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAAC
+gYASWfn+G1k/nWntj9jX7Nk5JKaiLZ9BLR16eJJxqff33THLfdGs98Xmh2oRWZVh9PMV8oTP3hpR
+cRipjZUZVEIqsBlOGTVLCg4H5TJ81JWOiprh+mkhClNqUr8l5Hu7FBSvQB6inryeva7j0aKNiIvK
+8vfHTiUZpnyNRhkveBlM0jALBgcqhkjOOAQDBQADLwAwLAIUPDd/UmB9GeHqvGjny30Bvjt0AkUC
+FA9ab72kKuB5geYGeckbBrcgPnZk
+</ds:X509Certificate>
+</ds:X509Data>
+<ds:KeyValue>
+<ds:DSAKeyValue>
+<ds:P>
+/X9TgR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuA
+HTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOu
+K2HXKu/yIgMZndFIAcc=
+</ds:P>
+<ds:Q>l2BQjxUjC8yykrmCouuEC/BYHPU=</ds:Q>
+<ds:G>
+9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3
+zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKL
+Zl6Ae1UlZAFMO/7PSSo=
+</ds:G>
+<ds:Y>
+Eln5/htZP51p7Y/Y1+zZOSSmoi2fQS0deniScan3990xy33RrPfF5odqEVmVYfTzFfKEz94aUXEY
+qY2VGVRCKrAZThk1SwoOB+UyfNSVjoqa4fppIQpTalK/JeR7uxQUr0Aeop68nr2u49GijYiLyvL3
+x04lGaZ8jUYZL3gZTNI=
+</ds:Y>
+</ds:DSAKeyValue>
+</ds:KeyValue>
+</ds:KeyInfo>
+<ds:Object Id="TheFirstObject"><InsideObject>A text in a box</InsideObject></ds:Object>
+</ds:Signature>
diff --git a/samples/data/org/w3c/www/TR/2000/REC-xml-20001006 b/samples/data/org/w3c/www/TR/2000/REC-xml-20001006
new file mode 100644
index 0000000..cc363b0
--- /dev/null
+++ b/samples/data/org/w3c/www/TR/2000/REC-xml-20001006
@@ -0,0 +1,3156 @@
+<?xml version="1.0" encoding="iso-8859-1"?>

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

+<!--ArborText, Inc., 1988-2000, v.4002-->

+<html lang="EN">

+<head>

+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>

+<title>Extensible Markup Language (XML) 1.0 (Second Edition)</title>

+<link href="http://www.w3.org/StyleSheets/TR/W3C-REC.css" type="text/css"

+rel="stylesheet"/>

+<style type="text/css"> code           { font-family: monospace; }  div.constraint,

+div.issue, div.note, div.notice     { margin-left: 2em; }  dt.label      

+{ display: run-in; }  li p           { margin-top: 0.3em;                

+ margin-bottom: 0.3em; } </style>

+</head>

+<body>  <div class="head"><p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home"

+alt="W3C" height="48" width="72"/></a></p><h1>Extensible Markup Language (XML)

+1.0 (Second Edition)</h1>

+<h2>W3C Recommendation 6 October 2000</h2><dl>

+<dt>This version:</dt>

+<dd><a href="http://www.w3.org/TR/2000/REC-xml-20001006">http://www.w3.org/TR/2000/REC-xml-20001006</a>

+(<a href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XHTML</a>, <a href="http://www.w3.org/TR/2000/REC-xml-20001006.xml">XML</a>, <a

+href="http://www.w3.org/TR/2000/REC-xml-20001006.pdf">PDF</a>, <a href="http://www.w3.org/TR/2000/REC-xml-20001006-review.html">XHTML

+review version</a> with color-coded revision indicators)</dd>

+<dt>Latest version:</dt>

+<dd><a href="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</a></dd>

+<dt>Previous versions:</dt>

+<dd><a href="http://www.w3.org/TR/2000/WD-xml-2e-20000814"> http://www.w3.org/TR/2000/WD-xml-2e-20000814</a> </dd>

+<dd><a href="http://www.w3.org/TR/1998/REC-xml-19980210"> http://www.w3.org/TR/1998/REC-xml-19980210</a> </dd>

+<dt>Editors:</dt>

+<dd>Tim Bray, Textuality and Netscape  <a href="mailto:tbray@textuality.com">&lt;tbray@textuality.com></a></dd>

+<dd>Jean Paoli, Microsoft  <a href="mailto:jeanpa@microsoft.com">&lt;jeanpa@microsoft.com></a></dd>

+<dd>C. M. Sperberg-McQueen, University of Illinois at Chicago and Text Encoding

+Initiative <a href="mailto:cmsmcq@uic.edu">&lt;cmsmcq@uic.edu></a> </dd>

+<dd>Eve Maler, Sun Microsystems, Inc. <a href="mailto:elm@east.sun.com">&lt;eve.maler@east.sun.com></a>

+ - Second Edition</dd>

+</dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>&nbsp;&copy;&nbsp;2000&nbsp;<a

+href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup>

+(<a href="http://www.lcs.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a

+href="http://www.inria.fr/"><abbr title="Institut National de Recherche en Informatique et Automatique"

+lang="fr">INRIA</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All

+Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a

+href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>, <a

+href="http://www.w3.org/Consortium/Legal/copyright-documents-19990405">document

+use</a>, and <a href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">software

+licensing</a> rules apply.</p></div><hr class="html_compat"/><div><h2><a

+name="abstract">Abstract</a></h2> <p>The Extensible Markup Language (XML)

+is a subset of SGML that is completely described in this document. Its goal

+is to enable generic SGML to be served, received, and processed on the Web

+in the way that is now possible with HTML. XML has been designed for ease

+of implementation and for interoperability with both SGML and HTML.</p> </div><div>

+<h2><a name="status">Status of this Document</a></h2> <p>This

+document has been reviewed by W3C Members and other interested parties and

+has been endorsed by the Director as a W3C Recommendation. It is a stable

+document and may be used as reference material or cited as a normative reference

+from another document. W3C's role in making the Recommendation is to draw

+attention to the specification and to promote its widespread deployment. This

+enhances the functionality and interoperability of the Web.</p> <p>This document

+specifies a syntax created by subsetting an existing, widely used international

+text processing standard (Standard Generalized Markup Language, ISO 8879:1986(E)

+as amended and corrected) for use on the World Wide Web. It is a product of

+the W3C XML Activity, details of which can be found at <a href="http://www.w3.org/XML/">http://www.w3.org/XML</a>.

+ The English version of this specification is the only normative version.

+However, for translations of this document, see <a href="http://www.w3.org/XML/#trans">http://www.w3.org/XML/#trans</a>.

+A list of current W3C Recommendations and other technical documents can be

+found at <a href="http://www.w3.org/TR/">http://www.w3.org/TR</a>.</p>  <p>This

+second edition is <em>not</em> a new version of XML (first published 10 February 1998); it merely incorporates

+the changes dictated by the first-edition errata (available at <a href="http://www.w3.org/XML/xml-19980210-errata">http://www.w3.org/XML/xml-19980210-errata</a

+>) as a convenience to readers. The errata list for this second edition is

+available at <a href="http://www.w3.org/XML/xml-V10-2e-errata">http://www.w3.org/XML/xml-V10-2e-errata</a>.</p> <p>Please

+report errors in this document to <a href="mailto:xml-editor@w3.org">xml-editor@w3.org</a>; <a

+href="http://lists.w3.org/Archives/Public/xml-editor">archives</a> are available.</p> <div

+class="note"><p class="prefix"><b>Note:</b></p> <p>C. M. Sperberg-McQueen's

+affiliation has changed since the publication of the first edition. He is

+now at the World Wide Web Consortium, and can be contacted at <a href="mailto:cmsmcq@w3.org">cmsmcq@w3.org</a>.</p> </div> </div> <div

+class="toc"><h2><a name="contents">Table of Contents</a></h2><p class="toc">1 <a

+href="#sec-intro">Introduction</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;1.1 <a

+href="#sec-origin-goals">Origin and Goals</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;1.2 <a

+href="#sec-terminology">Terminology</a><br class="html_compat"/>2 <a href="#sec-documents">Documents</a><br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.1 <a href="#sec-well-formed">Well-Formed

+XML Documents</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.2 <a href="#charsets">Characters</a><br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.3 <a href="#sec-common-syn">Common

+Syntactic Constructs</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.4 <a

+href="#syntax">Character Data and Markup</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.5 <a

+href="#sec-comments">Comments</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.6 <a

+href="#sec-pi">Processing Instructions</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.7 <a

+href="#sec-cdata-sect">CDATA Sections</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.8 <a

+href="#sec-prolog-dtd">Prolog and Document Type Declaration</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.9 <a

+href="#sec-rmd">Standalone Document Declaration</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.10 <a

+href="#sec-white-space">White Space Handling</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.11 <a

+href="#sec-line-ends">End-of-Line Handling</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;2.12 <a

+href="#sec-lang-tag">Language Identification</a><br class="html_compat"/>3 <a

+href="#sec-logical-struct">Logical Structures</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;3.1 <a

+href="#sec-starttags">Start-Tags, End-Tags, and Empty-Element Tags</a><br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;3.2 <a href="#elemdecls">Element

+Type Declarations</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.2.1 <a

+href="#sec-element-content">Element Content</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.2.2 <a

+href="#sec-mixed-content">Mixed Content</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;3.3 <a

+href="#attdecls">Attribute-List Declarations</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.3.1 <a

+href="#sec-attribute-types">Attribute Types</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.3.2 <a

+href="#sec-attr-defaults">Attribute Defaults</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.3.3 <a

+href="#AVNormalize">Attribute-Value Normalization</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;3.4 <a

+href="#sec-condition-sect">Conditional Sections</a><br class="html_compat"/>4 <a

+href="#sec-physical-struct">Physical Structures</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.1 <a

+href="#sec-references">Character and Entity References</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.2 <a

+href="#sec-entity-decl">Entity Declarations</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.2.1 <a

+href="#sec-internal-ent">Internal Entities</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.2.2 <a

+href="#sec-external-ent">External Entities</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.3 <a

+href="#TextEntities">Parsed Entities</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.3.1 <a

+href="#sec-TextDecl">The Text Declaration</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.3.2 <a

+href="#wf-entities">Well-Formed Parsed Entities</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.3.3 <a

+href="#charencoding">Character Encoding in Entities</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.4 <a

+href="#entproc">XML Processor Treatment of Entities and References</a><br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.1 <a

+href="#not-recognized">Not Recognized</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.2 <a

+href="#included">Included</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.3 <a

+href="#include-if-valid">Included If Validating</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.4 <a

+href="#forbidden">Forbidden</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.5 <a

+href="#inliteral">Included in Literal</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.6 <a

+href="#notify">Notify</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.7 <a

+href="#bypass">Bypassed</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.4.8 <a

+href="#as-PE">Included as PE</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.5 <a

+href="#intern-replacement">Construction of Internal Entity Replacement Text</a><br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.6 <a href="#sec-predefined-ent">Predefined

+Entities</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.7 <a href="#Notations">Notation

+Declarations</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;4.8 <a href="#sec-doc-entity">Document

+Entity</a><br class="html_compat"/>5 <a href="#sec-conformance">Conformance</a><br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;5.1 <a href="#proc-types">Validating

+and Non-Validating Processors</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;5.2 <a

+href="#safe-behavior">Using XML Processors</a><br class="html_compat"/>6 <a

+href="#sec-notation">Notation</a><br class="html_compat"/></p><h3>Appendices</h3><p

+class="toc">A <a href="#sec-bibliography">References</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;A.1 <a

+href="#sec-existing-stds">Normative References</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;A.2 <a

+href="#null">Other References</a><br class="html_compat"/>B <a href="#CharClasses">Character

+Classes</a><br class="html_compat"/>C <a href="#sec-xml-and-sgml">XML and

+SGML</a> (Non-Normative)<br class="html_compat"/>D <a href="#sec-entexpand">Expansion

+of Entity and Character References</a> (Non-Normative)<br class="html_compat"/>E <a

+href="#determinism">Deterministic Content Models</a> (Non-Normative)<br class="html_compat"/>F <a

+href="#sec-guessing">Autodetection of Character Encodings</a> (Non-Normative)<br

+class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;F.1 <a href="#sec-guessing-no-ext-info">Detection

+Without External Encoding Information</a><br class="html_compat"/>&nbsp;&nbsp;&nbsp;&nbsp;F.2 <a

+href="#sec-guessing-with-ext-info">Priorities in the Presence of External

+Encoding Information</a><br class="html_compat"/>G <a href="#sec-xml-wg">W3C

+XML Working Group</a> (Non-Normative)<br class="html_compat"/>H <a href="#sec-core-wg">W3C

+XML Core Group</a> (Non-Normative)<br class="html_compat"/>I <a href="#b4d250b6c21">Production

+Notes</a> (Non-Normative)<br class="html_compat"/></p></div><hr class="html_compat"/><div

+class="body"> <div class="div1"> <h2><a name="sec-intro"></a>1 Introduction</h2> <p>Extensible

+Markup Language, abbreviated XML, describes a class of data objects called <a

+title="XML Document" href="#dt-xml-doc">XML documents</a> and partially describes

+the behavior of computer programs which process them. XML is an application

+profile or restricted form of SGML, the Standard Generalized Markup Language <a

+href="#ISO8879">[ISO 8879]</a>. By construction, XML documents are conforming

+SGML documents.</p> <p>XML documents are made up of storage units called <a

+title="Entity" href="#dt-entity">entities</a>, which contain either parsed

+or unparsed data. Parsed data is made up of <a title="Character" href="#dt-character">characters</a>,

+some of which form <a title="Character Data" href="#dt-chardata">character

+data</a>, and some of which form <a title="Markup" href="#dt-markup">markup</a>.

+Markup encodes a description of the document's storage layout and logical

+structure. XML provides a mechanism to impose constraints on the storage layout

+and logical structure.</p> <p>[<a title="XML Processor" name="dt-xml-proc">Definition</a>:

+A software module called an <b>XML processor</b> is used to read XML documents

+and provide access to their content and structure.] [<a title="Application"

+name="dt-app">Definition</a>: It is assumed that an XML processor is doing

+its work on behalf of another module, called the <b>application</b>.] This

+specification describes the required behavior of an XML processor in terms

+of how it must read XML data and the information it must provide to the application.</p> <div

+class="div2"> <h3><a name="sec-origin-goals"></a>1.1 Origin and Goals</h3> <p>XML

+was developed by an XML Working Group (originally known as the SGML Editorial

+Review Board) formed under the auspices of the World Wide Web Consortium (W3C)

+in 1996. It was chaired by Jon Bosak of Sun Microsystems with the active participation

+of an XML Special Interest Group (previously known as the SGML Working Group)

+also organized by the W3C. The membership of the XML Working Group is given

+in an appendix. Dan Connolly served as the WG's contact with the W3C.</p> <p>The

+design goals for XML are:</p> <ol>

+<li><p>XML shall be straightforwardly usable over the Internet.</p></li>

+<li><p>XML shall support a wide variety of applications.</p></li>

+<li><p>XML shall be compatible with SGML.</p></li>

+<li><p>It shall be easy to write programs which process XML documents.</p> </li>

+<li><p>The number of optional features in XML is to be kept to the absolute

+minimum, ideally zero.</p></li>

+<li><p>XML documents should be human-legible and reasonably clear.</p></li>

+<li><p>The XML design should be prepared quickly.</p></li>

+<li><p>The design of XML shall be formal and concise.</p></li>

+<li><p>XML documents shall be easy to create.</p></li>

+<li><p>Terseness in XML markup is of minimal importance.</p></li>

+</ol> <p>This specification, together with associated standards (Unicode and

+ISO/IEC 10646 for characters, Internet RFC 1766 for language identification

+tags, ISO 639 for language name codes, and ISO 3166 for country name codes),

+provides all the information necessary to understand XML Version 1.0 and construct

+computer programs to process it.</p> <p>This version of the XML specification

+ may be distributed freely, as long as all text and legal notices remain intact.</p> </div> <div

+class="div2"> <h3><a name="sec-terminology"></a>1.2 Terminology</h3> <p>The

+terminology used to describe XML documents is defined in the body of this

+specification. The terms defined in the following list are used in building

+those definitions and in describing the actions of an XML processor: </p><dl>

+<dt class="label">may</dt>

+<dd> <p>[<a title="May" name="dt-may">Definition</a>: Conforming documents

+and XML processors are permitted to but need not behave as described.]</p> </dd>

+<dt class="label">must</dt>

+<dd> <p>[<a title="Must" name="dt-must">Definition</a>: Conforming documents

+and XML processors are required to behave as described; otherwise they are

+in error. ]</p> </dd>

+<dt class="label">error</dt>

+<dd> <p>[<a title="Error" name="dt-error">Definition</a>: A violation of the

+rules of this specification; results are undefined. Conforming software may

+detect and report an error and may recover from it.]</p> </dd>

+<dt class="label">fatal error</dt>

+<dd> <p>[<a title="Fatal Error" name="dt-fatal">Definition</a>: An error which

+a conforming <a title="XML Processor" href="#dt-xml-proc">XML processor</a>

+must detect and report to the application. After encountering a fatal error,

+the processor may continue processing the data to search for further errors

+and may report such errors to the application. In order to support correction

+of errors, the processor may make unprocessed data from the document (with

+intermingled character data and markup) available to the application. Once

+a fatal error is detected, however, the processor must not continue normal

+processing (i.e., it must not continue to pass character data and information

+about the document's logical structure to the application in the normal way).]</p> </dd>

+<dt class="label">at user option</dt>

+<dd> <p>[<a title="At user option" name="dt-atuseroption">Definition</a>:

+Conforming software may or must (depending on the modal verb in the sentence)

+behave as described; if it does, it must provide users a means to enable or

+disable the behavior described.]</p> </dd>

+<dt class="label">validity constraint</dt>

+<dd> <p>[<a title="Validity constraint" name="dt-vc">Definition</a>: A rule

+which applies to all <a title="Validity" href="#dt-valid">valid</a> XML documents.

+Violations of validity constraints are errors; they must, at user option,

+be reported by <a title="Validating Processor" href="#dt-validating">validating

+XML processors</a>.]</p> </dd>

+<dt class="label">well-formedness constraint</dt>

+<dd> <p>[<a title="Well-formedness constraint" name="dt-wfc">Definition</a>:

+A rule which applies to all <a title="Well-Formed" href="#dt-wellformed">well-formed</a>

+XML documents. Violations of well-formedness constraints are <a title="Fatal Error"

+href="#dt-fatal">fatal errors</a>.]</p> </dd>

+<dt class="label">match</dt>

+<dd> <p>[<a title="match" name="dt-match">Definition</a>: (Of strings or names:)

+Two strings or names being compared must be identical. Characters with multiple

+possible representations in ISO/IEC 10646 (e.g. characters with both precomposed

+and base+diacritic forms) match only if they have the same representation

+in both strings. No case folding is performed. (Of strings and rules in the

+grammar:) A string matches a grammatical production if it belongs to the language

+generated by that production. (Of content and content models:) An element

+matches its declaration when it conforms in the fashion described in the constraint <a

+href="#elementvalid"><b>[VC: Element Valid]</b></a>.]</p> </dd>

+<dt class="label">for compatibility</dt>

+<dd> <p>[<a title="For Compatibility" name="dt-compat">Definition</a>: Marks

+a sentence describing a feature of XML included solely to ensure that XML

+remains compatible with SGML.]</p> </dd>

+<dt class="label">for interoperability</dt>

+<dd> <p>[<a title="For interoperability" name="dt-interop">Definition</a>:

+Marks a sentence describing a non-binding recommendation included to increase

+the chances that XML documents can be processed by the existing installed

+base of SGML processors which predate the WebSGML Adaptations Annex to ISO

+8879.]</p> </dd>

+</dl><p></p> </div> </div>  <div class="div1"> <h2><a name="sec-documents"></a>2

+Documents</h2> <p>[<a title="XML Document" name="dt-xml-doc">Definition</a>:

+ A data object is an <b>XML document</b> if it is <a title="Well-Formed" href="#dt-wellformed">well-formed</a>,

+as defined in this specification. A well-formed XML document may in addition

+be <a title="Validity" href="#dt-valid">valid</a> if it meets certain further

+constraints.]</p> <p>Each XML document has both a logical and a physical structure.

+Physically, the document is composed of units called <a title="Entity" href="#dt-entity">entities</a>.

+An entity may <a title="Entity Reference" href="#dt-entref">refer</a> to other

+entities to cause their inclusion in the document. A document begins in a

+"root" or <a title="Document Entity" href="#dt-docent">document entity</a>.

+Logically, the document is composed of declarations, elements, comments, character

+references, and processing instructions, all of which are indicated in the

+document by explicit markup. The logical and physical structures must nest

+properly, as described in <a href="#wf-entities"><b>4.3.2 Well-Formed Parsed

+Entities</b></a>.</p> <div class="div2"> <h3><a name="sec-well-formed"></a>2.1

+Well-Formed XML Documents</h3> <p>[<a title="Well-Formed" name="dt-wellformed">Definition</a>:

+ A textual object is a <b>well-formed</b> XML document if:]</p> <ol>

+<li><p>Taken as a whole, it matches the production labeled <a href="#NT-document">document</a>.</p> </li>

+<li><p>It meets all the well-formedness constraints given in this specification.</p> </li>

+<li><p>Each of the <a title="Text Entity" href="#dt-parsedent">parsed entities</a>

+which is referenced directly or indirectly within the document is <a title="Well-Formed"

+href="#dt-wellformed">well-formed</a>.</p></li>

+</ol> <h5>Document</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-document"></a>[1]&nbsp;&nbsp;&nbsp;</td>

+<td><code>document</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-prolog">prolog</a> <a href="#NT-element">element</a> <a

+href="#NT-Misc">Misc</a>*</code></td>

+</tr>

+</tbody></table> <p>Matching the <a href="#NT-document">document</a> production

+implies that:</p> <ol>

+<li><p>It contains one or more <a title="Element" href="#dt-element">elements</a>.</p> </li>

+<li><p>[<a title="Root Element" name="dt-root">Definition</a>: There is exactly

+one element, called the <b>root</b>, or document element, no part of which

+appears in the <a title="Content" href="#dt-content">content</a> of any other

+element.] For all other elements, if the <a title="Start-Tag" href="#dt-stag">start-tag</a>

+is in the content of another element, the <a title="End Tag" href="#dt-etag">end-tag</a>

+is in the content of the same element. More simply stated, the elements, delimited

+by start- and end-tags, nest properly within each other.</p></li>

+</ol> <p>[<a title="Parent/Child" name="dt-parentchild">Definition</a>: As

+a consequence of this, for each non-root element <code>C</code> in the document,

+there is one other element <code>P</code> in the document such that <code>C</code>

+is in the content of <code>P</code>, but is not in the content of any other

+element that is in the content of <code>P</code>. <code>P</code> is referred

+to as the <b>parent</b> of <code>C</code>, and <code>C</code> as a <b>child</b>

+of <code>P</code>.]</p> </div> <div class="div2"> <h3><a name="charsets"></a>2.2

+Characters</h3> <p>[<a title="Text" name="dt-text">Definition</a>: A parsed

+entity contains <b>text</b>, a sequence of <a title="Character" href="#dt-character">characters</a>,

+which may represent markup or character data.] [<a title="Character" name="dt-character">Definition</a>:

+A <b>character</b> is an atomic unit of text as specified by ISO/IEC 10646 <a

+href="#ISO10646">[ISO/IEC 10646]</a> (see also <a href="#ISO10646-2000">[ISO/IEC

+10646-2000]</a>). Legal characters are tab, carriage return, line feed, and

+the legal characters of Unicode and ISO/IEC 10646. The versions of these standards

+cited in <a href="#sec-existing-stds"><b>A.1 Normative References</b></a>

+were current at the time this document was prepared. New characters may be

+added to these standards by amendments or new editions. Consequently, XML

+processors must accept any character in the range specified for <a href="#NT-Char">Char</a>.

+The use of "compatibility characters", as defined in section 6.8 of <a href="#Unicode">[Unicode]</a>

+(see also D21 in section 3.6 of <a href="#Unicode3">[Unicode3]</a>), is discouraged.]</p> <h5>Character

+Range</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-Char"></a>[2]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Char</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]</code></td>

+<td><i>/* any Unicode character, excluding the surrogate blocks, FFFE, and

+FFFF. */</i></td>

+</tr>

+</tbody></table> <p>The mechanism for encoding character code points into

+bit patterns may vary from entity to entity. All XML processors must accept

+the UTF-8 and UTF-16 encodings of 10646; the mechanisms for signaling which

+of the two is in use, or for bringing other encodings into play, are discussed

+later, in <a href="#charencoding"><b>4.3.3 Character Encoding in Entities</b></a>.</p>

+ </div> <div class="div2"> <h3><a name="sec-common-syn"></a>2.3 Common Syntactic

+Constructs</h3> <p>This section defines some symbols used widely in the grammar.</p> <p><a

+href="#NT-S">S</a> (white space) consists of one or more space (#x20) characters,

+carriage returns, line feeds, or tabs.</p> <h5>White Space</h5><table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td><a name="NT-S"></a>[3]&nbsp;&nbsp;&nbsp;</td>

+<td><code>S</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>(#x20 | #x9 | #xD | #xA)+</code></td>

+</tr>

+</tbody></table> <p>Characters are classified for convenience as letters,

+digits, or other characters. A letter consists of an alphabetic or syllabic

+base character or an ideographic character. Full definitions of the specific

+characters in each class are given in <a href="#CharClasses"><b>B Character

+Classes</b></a>.</p> <p>[<a title="Name" name="dt-name">Definition</a>: A <b>Name</b>

+is a token beginning with a letter or one of a few punctuation characters,

+and continuing with letters, digits, hyphens, underscores, colons, or full

+stops, together known as name characters.] Names beginning with the string

+"<code>xml</code>", or any string which would match <code>(('X'|'x') ('M'|'m')

+('L'|'l'))</code>, are reserved for standardization in this or future versions

+of this specification.</p> <div class="note"><p class="prefix"><b>Note:</b></p> <p>The

+Namespaces in XML Recommendation <a href="#xml-names">[XML Names]</a> assigns

+a meaning to names containing colon characters. Therefore, authors should

+not use the colon in XML names except for namespace purposes, but XML processors

+must accept the colon as a name character.</p> </div> <p>An <a href="#NT-Nmtoken">Nmtoken</a>

+(name token) is any mixture of name characters.</p> <h5>Names and Tokens</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-NameChar"></a>[4]&nbsp;&nbsp;&nbsp;</td>

+<td><code>NameChar</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Letter">Letter</a> | <a href="#NT-Digit">Digit</a>

+| '.' | '-' | '_' | ':' | <a href="#NT-CombiningChar">CombiningChar</a> | <a

+href="#NT-Extender">Extender</a></code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-Name"></a>[5]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Name</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>(<a href="#NT-Letter">Letter</a> | '_' | ':') (<a href="#NT-NameChar">NameChar</a>)*</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-Names"></a>[6]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Names</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Name">Name</a> (<a href="#NT-S">S</a> <a href="#NT-Name">Name</a>)*</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-Nmtoken"></a>[7]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Nmtoken</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>(<a href="#NT-NameChar">NameChar</a>)+</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-Nmtokens"></a>[8]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Nmtokens</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Nmtoken">Nmtoken</a> (<a href="#NT-S">S</a> <a href="#NT-Nmtoken">Nmtoken</a>)*</code></td>

+</tr>

+</tbody></table> <p>Literal data is any quoted string not containing the quotation

+mark used as a delimiter for that string. Literals are used for specifying

+the content of internal entities (<a href="#NT-EntityValue">EntityValue</a>),

+the values of attributes (<a href="#NT-AttValue">AttValue</a>), and external

+identifiers (<a href="#NT-SystemLiteral">SystemLiteral</a>). Note that a <a

+href="#NT-SystemLiteral">SystemLiteral</a> can be parsed without scanning

+for markup.</p> <h5>Literals</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-EntityValue"></a>[9]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EntityValue</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'"' ([^%&amp;"] | <a href="#NT-PEReference">PEReference</a> | <a

+href="#NT-Reference">Reference</a>)* '"' </code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>|&nbsp; "'" ([^%&amp;'] | <a href="#NT-PEReference">PEReference</a>

+| <a href="#NT-Reference">Reference</a>)* "'"</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-AttValue"></a>[10]&nbsp;&nbsp;&nbsp;</td>

+<td><code>AttValue</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'"' ([^&lt;&amp;"] | <a href="#NT-Reference">Reference</a>)* '"' </code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>|&nbsp; "'" ([^&lt;&amp;'] | <a href="#NT-Reference">Reference</a>)*

+"'"</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-SystemLiteral"></a>[11]&nbsp;&nbsp;&nbsp;</td>

+<td><code>SystemLiteral</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>('"' [^"]* '"') |&nbsp;("'" [^']* "'") </code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-PubidLiteral"></a>[12]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PubidLiteral</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'"' <a href="#NT-PubidChar">PubidChar</a>* '"' | "'" (<a href="#NT-PubidChar">PubidChar</a>

+- "'")* "'"</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-PubidChar"></a>[13]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PubidChar</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>#x20 | #xD | #xA |&nbsp;[a-zA-Z0-9] |&nbsp;[-'()+,./:=?;!*#@$_%]</code></td>

+</tr>

+</tbody></table> <div class="note"><p class="prefix"><b>Note:</b></p> <p>Although

+the <a href="#NT-EntityValue">EntityValue</a> production allows the definition

+of an entity consisting of a single explicit <code>&lt;</code> in the literal

+(e.g., <code>&lt;!ENTITY mylt "&lt;"></code>), it is strongly advised to avoid

+this practice since any reference to that entity will cause a well-formedness

+error.</p> </div> </div> <div class="div2"> <h3><a name="syntax"></a>2.4 Character

+Data and Markup</h3> <p><a title="Text" href="#dt-text">Text</a> consists

+of intermingled <a title="Character Data" href="#dt-chardata">character data</a>

+and markup. [<a title="Markup" name="dt-markup">Definition</a>: <b>Markup</b>

+takes the form of <a title="Start-Tag" href="#dt-stag">start-tags</a>, <a

+title="End Tag" href="#dt-etag">end-tags</a>, <a title="Empty" href="#dt-empty">empty-element

+tags</a>, <a title="Entity Reference" href="#dt-entref">entity references</a>, <a

+title="Character Reference" href="#dt-charref">character references</a>, <a

+title="Comment" href="#dt-comment">comments</a>, <a title="CDATA Section"

+href="#dt-cdsection">CDATA section</a> delimiters, <a title="Document Type Declaration"

+href="#dt-doctype">document type declarations</a>, <a title="Processing instruction"

+href="#dt-pi">processing instructions</a>, <a href="#NT-XMLDecl">XML declarations</a>, <a

+href="#NT-TextDecl">text declarations</a>, and any white space that is at

+the top level of the document entity (that is, outside the document element

+and not inside any other markup).]</p> <p>[<a title="Character Data" name="dt-chardata">Definition</a>:

+All text that is not markup constitutes the <b>character data</b> of the document.]</p> <p>The

+ampersand character (&amp;) and the left angle bracket (&lt;) may appear in

+their literal form <em>only</em> when used as markup delimiters, or within

+a <a title="Comment" href="#dt-comment">comment</a>, a <a title="Processing instruction"

+href="#dt-pi">processing instruction</a>, or a <a title="CDATA Section" href="#dt-cdsection">CDATA

+section</a>.  If they are needed elsewhere, they must be <a title="escape"

+href="#dt-escape">escaped</a> using either <a title="Character Reference"

+href="#dt-charref">numeric character references</a> or the strings "<code>&amp;amp;</code>"

+and "<code>&amp;lt;</code>" respectively. The right angle bracket (>) may

+be represented using the string "<code>&amp;gt;</code>", and must, <a title="For Compatibility"

+href="#dt-compat">for compatibility</a>, be escaped using "<code>&amp;gt;</code>"

+or a character reference when it appears in the string "<code>]]&gt;</code>"

+in content, when that string is not marking the end of a <a title="CDATA Section"

+href="#dt-cdsection">CDATA section</a>.</p> <p>In the content of elements,

+character data is any string of characters which does not contain the start-delimiter

+of any markup. In a CDATA section, character data is any string of characters

+not including the CDATA-section-close delimiter, "<code>]]&gt;</code>".</p> <p>To

+allow attribute values to contain both single and double quotes, the apostrophe

+or single-quote character (') may be represented as "<code>&amp;apos;</code>",

+and the double-quote character (") as "<code>&amp;quot;</code>".</p> <h5>Character

+Data</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-CharData"></a>[14]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CharData</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>[^&lt;&amp;]* - ([^&lt;&amp;]* ']]&gt;' [^&lt;&amp;]*)</code></td>

+</tr>

+</tbody></table> </div> <div class="div2"> <h3><a name="sec-comments"></a>2.5

+Comments</h3> <p>[<a title="Comment" name="dt-comment">Definition</a>: <b>Comments</b>

+may appear anywhere in a document outside other <a title="Markup" href="#dt-markup">markup</a>;

+in addition, they may appear within the document type declaration at places

+allowed by the grammar. They are not part of the document's <a title="Character Data"

+href="#dt-chardata">character data</a>; an XML processor may, but need not,

+make it possible for an application to retrieve the text of comments. <a title="For Compatibility"

+href="#dt-compat">For compatibility</a>, the string "<code>--</code>" (double-hyphen)

+must not occur within comments.] Parameter entity references are not recognized

+within comments.</p> <h5>Comments</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-Comment"></a>[15]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Comment</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!--' ((<a href="#NT-Char">Char</a> - '-') | ('-' (<a href="#NT-Char">Char</a>

+- '-')))* '-->'</code></td>

+</tr>

+</tbody></table> <p>An example of a comment:</p> <table class="eg" width="100%"

+border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!-- declarations for &lt;head> &amp; &lt;body> --></pre></td>

+</tr>

+</table> <p>Note that the grammar does not allow a comment ending in <code>---></code>.

+The following example is <em>not</em> well-formed.</p> <table class="eg" width="100%"

+border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!-- B+, B, or B---></pre></td>

+</tr>

+</table> </div> <div class="div2"> <h3><a name="sec-pi"></a>2.6 Processing

+Instructions</h3> <p>[<a title="Processing instruction" name="dt-pi">Definition</a>: <b>Processing

+instructions</b> (PIs) allow documents to contain instructions for applications.]</p> <h5>Processing

+Instructions</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-PI"></a>[16]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PI</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;?' <a href="#NT-PITarget">PITarget</a> (<a href="#NT-S">S</a>

+(<a href="#NT-Char">Char</a>* - (<a href="#NT-Char">Char</a>* '?>' <a href="#NT-Char">Char</a>*)))?

+'?>'</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-PITarget"></a>[17]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PITarget</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Name">Name</a> - (('X' | 'x') ('M' | 'm') ('L' | 'l'))</code></td>

+</tr>

+</tbody></table> <p>PIs are not part of the document's <a title="Character Data"

+href="#dt-chardata">character data</a>, but must be passed through to the

+application. The PI begins with a target (<a href="#NT-PITarget">PITarget</a>)

+used to identify the application to which the instruction is directed. The

+target names "<code>XML</code>", "<code>xml</code>", and so on are reserved

+for standardization in this or future versions of this specification. The

+XML <a title="Notation" href="#dt-notation">Notation</a> mechanism may be

+used for formal declaration of PI targets. Parameter entity references are

+not recognized within processing instructions.</p> </div> <div class="div2"> <h3><a

+name="sec-cdata-sect"></a>2.7 CDATA Sections</h3> <p>[<a title="CDATA Section"

+name="dt-cdsection">Definition</a>: <b>CDATA sections</b> may occur anywhere

+character data may occur; they are used to escape blocks of text containing

+characters which would otherwise be recognized as markup. CDATA sections begin

+with the string "<code>&lt;![CDATA[</code>" and end with the string "<code>]]&gt;</code>":]</p> <h5>CDATA

+Sections</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-CDSect"></a>[18]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CDSect</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-CDStart">CDStart</a> <a href="#NT-CData">CData</a> <a

+href="#NT-CDEnd">CDEnd</a></code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-CDStart"></a>[19]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CDStart</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;![CDATA['</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-CData"></a>[20]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CData</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>(<a href="#NT-Char">Char</a>* - (<a href="#NT-Char">Char</a>* ']]&gt;' <a

+href="#NT-Char">Char</a>*)) </code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-CDEnd"></a>[21]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CDEnd</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>']]&gt;'</code></td>

+</tr>

+</tbody></table> <p>Within a CDATA section, only the <a href="#NT-CDEnd">CDEnd</a>

+string is recognized as markup, so that left angle brackets and ampersands

+may occur in their literal form; they need not (and cannot) be escaped using

+"<code>&amp;lt;</code>" and "<code>&amp;amp;</code>". CDATA sections cannot

+nest.</p> <p>An example of a CDATA section, in which "<code>&lt;greeting></code>"

+and "<code>&lt;/greeting></code>" are recognized as <a title="Character Data"

+href="#dt-chardata">character data</a>, not <a title="Markup" href="#dt-markup">markup</a>:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;![CDATA[&lt;greeting>Hello, world!&lt;/greeting>]]&gt; </pre></td>

+</tr>

+</table> </div> <div class="div2"> <h3><a name="sec-prolog-dtd"></a>2.8 Prolog

+and Document Type Declaration</h3> <p>[<a title="XML Declaration" name="dt-xmldecl">Definition</a>:

+XML documents should begin with an <b>XML declaration</b> which specifies

+the version of XML being used.] For example, the following is a complete XML

+document, <a title="Well-Formed" href="#dt-wellformed">well-formed</a> but

+not <a title="Validity" href="#dt-valid">valid</a>:</p> <table class="eg"

+width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;?xml version="1.0"?> &lt;greeting>Hello, world!&lt;/greeting> </pre></td>

+</tr>

+</table> <p>and so is this:</p> <table class="eg" width="100%" border="1"

+cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;greeting>Hello, world!&lt;/greeting></pre></td>

+</tr>

+</table> <p>The version number "<code>1.0</code>" should be used to indicate

+conformance to this version of this specification; it is an error for a document

+to use the value "<code>1.0</code>" if it does not conform to this version

+of this specification. It is the intent of the XML working group to give later

+versions of this specification numbers other than "<code>1.0</code>", but

+this intent does not indicate a commitment to produce any future versions

+of XML, nor if any are produced, to use any particular numbering scheme. Since

+future versions are not ruled out, this construct is provided as a means to

+allow the possibility of automatic version recognition, should it become necessary.

+Processors may signal an error if they receive documents labeled with versions

+they do not support.</p> <p>The function of the markup in an XML document

+is to describe its storage and logical structure and to associate attribute-value

+pairs with its logical structures. XML provides a mechanism, the <a title="Document Type Declaration"

+href="#dt-doctype">document type declaration</a>, to define constraints on

+the logical structure and to support the use of predefined storage units.

+[<a title="Validity" name="dt-valid">Definition</a>: An XML document is <b>valid</b>

+if it has an associated document type declaration and if the document complies

+with the constraints expressed in it.]</p> <p>The document type declaration

+must appear before the first <a title="Element" href="#dt-element">element</a>

+in the document.</p> <h5>Prolog</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-prolog"></a>[22]&nbsp;&nbsp;&nbsp;</td>

+<td><code>prolog</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-XMLDecl">XMLDecl</a>? <a href="#NT-Misc">Misc</a>*

+(<a href="#NT-doctypedecl">doctypedecl</a> <a href="#NT-Misc">Misc</a>*)?</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-XMLDecl"></a>[23]&nbsp;&nbsp;&nbsp;</td>

+<td><code>XMLDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;?xml' <a href="#NT-VersionInfo">VersionInfo</a> <a href="#NT-EncodingDecl">EncodingDecl</a>? <a

+href="#NT-SDDecl">SDDecl</a>? <a href="#NT-S">S</a>? '?>'</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-VersionInfo"></a>[24]&nbsp;&nbsp;&nbsp;</td>

+<td><code>VersionInfo</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-S">S</a> 'version' <a href="#NT-Eq">Eq</a> ("'" <a

+href="#NT-VersionNum">VersionNum</a> "'" | '"' <a href="#NT-VersionNum">VersionNum</a>

+'"')<i>/*  */</i></code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Eq"></a>[25]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Eq</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-S">S</a>? '=' <a href="#NT-S">S</a>?</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-VersionNum"></a>[26]&nbsp;&nbsp;&nbsp;</td>

+<td><code>VersionNum</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>([a-zA-Z0-9_.:] | '-')+</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Misc"></a>[27]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Misc</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Comment">Comment</a> | <a href="#NT-PI">PI</a> | <a

+href="#NT-S">S</a></code></td>

+</tr>

+</tbody></table> <p>[<a title="Document Type Declaration" name="dt-doctype">Definition</a>:

+The XML <b>document type declaration</b> contains or points to <a title="markup declaration"

+href="#dt-markupdecl">markup declarations</a> that provide a grammar for a

+class of documents. This grammar is known as a document type definition, or <b>DTD</b>.

+The document type declaration can point to an external subset (a special kind

+of <a title="External Entity" href="#dt-extent">external entity</a>) containing

+markup declarations, or can contain the markup declarations directly in an

+internal subset, or can do both. The DTD for a document consists of both subsets

+taken together.]</p> <p>[<a title="markup declaration" name="dt-markupdecl">Definition</a>:

+ A <b>markup declaration</b> is an <a title="Element Type declaration" href="#dt-eldecl">element

+type declaration</a>, an <a title="Attribute-List Declaration" href="#dt-attdecl">attribute-list

+declaration</a>, an <a title="entity declaration" href="#dt-entdecl">entity

+declaration</a>, or a <a title="Notation Declaration" href="#dt-notdecl">notation

+declaration</a>.] These declarations may be contained in whole or in part

+within <a title="Parameter entity" href="#dt-PE">parameter entities</a>, as

+described in the well-formedness and validity constraints below. For further

+information, see <a href="#sec-physical-struct"><b>4 Physical Structures</b></a>.</p> <h5>Document

+Type Definition</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-doctypedecl"></a>[28]&nbsp;&nbsp;&nbsp;</td>

+<td><code>doctypedecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!DOCTYPE' <a href="#NT-S">S</a> <a href="#NT-Name">Name</a>

+(<a href="#NT-S">S</a> <a href="#NT-ExternalID">ExternalID</a>)? <a href="#NT-S">S</a>?

+('[' (<a href="#NT-markupdecl">markupdecl</a> | <a href="#NT-DeclSep">DeclSep</a>)*

+']' <a href="#NT-S">S</a>?)? '>'</code></td>

+<td><a href="#vc-roottype">[VC: Root Element Type]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#ExtSubset">[WFC: External Subset]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-DeclSep"></a>[28a]&nbsp;&nbsp;&nbsp;</td>

+<td><code>DeclSep</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-PEReference">PEReference</a> | <a href="#NT-S">S</a></code></td>

+<td><a href="#PE-between-Decls">[WFC: PE Between Declarations]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-markupdecl"></a>[29]&nbsp;&nbsp;&nbsp;</td>

+<td><code>markupdecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-elementdecl">elementdecl</a> | <a href="#NT-AttlistDecl">AttlistDecl</a>

+| <a href="#NT-EntityDecl">EntityDecl</a> | <a href="#NT-NotationDecl">NotationDecl</a>

+| <a href="#NT-PI">PI</a> | <a href="#NT-Comment">Comment</a> </code></td>

+<td><a href="#vc-PEinMarkupDecl">[VC: Proper Declaration/PE Nesting]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#wfc-PEinInternalSubset">[WFC: PEs in Internal Subset]</a></td>

+</tr>

+</tbody></table> <p>Note that it is possible to construct a well-formed document

+containing a <a href="#NT-doctypedecl">doctypedecl</a> that neither points

+to an external subset nor contains an internal subset.</p> <p>The markup declarations

+may be made up in whole or in part of the <a title="Replacement Text" href="#dt-repltext">replacement

+text</a> of <a title="Parameter entity" href="#dt-PE">parameter entities</a>.

+The productions later in this specification for individual nonterminals (<a

+href="#NT-elementdecl">elementdecl</a>, <a href="#NT-AttlistDecl">AttlistDecl</a>,

+and so on) describe the declarations <em>after</em> all the parameter entities

+have been <a title="Include" href="#dt-include">included</a>.</p> <p>Parameter

+entity references are recognized anywhere in the DTD (internal and external

+subsets and external parameter entities), except in literals, processing instructions,

+comments, and the contents of ignored conditional sections (see <a href="#sec-condition-sect"><b>3.4

+Conditional Sections</b></a>). They are also recognized in entity value literals.

+The use of parameter entities in the internal subset is restricted as described

+below.</p> <div class="constraint"><p class="prefix"><a name="vc-roottype"></a><b>Validity

+constraint: Root Element Type</b></p><p>The <a href="#NT-Name">Name</a> in

+the document type declaration must match the element type of the <a title="Root Element"

+href="#dt-root">root element</a>.</p> </div> <div class="constraint"><p class="prefix"><a

+name="vc-PEinMarkupDecl"></a><b>Validity constraint: Proper Declaration/PE

+Nesting</b></p> <p>Parameter-entity <a title="Replacement Text" href="#dt-repltext">replacement

+text</a> must be properly nested with markup declarations. That is to say,

+if either the first character or the last character of a markup declaration

+(<a href="#NT-markupdecl">markupdecl</a> above) is contained in the replacement

+text for a <a title="Parameter-entity reference" href="#dt-PERef">parameter-entity

+reference</a>, both must be contained in the same replacement text.</p> </div> <div

+class="constraint"><p class="prefix"><a name="wfc-PEinInternalSubset"></a><b>Well-formedness

+constraint: PEs in Internal Subset</b></p><p>In the internal DTD subset, <a

+title="Parameter-entity reference" href="#dt-PERef">parameter-entity references</a>

+can occur only where markup declarations can occur, not within markup declarations.

+(This does not apply to references that occur in external parameter entities

+or to the external subset.)</p> </div> <div class="constraint"><p class="prefix"><a

+name="ExtSubset"></a><b>Well-formedness constraint: External Subset</b></p><p>The

+external subset, if any, must match the production for <a href="#NT-extSubset">extSubset</a>.</p> </div> <div

+class="constraint"><p class="prefix"><a name="PE-between-Decls"></a><b>Well-formedness

+constraint: PE Between Declarations</b></p><p>The replacement text of a parameter

+entity reference in a <a href="#NT-DeclSep">DeclSep</a> must match the production <a

+href="#NT-extSubsetDecl">extSubsetDecl</a>.</p> </div> <p>Like the internal

+subset, the external subset and any external parameter entities referenced

+in a <a href="#NT-DeclSep">DeclSep</a> must consist of a series of complete

+markup declarations of the types allowed by the non-terminal symbol <a href="#NT-markupdecl">markupdecl</a>,

+interspersed with white space or <a title="Parameter-entity reference" href="#dt-PERef">parameter-entity

+references</a>. However, portions of the contents of the external subset or

+of these  external parameter entities may conditionally be ignored by using

+the <a title="conditional section" href="#dt-cond-section">conditional section</a>

+construct; this is not allowed in the internal subset.</p> <h5>External Subset</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-extSubset"></a>[30]&nbsp;&nbsp;&nbsp;</td>

+<td><code>extSubset</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-TextDecl">TextDecl</a>? <a href="#NT-extSubsetDecl">extSubsetDecl</a></code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-extSubsetDecl"></a>[31]&nbsp;&nbsp;&nbsp;</td>

+<td><code>extSubsetDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>( <a href="#NT-markupdecl">markupdecl</a> | <a href="#NT-conditionalSect">conditionalSect</a>

+| <a href="#NT-DeclSep">DeclSep</a>)*</code></td>

+<td><i>/*  */</i></td>

+</tr>

+</tbody></table> <p>The external subset and external parameter entities also

+differ from the internal subset in that in them, <a title="Parameter-entity reference"

+href="#dt-PERef">parameter-entity references</a> are permitted <em>within</em>

+markup declarations, not only <em>between</em> markup declarations.</p> <p>An

+example of an XML document with a document type declaration:</p> <table class="eg"

+width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;?xml version="1.0"?> &lt;!DOCTYPE greeting SYSTEM "hello.dtd"> &lt;greeting>Hello, world!&lt;/greeting> </pre></td>

+</tr>

+</table> <p>The <a title="System Identifier" href="#dt-sysid">system identifier</a>

+"<code>hello.dtd</code>" gives the address (a URI reference) of a DTD for

+the document.</p> <p>The declarations can also be given locally, as in this

+example:</p> <table class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;?xml version="1.0" encoding="UTF-8" ?>

+&lt;!DOCTYPE greeting [

+  &lt;!ELEMENT greeting (#PCDATA)>

+]>

+&lt;greeting>Hello, world!&lt;/greeting></pre></td>

+</tr>

+</table> <p>If both the external and internal subsets are used, the internal

+subset is considered to occur before the external subset.  This has the effect

+that entity and attribute-list declarations in the internal subset take precedence

+over those in the external subset.</p> </div> <div class="div2"> <h3><a name="sec-rmd"></a>2.9

+Standalone Document Declaration</h3> <p>Markup declarations can affect the

+content of the document, as passed from an <a title="XML Processor" href="#dt-xml-proc">XML

+processor</a> to an application; examples are attribute defaults and entity

+declarations. The standalone document declaration, which may appear as a component

+of the XML declaration, signals whether or not there are such declarations

+which appear external to the <a title="Document Entity" href="#dt-docent">document

+entity</a> or in parameter entities. [<a title="External Markup Declaration"

+name="dt-extmkpdecl">Definition</a>: An <b>external markup declaration</b>

+is defined as a markup declaration occurring in the external subset or in

+a parameter entity (external or internal, the latter being included because

+non-validating processors are not required to read them).]</p> <h5>Standalone

+Document Declaration</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-SDDecl"></a>[32]&nbsp;&nbsp;&nbsp;</td>

+<td><code>SDDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code> <a href="#NT-S">S</a> 'standalone' <a href="#NT-Eq">Eq</a> (("'"

+('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) </code></td>

+<td><a href="#vc-check-rmd">[VC: Standalone Document Declaration]</a></td>

+</tr>

+</tbody></table> <p>In a standalone document declaration, the value "yes"

+indicates that there are no <a title="External Markup Declaration" href="#dt-extmkpdecl">external

+markup declarations</a> which affect the information passed from the XML processor

+to the application. The value "no" indicates that there are or may be such

+external markup declarations. Note that the standalone document declaration

+only denotes the presence of external <em>declarations</em>; the presence,

+in a document, of references to external <em>entities</em>, when those entities

+are internally declared, does not change its standalone status.</p> <p>If

+there are no external markup declarations, the standalone document declaration

+has no meaning. If there are external markup declarations but there is no

+standalone document declaration, the value "no" is assumed.</p> <p>Any XML

+document for which <code>standalone="no"</code> holds can be converted algorithmically

+to a standalone document, which may be desirable for some network delivery

+applications.</p> <div class="constraint"><p class="prefix"><a name="vc-check-rmd"></a><b>Validity

+constraint: Standalone Document Declaration</b></p><p>The standalone document

+declaration must have the value "no" if any external markup declarations contain

+declarations of:</p> <ul>

+<li><p>attributes with <a title="Attribute Default" href="#dt-default">default</a>

+values, if elements to which these attributes apply appear in the document

+without specifications of values for these attributes, or</p></li>

+<li><p>entities (other than <code>amp</code>, <code>lt</code>, <code>gt</code>, <code>apos</code>, <code>quot</code>),

+if <a title="Entity Reference" href="#dt-entref">references</a> to those entities

+appear in the document, or</p></li>

+<li><p>attributes with values subject to <a href="#AVNormalize"><cite>normalization</cite></a>,

+where the attribute appears in the document with a value which will change

+as a result of normalization, or</p></li>

+<li><p>element types with <a title="Element content" href="#dt-elemcontent">element

+content</a>, if white space occurs directly within any instance of those types.</p></li>

+</ul> </div> <p>An example XML declaration with a standalone document declaration:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;?xml version="1.0" standalone='yes'?></pre></td>

+</tr>

+</table> </div> <div class="div2"> <h3><a name="sec-white-space"></a>2.10

+White Space Handling</h3> <p>In editing XML documents, it is often convenient

+to use "white space" (spaces, tabs, and blank lines) to set apart the markup

+for greater readability. Such white space is typically not intended for inclusion

+in the delivered version of the document. On the other hand, "significant"

+white space that should be preserved in the delivered version is common, for

+example in poetry and source code.</p> <p>An <a title="XML Processor" href="#dt-xml-proc">XML

+processor</a> must always pass all characters in a document that are not markup

+through to the application. A <a title="Validating Processor" href="#dt-validating">

+validating XML processor</a> must also inform the application which of these

+characters constitute white space appearing in <a title="Element content"

+href="#dt-elemcontent">element content</a>.</p> <p>A special <a title="Attribute"

+href="#dt-attr">attribute</a> named <code>xml:space</code> may be attached

+to an element to signal an intention that in that element, white space should

+be preserved by applications. In valid documents, this attribute, like any

+other, must be <a title="Attribute-List Declaration" href="#dt-attdecl">declared</a>

+if it is used. When declared, it must be given as an <a title="Enumerated Attribute Values"

+href="#dt-enumerated">enumerated type</a> whose values are one or both of

+"default" and "preserve". For example:</p> <table class="eg" width="100%"

+border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ATTLIST poem  xml:space (default|preserve) 'preserve'>

+

+&lt;!-- -->

+&lt;!ATTLIST pre xml:space (preserve) #FIXED 'preserve'></pre></td>

+</tr>

+</table> <p>The value "default" signals that applications' default white-space

+processing modes are acceptable for this element; the value "preserve" indicates

+the intent that applications preserve all the white space. This declared intent

+is considered to apply to all elements within the content of the element where

+it is specified, unless overriden with another instance of the <code>xml:space</code>

+attribute.</p> <p>The <a title="Root Element" href="#dt-root">root element</a>

+of any document is considered to have signaled no intentions as regards application

+space handling, unless it provides a value for this attribute or the attribute

+is declared with a default value.</p> </div> <div class="div2"> <h3><a name="sec-line-ends"></a>2.11

+End-of-Line Handling</h3> <p>XML <a title="Text Entity" href="#dt-parsedent">parsed

+entities</a> are often stored in computer files which, for editing convenience,

+are organized into lines. These lines are typically separated by some combination

+of the characters carriage-return (#xD) and line-feed (#xA).</p>  <p>To simplify

+the tasks of <a title="Application" href="#dt-app">applications</a>, the characters

+passed to an application by the <a title="XML Processor" href="#dt-xml-proc">XML

+processor</a> must be as if the XML processor normalized all line breaks in

+external parsed entities (including the document entity) on input, before

+parsing, by translating both the two-character sequence #xD #xA and any #xD

+that is not followed by #xA to a single #xA character.</p> </div> <div class="div2"> <h3><a

+name="sec-lang-tag"></a>2.12 Language Identification</h3> <p>In document processing,

+it is often useful to identify the natural or formal language in which the

+content is written. A special <a title="Attribute" href="#dt-attr">attribute</a>

+named <code>xml:lang</code> may be inserted in documents to specify the language

+used in the contents and attribute values of any element in an XML document.

+In valid documents, this attribute, like any other, must be <a title="Attribute-List Declaration"

+href="#dt-attdecl">declared</a> if it is used. The values of the attribute

+are language identifiers as defined by <a href="#RFC1766">[IETF RFC 1766]</a>, <cite>Tags

+for the Identification of Languages</cite>, or its successor on the IETF Standards

+Track.</p> <div class="note"><p class="prefix"><b>Note:</b></p> <p><a href="#RFC1766">[IETF

+RFC 1766]</a> tags are constructed from two-letter language codes as defined

+by <a href="#ISO639">[ISO 639]</a>, from two-letter country codes as defined

+by <a href="#ISO3166">[ISO 3166]</a>, or from language identifiers registered

+with the Internet Assigned Numbers Authority <a href="#IANA-LANGCODES">[IANA-LANGCODES]</a>.

+It is expected that the successor to <a href="#RFC1766">[IETF RFC 1766]</a>

+will introduce three-letter language codes for languages not presently covered

+by <a href="#ISO639">[ISO 639]</a>.</p> </div> <p>(Productions 33 through

+38 have been removed.)</p>      <p>For example:</p> <table class="eg" width="100%"

+border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;p xml:lang="en">The quick brown fox jumps over the lazy dog.&lt;/p>

+&lt;p xml:lang="en-GB">What colour is it?&lt;/p>

+&lt;p xml:lang="en-US">What color is it?&lt;/p>

+&lt;sp who="Faust" desc='leise' xml:lang="de">

+  &lt;l>Habe nun, ach! Philosophie,&lt;/l>

+  &lt;l>Juristerei, und Medizin&lt;/l>

+  &lt;l>und leider auch Theologie&lt;/l>

+  &lt;l>durchaus studiert mit hei&szlig;em Bem&uuml;h'n.&lt;/l>

+&lt;/sp></pre></td>

+</tr>

+</table>  <p>The intent declared with <code>xml:lang</code> is considered

+to apply to all attributes and content of the element where it is specified,

+unless overridden with an instance of <code>xml:lang</code> on another element

+within that content.</p>  <p>A simple declaration for <code>xml:lang</code>

+might take the form</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>xml:lang NMTOKEN #IMPLIED</pre></td>

+</tr>

+</table> <p>but specific default values may also be given, if appropriate.

+In a collection of French poems for English students, with glosses and notes

+in English, the <code>xml:lang</code> attribute might be declared this way:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ATTLIST poem   xml:lang NMTOKEN 'fr'>

+&lt;!ATTLIST gloss  xml:lang NMTOKEN 'en'>

+&lt;!ATTLIST note   xml:lang NMTOKEN 'en'></pre></td>

+</tr>

+</table> </div> </div>  <div class="div1"> <h2><a name="sec-logical-struct"></a>3

+Logical Structures</h2> <p>[<a title="Element" name="dt-element">Definition</a>:

+Each <a title="XML Document" href="#dt-xml-doc">XML document</a> contains

+one or more <b>elements</b>, the boundaries of which are either delimited

+by <a title="Start-Tag" href="#dt-stag">start-tags</a> and <a title="End Tag"

+href="#dt-etag">end-tags</a>, or, for <a title="Empty" href="#dt-empty">empty</a>

+elements, by an <a title="empty-element tag" href="#dt-eetag">empty-element

+tag</a>. Each element has a type, identified by name, sometimes called its

+"generic identifier" (GI), and may have a set of attribute specifications.]

+Each attribute specification has a <a title="Attribute Name" href="#dt-attrname">name</a>

+and a <a title="Attribute Value" href="#dt-attrval">value</a>.</p> <h5>Element</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-element"></a>[39]&nbsp;&nbsp;&nbsp;</td>

+<td><code>element</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-EmptyElemTag">EmptyElemTag</a></code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| <a href="#NT-STag">STag</a> <a href="#NT-content">content</a> <a

+href="#NT-ETag">ETag</a></code></td>

+<td><a href="#GIMatch">[WFC: Element Type Match]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#elementvalid">[VC: Element Valid]</a></td>

+</tr>

+</tbody></table> <p>This specification does not constrain the semantics, use,

+or (beyond syntax) names of the element types and attributes, except that

+names beginning with a match to <code>(('X'|'x')('M'|'m')('L'|'l'))</code>

+are reserved for standardization in this or future versions of this specification.</p> <div

+class="constraint"><p class="prefix"><a name="GIMatch"></a><b>Well-formedness

+constraint: Element Type Match</b></p><p>The <a href="#NT-Name">Name</a> in

+an element's end-tag must match the element type in the start-tag.</p> </div> <div

+class="constraint"><p class="prefix"><a name="elementvalid"></a><b>Validity

+constraint: Element Valid</b></p><p>An element is valid if there is a declaration

+matching <a href="#NT-elementdecl">elementdecl</a> where the <a href="#NT-Name">Name</a>

+matches the element type, and one of the following holds:</p> <ol>

+<li><p>The declaration matches <b>EMPTY</b> and the element has no <a title="Content"

+href="#dt-content">content</a>.</p></li>

+<li><p>The declaration matches <a href="#NT-children">children</a> and the

+sequence of <a title="Parent/Child" href="#dt-parentchild">child elements</a>

+belongs to the language generated by the regular expression in the content

+model, with optional white space (characters matching the nonterminal <a href="#NT-S">S</a>)

+between the start-tag and the first child element, between child elements,

+or between the last child element and the end-tag. Note that a CDATA section

+containing only white space does not match the nonterminal <a href="#NT-S">S</a>,

+and hence cannot appear in these positions.</p></li>

+<li><p>The declaration matches <a href="#NT-Mixed">Mixed</a> and the content

+consists of <a title="Character Data" href="#dt-chardata">character data</a>

+and <a title="Parent/Child" href="#dt-parentchild">child elements</a> whose

+types match names in the content model.</p></li>

+<li><p>The declaration matches <b>ANY</b>, and the types of any <a title="Parent/Child"

+href="#dt-parentchild">child elements</a> have been declared.</p></li>

+</ol> </div> <div class="div2"> <h3><a name="sec-starttags"></a>3.1 Start-Tags,

+End-Tags, and Empty-Element Tags</h3> <p>[<a title="Start-Tag" name="dt-stag">Definition</a>:

+The beginning of every non-empty XML element is marked by a <b>start-tag</b>.]</p> <h5>Start-tag</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-STag"></a>[40]&nbsp;&nbsp;&nbsp;</td>

+<td><code>STag</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;' <a href="#NT-Name">Name</a> (<a href="#NT-S">S</a> <a href="#NT-Attribute">Attribute</a>)* <a

+href="#NT-S">S</a>? '>'</code></td>

+<td><a href="#uniqattspec">[WFC: Unique Att Spec]</a></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Attribute"></a>[41]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Attribute</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Name">Name</a> <a href="#NT-Eq">Eq</a> <a href="#NT-AttValue">AttValue</a></code></td>

+<td><a href="#ValueType">[VC: Attribute Value Type]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#NoExternalRefs">[WFC: No External Entity References]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#CleanAttrVals">[WFC: No &lt; in Attribute Values]</a></td>

+</tr>

+</tbody></table> <p>The <a href="#NT-Name">Name</a> in the start- and end-tags

+gives the element's <b>type</b>. [<a title="Attribute" name="dt-attr">Definition</a>:

+ The <a href="#NT-Name">Name</a>-<a href="#NT-AttValue">AttValue</a> pairs

+are referred to as the <b>attribute specifications</b> of the element], [<a

+title="Attribute Name" name="dt-attrname">Definition</a>: with the <a href="#NT-Name">Name</a>

+in each pair referred to as the <b>attribute name</b>] and [<a title="Attribute Value"

+name="dt-attrval">Definition</a>: the content of the <a href="#NT-AttValue">AttValue</a>

+(the text between the <code>'</code> or <code>"</code> delimiters) as the <b>attribute

+value</b>.]Note that the order of attribute specifications in a start-tag

+or empty-element tag is not significant.</p> <div class="constraint"><p class="prefix"><a

+name="uniqattspec"></a><b>Well-formedness constraint: Unique Att Spec</b></p><p>No

+attribute name may appear more than once in the same start-tag or empty-element

+tag.</p> </div> <div class="constraint"><p class="prefix"><a name="ValueType"></a><b>Validity

+constraint: Attribute Value Type</b></p><p>The attribute must have been declared;

+the value must be of the type declared for it. (For attribute types, see <a

+href="#attdecls"><b>3.3 Attribute-List Declarations</b></a>.)</p> </div> <div

+class="constraint"><p class="prefix"><a name="NoExternalRefs"></a><b>Well-formedness

+constraint: No External Entity References</b></p><p>Attribute values cannot

+contain direct or indirect entity references to external entities.</p> </div> <div

+class="constraint"><p class="prefix"><a name="CleanAttrVals"></a><b>Well-formedness

+constraint: No <code>&lt;</code> in Attribute Values</b></p> <p>The <a title="Replacement Text"

+href="#dt-repltext">replacement text</a> of any entity referred to directly

+or indirectly in an attribute value must not contain a <code>&lt;</code>.</p> </div> <p>An

+example of a start-tag:</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;termdef id="dt-dog" term="dog"></pre></td>

+</tr>

+</table> <p>[<a title="End Tag" name="dt-etag">Definition</a>: The end of

+every element that begins with a start-tag must be marked by an <b>end-tag</b>

+containing a name that echoes the element's type as given in the start-tag:]</p> <h5>End-tag</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-ETag"></a>[42]&nbsp;&nbsp;&nbsp;</td>

+<td><code>ETag</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;/' <a href="#NT-Name">Name</a> <a href="#NT-S">S</a>? '>'</code></td>

+</tr>

+</tbody></table> <p>An example of an end-tag:</p> <table class="eg" width="100%"

+border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;/termdef></pre></td>

+</tr>

+</table> <p>[<a title="Content" name="dt-content">Definition</a>: The <a title="Text"

+href="#dt-text">text</a> between the start-tag and end-tag is called the element's <b>content</b>:]</p> <h5>Content

+of Elements</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-content"></a>[43]&nbsp;&nbsp;&nbsp;</td>

+<td><code>content</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-CharData">CharData</a>? ((<a href="#NT-element">element</a>

+| <a href="#NT-Reference">Reference</a> | <a href="#NT-CDSect">CDSect</a>

+| <a href="#NT-PI">PI</a> | <a href="#NT-Comment">Comment</a>) <a href="#NT-CharData">CharData</a>?)*</code></td>

+<td><i>/*  */</i></td>

+</tr>

+</tbody></table> <p>[<a title="Empty" name="dt-empty">Definition</a>: An element

+with no content is said to be <b>empty</b>.] The representation of an empty

+element is either a start-tag immediately followed by an end-tag, or an empty-element

+tag. [<a title="empty-element tag" name="dt-eetag">Definition</a>: An <b>empty-element

+tag</b> takes a special form:]</p> <h5>Tags for Empty Elements</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-EmptyElemTag"></a>[44]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EmptyElemTag</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;' <a href="#NT-Name">Name</a> (<a href="#NT-S">S</a> <a href="#NT-Attribute">Attribute</a>)* <a

+href="#NT-S">S</a>? '/>'</code></td>

+<td><a href="#uniqattspec">[WFC: Unique Att Spec]</a></td>

+</tr>

+</tbody></table> <p>Empty-element tags may be used for any element which has

+no content, whether or not it is declared using the keyword <b>EMPTY</b>. <a

+title="For interoperability" href="#dt-interop">For interoperability</a>,

+the empty-element tag should be used, and should only be used, for elements

+which are declared EMPTY.</p> <p>Examples of empty elements:</p> <table class="eg"

+width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;IMG align="left"

+ src="http://www.w3.org/Icons/WWW/w3c_home" />

+&lt;br>&lt;/br>

+&lt;br/></pre></td>

+</tr>

+</table> </div> <div class="div2"> <h3><a name="elemdecls"></a>3.2 Element

+Type Declarations</h3> <p>The <a title="Element" href="#dt-element">element</a>

+structure of an <a title="XML Document" href="#dt-xml-doc">XML document</a>

+may, for <a title="Validity" href="#dt-valid">validation</a> purposes, be

+constrained using element type and attribute-list declarations. An element

+type declaration constrains the element's <a title="Content" href="#dt-content">content</a>.</p> <p>Element

+type declarations often constrain which element types can appear as <a title="Parent/Child"

+href="#dt-parentchild">children</a> of the element. At user option, an XML

+processor may issue a warning when a declaration mentions an element type

+for which no declaration is provided, but this is not an error.</p> <p>[<a

+title="Element Type declaration" name="dt-eldecl">Definition</a>: An <b>element

+type declaration</b> takes the form:]</p> <h5>Element Type Declaration</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-elementdecl"></a>[45]&nbsp;&nbsp;&nbsp;</td>

+<td><code>elementdecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!ELEMENT' <a href="#NT-S">S</a> <a href="#NT-Name">Name</a> <a

+href="#NT-S">S</a> <a href="#NT-contentspec">contentspec</a> <a href="#NT-S">S</a>?

+'>'</code></td>

+<td><a href="#EDUnique">[VC: Unique Element Type Declaration]</a></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-contentspec"></a>[46]&nbsp;&nbsp;&nbsp;</td>

+<td><code>contentspec</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'EMPTY' | 'ANY' | <a href="#NT-Mixed">Mixed</a> | <a href="#NT-children">children</a> </code></td>

+</tr>

+</tbody></table> <p>where the <a href="#NT-Name">Name</a> gives the element

+type being declared.</p> <div class="constraint"><p class="prefix"><a name="EDUnique"></a><b>Validity

+constraint: Unique Element Type Declaration</b></p><p>No element type may

+be declared more than once.</p> </div> <p>Examples of element type declarations:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ELEMENT br EMPTY>

+&lt;!ELEMENT p (#PCDATA|emph)* >

+&lt;!ELEMENT %name.para; %content.para; >

+&lt;!ELEMENT container ANY></pre></td>

+</tr>

+</table> <div class="div3"> <h4><a name="sec-element-content"></a>3.2.1 Element

+Content</h4> <p>[<a title="Element content" name="dt-elemcontent">Definition</a>:

+An element <a title="Start-Tag" href="#dt-stag">type</a> has <b>element content</b>

+when elements of that type must contain only <a title="Parent/Child" href="#dt-parentchild">child</a>

+elements (no character data), optionally separated by white space (characters

+matching the nonterminal <a href="#NT-S">S</a>).][<a title="Content model"

+name="dt-content-model">Definition</a>: In this case, the constraint includes

+a <b>content model</b>, a simple grammar governing the allowed types of the

+child elements and the order in which they are allowed to appear.] The grammar

+is built on content particles (<a href="#NT-cp">cp</a>s), which consist of

+names, choice lists of content particles, or sequence lists of content particles:</p> <h5>Element-content

+Models</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-children"></a>[47]&nbsp;&nbsp;&nbsp;</td>

+<td><code>children</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>(<a href="#NT-choice">choice</a> | <a href="#NT-seq">seq</a>) ('?'

+| '*' | '+')?</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-cp"></a>[48]&nbsp;&nbsp;&nbsp;</td>

+<td><code>cp</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>(<a href="#NT-Name">Name</a> | <a href="#NT-choice">choice</a> | <a

+href="#NT-seq">seq</a>) ('?' | '*' | '+')?</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-choice"></a>[49]&nbsp;&nbsp;&nbsp;</td>

+<td><code>choice</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'(' <a href="#NT-S">S</a>? <a href="#NT-cp">cp</a> ( <a href="#NT-S">S</a>?

+'|' <a href="#NT-S">S</a>? <a href="#NT-cp">cp</a> )+ <a href="#NT-S">S</a>?

+')'</code></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#vc-PEinGroup">[VC: Proper Group/PE Nesting]</a></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-seq"></a>[50]&nbsp;&nbsp;&nbsp;</td>

+<td><code>seq</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'(' <a href="#NT-S">S</a>? <a href="#NT-cp">cp</a> ( <a href="#NT-S">S</a>?

+',' <a href="#NT-S">S</a>? <a href="#NT-cp">cp</a> )* <a href="#NT-S">S</a>?

+')'</code></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#vc-PEinGroup">[VC: Proper Group/PE Nesting]</a></td>

+</tr>

+</tbody></table> <p>where each <a href="#NT-Name">Name</a> is the type of

+an element which may appear as a <a title="Parent/Child" href="#dt-parentchild">child</a>.

+Any content particle in a choice list may appear in the <a title="Element content"

+href="#dt-elemcontent">element content</a> at the location where the choice

+list appears in the grammar; content particles occurring in a sequence list

+must each appear in the <a title="Element content" href="#dt-elemcontent">element

+content</a> in the order given in the list. The optional character following

+a name or list governs whether the element or the content particles in the

+list may occur one or more (<code>+</code>), zero or more (<code>*</code>),

+or zero or one times (<code>?</code>). The absence of such an operator means

+that the element or content particle must appear exactly once. This syntax

+and meaning are identical to those used in the productions in this specification.</p> <p>The

+content of an element matches a content model if and only if it is possible

+to trace out a path through the content model, obeying the sequence, choice,

+and repetition operators and matching each element in the content against

+an element type in the content model. <a title="For Compatibility" href="#dt-compat">For

+compatibility</a>, it is an error if an element in the document can match

+more than one occurrence of an element type in the content model. For more

+information, see <a href="#determinism"><b>E Deterministic Content Models</b></a>.</p>

+  <div class="constraint"><p class="prefix"><a name="vc-PEinGroup"></a><b>Validity

+constraint: Proper Group/PE Nesting</b></p><p>Parameter-entity <a title="Replacement Text"

+href="#dt-repltext">replacement text</a> must be properly nested with parenthesized

+groups. That is to say, if either of the opening or closing parentheses in

+a <a href="#NT-choice">choice</a>, <a href="#NT-seq">seq</a>, or <a href="#NT-Mixed">Mixed</a>

+construct is contained in the replacement text for a <a title="Parameter-entity reference"

+href="#dt-PERef">parameter entity</a>, both must be contained in the same

+replacement text.</p> <p><a title="For interoperability" href="#dt-interop">For

+interoperability</a>, if a parameter-entity reference appears in a <a href="#NT-choice">choice</a>, <a

+href="#NT-seq">seq</a>, or <a href="#NT-Mixed">Mixed</a> construct, its replacement

+text should contain at least one non-blank character, and neither the first

+nor last non-blank character of the replacement text should be a connector

+(<code>|</code> or <code>,</code>).</p> </div> <p>Examples of element-content

+models:</p> <table class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ELEMENT spec (front, body, back?)>

+&lt;!ELEMENT div1 (head, (p | list | note)*, div2*)>

+&lt;!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*></pre></td>

+</tr>

+</table> </div> <div class="div3"> <h4><a name="sec-mixed-content"></a>3.2.2

+Mixed Content</h4> <p>[<a title="Mixed Content" name="dt-mixed">Definition</a>:

+An element <a title="Start-Tag" href="#dt-stag">type</a> has <b>mixed content</b>

+when elements of that type may contain character data, optionally interspersed

+with <a title="Parent/Child" href="#dt-parentchild">child</a> elements.] In

+this case, the types of the child elements may be constrained, but not their

+order or their number of occurrences:</p> <h5>Mixed-content Declaration</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-Mixed"></a>[51]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Mixed</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'(' <a href="#NT-S">S</a>? '#PCDATA' (<a href="#NT-S">S</a>? '|' <a

+href="#NT-S">S</a>? <a href="#NT-Name">Name</a>)* <a href="#NT-S">S</a>? ')*' </code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| '(' <a href="#NT-S">S</a>? '#PCDATA' <a href="#NT-S">S</a>? ')' </code></td>

+<td><a href="#vc-PEinGroup">[VC: Proper Group/PE Nesting]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#vc-MixedChildrenUnique">[VC: No Duplicate Types]</a></td>

+</tr>

+</tbody></table> <p>where the <a href="#NT-Name">Name</a>s give the types

+of elements that may appear as children. The keyword <b>#PCDATA</b> derives

+historically from the term "parsed character data."</p> <div class="constraint"><p

+class="prefix"><a name="vc-MixedChildrenUnique"></a><b>Validity constraint:

+No Duplicate Types</b></p><p>The same name must not appear more than once

+in a single mixed-content declaration.</p> </div> <p>Examples of mixed content

+declarations:</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ELEMENT p (#PCDATA|a|ul|b|i|em)*>

+&lt;!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >

+&lt;!ELEMENT b (#PCDATA)></pre></td>

+</tr>

+</table> </div> </div> <div class="div2"> <h3><a name="attdecls"></a>3.3 Attribute-List

+Declarations</h3> <p><a title="Attribute" href="#dt-attr">Attributes</a> are

+used to associate name-value pairs with <a title="Element" href="#dt-element">elements</a>.

+Attribute specifications may appear only within <a title="Start-Tag" href="#dt-stag">start-tags</a>

+and <a title="empty-element tag" href="#dt-eetag">empty-element tags</a>;

+thus, the productions used to recognize them appear in <a href="#sec-starttags"><b>3.1

+Start-Tags, End-Tags, and Empty-Element Tags</b></a>. Attribute-list declarations

+may be used:</p> <ul>

+<li><p>To define the set of attributes pertaining to a given element type.</p> </li>

+<li><p>To establish type constraints for these attributes.</p></li>

+<li><p>To provide <a title="Attribute Default" href="#dt-default">default

+values</a> for attributes.</p></li>

+</ul> <p>[<a title="Attribute-List Declaration" name="dt-attdecl">Definition</a>:

+ <b>Attribute-list declarations</b> specify the name, data type, and default

+value (if any) of each attribute associated with a given element type:]</p> <h5>Attribute-list

+Declaration</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-AttlistDecl"></a>[52]&nbsp;&nbsp;&nbsp;</td>

+<td><code>AttlistDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!ATTLIST' <a href="#NT-S">S</a> <a href="#NT-Name">Name</a> <a

+href="#NT-AttDef">AttDef</a>* <a href="#NT-S">S</a>? '>'</code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-AttDef"></a>[53]&nbsp;&nbsp;&nbsp;</td>

+<td><code>AttDef</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-S">S</a> <a href="#NT-Name">Name</a> <a href="#NT-S">S</a> <a

+href="#NT-AttType">AttType</a> <a href="#NT-S">S</a> <a href="#NT-DefaultDecl">DefaultDecl</a></code></td>

+</tr>

+</tbody></table> <p>The <a href="#NT-Name">Name</a> in the <a href="#NT-AttlistDecl">AttlistDecl</a>

+rule is the type of an element. At user option, an XML processor may issue

+a warning if attributes are declared for an element type not itself declared,

+but this is not an error. The <a href="#NT-Name">Name</a> in the <a href="#NT-AttDef">AttDef</a>

+rule is the name of the attribute.</p> <p>When more than one <a href="#NT-AttlistDecl">AttlistDecl</a>

+is provided for a given element type, the contents of all those provided are

+merged. When more than one definition is provided for the same attribute of

+a given element type, the first declaration is binding and later declarations

+are ignored. <a title="For interoperability" href="#dt-interop">For interoperability,</a>

+writers of DTDs may choose to provide at most one attribute-list declaration

+for a given element type, at most one attribute definition for a given attribute

+name in an attribute-list declaration, and at least one attribute definition

+in each attribute-list declaration. For interoperability, an XML processor

+may at user option issue a warning when more than one attribute-list declaration

+is provided for a given element type, or more than one attribute definition

+is provided for a given attribute, but this is not an error.</p> <div class="div3"> <h4><a

+name="sec-attribute-types"></a>3.3.1 Attribute Types</h4> <p>XML attribute

+types are of three kinds: a string type, a set of tokenized types, and enumerated

+types. The string type may take any literal string as a value; the tokenized

+types have varying lexical and semantic constraints. The validity constraints

+noted in the grammar are applied after the attribute value has been normalized

+as described in <a href="#attdecls"><b>3.3 Attribute-List Declarations</b></a>.</p> <h5>Attribute

+Types</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-AttType"></a>[54]&nbsp;&nbsp;&nbsp;</td>

+<td><code>AttType</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-StringType">StringType</a> | <a href="#NT-TokenizedType">TokenizedType</a>

+| <a href="#NT-EnumeratedType">EnumeratedType</a> </code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-StringType"></a>[55]&nbsp;&nbsp;&nbsp;</td>

+<td><code>StringType</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'CDATA'</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-TokenizedType"></a>[56]&nbsp;&nbsp;&nbsp;</td>

+<td><code>TokenizedType</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'ID'</code></td>

+<td><a href="#id">[VC: ID]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#one-id-per-el">[VC: One ID per Element Type]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#id-default">[VC: ID Attribute Default]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'IDREF'</code></td>

+<td><a href="#idref">[VC: IDREF]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'IDREFS'</code></td>

+<td><a href="#idref">[VC: IDREF]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'ENTITY'</code></td>

+<td><a href="#entname">[VC: Entity Name]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'ENTITIES'</code></td>

+<td><a href="#entname">[VC: Entity Name]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'NMTOKEN'</code></td>

+<td><a href="#nmtok">[VC: Name Token]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'NMTOKENS'</code></td>

+<td><a href="#nmtok">[VC: Name Token]</a></td>

+</tr>

+</tbody></table> <div class="constraint"><p class="prefix"><a name="id"></a><b>Validity

+constraint: ID</b></p><p>Values of type <b>ID</b> must match the <a href="#NT-Name">Name</a>

+production. A name must not appear more than once in an XML document as a

+value of this type; i.e., ID values must uniquely identify the elements which

+bear them.</p> </div> <div class="constraint"><p class="prefix"><a name="one-id-per-el"></a><b>Validity

+constraint: One ID per Element Type</b></p><p>No element type may have more

+than one ID attribute specified.</p> </div> <div class="constraint"><p class="prefix"><a

+name="id-default"></a><b>Validity constraint: ID Attribute Default</b></p><p>An

+ID attribute must have a declared default of <b>#IMPLIED</b> or <b>#REQUIRED</b>.</p> </div> <div

+class="constraint"><p class="prefix"><a name="idref"></a><b>Validity constraint:

+IDREF</b></p><p>Values of type <b>IDREF</b> must match the <a href="#NT-Name">Name</a>

+production, and values of type <b>IDREFS</b> must match <a href="#NT-Names">Names</a>;

+each <a href="#NT-Name">Name</a> must match the value of an ID attribute on

+some element in the XML document; i.e. <b>IDREF</b> values must match the

+value of some ID attribute.</p> </div> <div class="constraint"><p class="prefix"><a

+name="entname"></a><b>Validity constraint: Entity Name</b></p><p>Values of

+type <b>ENTITY</b> must match the <a href="#NT-Name">Name</a> production,

+values of type <b>ENTITIES</b> must match <a href="#NT-Names">Names</a>; each <a

+href="#NT-Name">Name</a> must match the name of an <a title="Unparsed Entity"

+href="#dt-unparsed">unparsed entity</a> declared in the <a title="Document Type Declaration"

+href="#dt-doctype">DTD</a>.</p> </div> <div class="constraint"><p class="prefix"><a

+name="nmtok"></a><b>Validity constraint: Name Token</b></p><p>Values of type <b>NMTOKEN</b>

+must match the <a href="#NT-Nmtoken">Nmtoken</a> production; values of type <b>NMTOKENS</b>

+must match <a title="" href="#NT-Nmtokens">Nmtokens</a>.</p> </div>  <p>[<a

+title="Enumerated Attribute Values" name="dt-enumerated">Definition</a>: <b>Enumerated

+attributes</b> can take one of a list of values provided in the declaration].

+There are two kinds of enumerated types:</p> <h5>Enumerated Attribute Types</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-EnumeratedType"></a>[57]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EnumeratedType</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-NotationType">NotationType</a> | <a href="#NT-Enumeration">Enumeration</a> </code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-NotationType"></a>[58]&nbsp;&nbsp;&nbsp;</td>

+<td><code>NotationType</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'NOTATION' <a href="#NT-S">S</a> '(' <a href="#NT-S">S</a>? <a href="#NT-Name">Name</a>

+(<a href="#NT-S">S</a>? '|' <a href="#NT-S">S</a>? <a href="#NT-Name">Name</a>)* <a

+href="#NT-S">S</a>? ')' </code></td>

+<td><a href="#notatn">[VC: Notation Attributes]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#OneNotationPer">[VC: One Notation Per Element Type]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#NoNotationEmpty">[VC: No Notation on Empty Element]</a></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-Enumeration"></a>[59]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Enumeration</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'(' <a href="#NT-S">S</a>? <a href="#NT-Nmtoken">Nmtoken</a> (<a

+href="#NT-S">S</a>? '|' <a href="#NT-S">S</a>? <a href="#NT-Nmtoken">Nmtoken</a>)* <a

+href="#NT-S">S</a>? ')'</code></td>

+<td><a href="#enum">[VC: Enumeration]</a></td>

+</tr>

+</tbody></table> <p>A <b>NOTATION</b> attribute identifies a <a title="Notation"

+href="#dt-notation">notation</a>, declared in the DTD with associated system

+and/or public identifiers, to be used in interpreting the element to which

+the attribute is attached.</p> <div class="constraint"><p class="prefix"><a

+name="notatn"></a><b>Validity constraint: Notation Attributes</b></p><p>Values

+of this type must match one of the <a href="#Notations"><cite>notation</cite></a>

+names included in the declaration; all notation names in the declaration must

+be declared.</p> </div> <div class="constraint"><p class="prefix"><a name="OneNotationPer"></a><b>Validity

+constraint: One Notation Per Element Type</b></p><p>No element type may have

+more than one <b>NOTATION</b> attribute specified.</p> </div> <div class="constraint"><p

+class="prefix"><a name="NoNotationEmpty"></a><b>Validity constraint: No Notation

+on Empty Element</b></p><p><a title="For Compatibility" href="#dt-compat">For

+compatibility</a>, an attribute of type <b>NOTATION</b> must not be declared

+on an element declared <b>EMPTY</b>.</p> </div> <div class="constraint"><p

+class="prefix"><a name="enum"></a><b>Validity constraint: Enumeration</b></p><p>Values

+of this type must match one of the <a href="#NT-Nmtoken">Nmtoken</a> tokens

+in the declaration.</p> </div> <p><a title="For interoperability" href="#dt-interop">For

+interoperability,</a> the same <a href="#NT-Nmtoken">Nmtoken</a> should not

+occur more than once in the enumerated attribute types of a single element

+type.</p> </div> <div class="div3"> <h4><a name="sec-attr-defaults"></a>3.3.2

+Attribute Defaults</h4> <p>An <a title="Attribute-List Declaration" href="#dt-attdecl">attribute

+declaration</a> provides information on whether the attribute's presence is

+required, and if not, how an XML processor should react if a declared attribute

+is absent in a document.</p> <h5>Attribute Defaults</h5><table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td><a name="NT-DefaultDecl"></a>[60]&nbsp;&nbsp;&nbsp;</td>

+<td><code>DefaultDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'#REQUIRED' |&nbsp;'#IMPLIED' </code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| (('#FIXED' S)? <a href="#NT-AttValue">AttValue</a>)</code></td>

+<td><a href="#RequiredAttr">[VC: Required Attribute]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#defattrvalid">[VC: Attribute Default Legal]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#CleanAttrVals">[WFC: No &lt; in Attribute Values]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#FixedAttr">[VC: Fixed Attribute Default]</a></td>

+</tr>

+</tbody></table> <p>In an attribute declaration, <b>#REQUIRED</b> means that

+the attribute must always be provided, <b>#IMPLIED</b> that no default value

+is provided.  [<a title="Attribute Default" name="dt-default">Definition</a>:

+If the declaration is neither <b>#REQUIRED</b> nor <b>#IMPLIED</b>, then the <a

+href="#NT-AttValue">AttValue</a> value contains the declared <b>default</b>

+value; the <b>#FIXED</b> keyword states that the attribute must always have

+the default value. If a default value is declared, when an XML processor encounters

+an omitted attribute, it is to behave as though the attribute were present

+with the declared default value.]</p> <div class="constraint"><p class="prefix"><a

+name="RequiredAttr"></a><b>Validity constraint: Required Attribute</b></p><p>If

+the default declaration is the keyword <b>#REQUIRED</b>, then the attribute

+must be specified for all elements of the type in the attribute-list declaration.</p> </div> <div

+class="constraint"><p class="prefix"><a name="defattrvalid"></a><b>Validity

+constraint: Attribute Default Legal</b></p><p>The declared default value must

+meet the lexical constraints of the declared attribute type.</p> </div> <div

+class="constraint"><p class="prefix"><a name="FixedAttr"></a><b>Validity constraint:

+Fixed Attribute Default</b></p><p>If an attribute has a default value declared

+with the <b>#FIXED</b> keyword, instances of that attribute must match the

+default value.</p> </div> <p>Examples of attribute-list declarations:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ATTLIST termdef

+          id      ID      #REQUIRED

+          name    CDATA   #IMPLIED>

+&lt;!ATTLIST list

+          type    (bullets|ordered|glossary)  "ordered">

+&lt;!ATTLIST form

+          method  CDATA   #FIXED "POST"></pre></td>

+</tr>

+</table> </div> <div class="div3"> <h4><a name="AVNormalize"></a>3.3.3 Attribute-Value

+Normalization</h4> <p>Before the value of an attribute is passed to the application

+or checked for validity, the XML processor must normalize the attribute value

+by applying the algorithm below, or by using some other method such that the

+value passed to the application is the same as that produced by the algorithm.</p> <ol>

+<li><p>All line breaks must have been normalized on input to #xA as described

+in <a href="#sec-line-ends"><b>2.11 End-of-Line Handling</b></a>, so the rest

+of this algorithm operates on text normalized in this way.</p></li>

+<li><p>Begin with a normalized value consisting of the empty string.</p> </li>

+<li><p>For each character, entity reference, or character reference in the

+unnormalized attribute value, beginning with the first and continuing to the

+last, do the following:</p> <ul>

+<li><p>For a character reference, append the referenced character to the normalized

+value.</p></li>

+<li><p>For an entity reference, recursively apply step 3 of this algorithm

+to the replacement text of the entity.</p></li>

+<li><p>For a white space character (#x20, #xD, #xA, #x9), append a space character

+(#x20) to the normalized value.</p></li>

+<li><p>For another character, append the character to the normalized value.</p> </li>

+</ul> </li>

+</ol> <p>If the attribute type is not CDATA, then the XML processor must further

+process the normalized attribute value by discarding any leading and trailing

+space (#x20) characters, and by replacing sequences of space (#x20) characters

+by a single space (#x20) character.</p> <p>Note that if the unnormalized attribute

+value contains a character reference to a white space character other than

+space (#x20), the normalized value contains the referenced character itself

+(#xD, #xA or #x9). This contrasts with the case where the unnormalized value

+contains a white space character (not a reference), which is replaced with

+a space character (#x20) in the normalized value and also contrasts with the

+case where the unnormalized value contains an entity reference whose replacement

+text contains a white space character; being recursively processed, the white

+space character is replaced with a space character (#x20) in the normalized

+value.</p> <p>All attributes for which no declaration has been read should

+be treated by a non-validating processor as if declared <b>CDATA</b>.</p> <p>Following

+are examples of attribute normalization. Given the following declarations:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY d "&amp;#xD;">

+&lt;!ENTITY a "&amp;#xA;">

+&lt;!ENTITY da "&amp;#xD;&amp;#xA;"></pre></td>

+</tr>

+</table> <p>the attribute specifications in the left column below would be

+normalized to the character sequences of the middle column if the attribute <code>a</code>

+is declared <b>NMTOKENS</b> and to those of the right columns if <code>a</code>

+is declared <b>CDATA</b>.</p> <table border="1" frame="border"><thead>

+<tr>

+<th rowspan="1" colspan="1">Attribute specification</th>

+<th rowspan="1" colspan="1">a is NMTOKENS</th>

+<th rowspan="1" colspan="1">a is CDATA</th>

+</tr>

+</thead><tbody>

+<tr>

+<td rowspan="1" colspan="1"><table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>a="

+

+xyz"</pre></td>

+</tr>

+</table></td>

+<td rowspan="1" colspan="1"><code>x y z</code></td>

+<td rowspan="1" colspan="1"><code>#x20 #x20 x y z</code></td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>a="&amp;d;&amp;d;A&amp;a;&amp;a;B&amp;da;"</pre></td>

+</tr>

+</table></td>

+<td rowspan="1" colspan="1"><code>A #x20 B</code></td>

+<td rowspan="1" colspan="1"><code>#x20 #x20 A #x20 #x20 B #x20 #x20</code></td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>a=

+"&amp;#xd;&amp;#xd;A&amp;#xa;&amp;#xa;B&amp;#xd;&amp;#xa;"</pre></td>

+</tr>

+</table></td>

+<td rowspan="1" colspan="1"><code>#xD #xD A #xA #xA B #xD #xA</code></td>

+<td rowspan="1" colspan="1"><code>#xD #xD A #xA #xA B #xD #xD</code></td>

+</tr>

+</tbody></table> <p>Note that the last example is invalid (but well-formed)

+if <code>a</code> is declared to be of type <b>NMTOKENS</b>.</p> </div> </div> <div

+class="div2"> <h3><a name="sec-condition-sect"></a>3.4 Conditional Sections</h3> <p>[<a

+title="conditional section" name="dt-cond-section">Definition</a>:  <b>Conditional

+sections</b> are portions of the <a title="Document Type Declaration" href="#dt-doctype">document

+type declaration external subset</a> which are included in, or excluded from,

+the logical structure of the DTD based on the keyword which governs them.]</p> <h5>Conditional

+Section</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-conditionalSect"></a>[61]&nbsp;&nbsp;&nbsp;</td>

+<td><code>conditionalSect</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-includeSect">includeSect</a> | <a href="#NT-ignoreSect">ignoreSect</a> </code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-includeSect"></a>[62]&nbsp;&nbsp;&nbsp;</td>

+<td><code>includeSect</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;![' S? 'INCLUDE' S? '[' <a href="#NT-extSubsetDecl">extSubsetDecl</a>

+']]&gt;' </code></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#condsec-nesting">[VC: Proper Conditional Section/PE Nesting]</a></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-ignoreSect"></a>[63]&nbsp;&nbsp;&nbsp;</td>

+<td><code>ignoreSect</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;![' S? 'IGNORE' S? '[' <a href="#NT-ignoreSectContents">ignoreSectContents</a>*

+']]&gt;'</code></td>

+<td><i>/*  */</i></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#condsec-nesting">[VC: Proper Conditional Section/PE Nesting]</a></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-ignoreSectContents"></a>[64]&nbsp;&nbsp;&nbsp;</td>

+<td><code>ignoreSectContents</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Ignore">Ignore</a> ('&lt;![' <a href="#NT-ignoreSectContents">ignoreSectContents</a>

+']]&gt;' <a href="#NT-Ignore">Ignore</a>)*</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Ignore"></a>[65]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Ignore</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-Char">Char</a>* - (<a href="#NT-Char">Char</a>* ('&lt;!['

+| ']]&gt;') <a href="#NT-Char">Char</a>*) </code></td>

+</tr>

+</tbody></table> <div class="constraint"><p class="prefix"><a name="condsec-nesting"></a><b>Validity

+constraint: Proper Conditional Section/PE Nesting</b></p><p>If any of the

+"<code>&lt;![</code>", "<code>[</code>", or "<code>]]&gt;</code>" of a conditional

+section is contained in the replacement text for a parameter-entity reference,

+all of them must be contained in the same replacement text.</p> </div> <p>Like

+the internal and external DTD subsets, a conditional section may contain one

+or more complete declarations, comments, processing instructions, or nested

+conditional sections, intermingled with white space.</p> <p>If the keyword

+of the conditional section is <b>INCLUDE</b>, then the contents of the conditional

+section are part of the DTD. If the keyword of the conditional section is <b>IGNORE</b>,

+then the contents of the conditional section are not logically part of the

+DTD.  If a conditional section with a keyword of <b>INCLUDE</b> occurs within

+a larger conditional section with a keyword of <b>IGNORE</b>, both the outer

+and the inner conditional sections are ignored. The contents of an ignored

+conditional section are parsed by ignoring all characters after the "<code>[</code>"

+following the keyword, except conditional section starts "<code>&lt;![</code>"

+and ends "<code>]]&gt;</code>", until the matching conditional section end

+is found. Parameter entity references are not recognized in this process.</p> <p>If

+the keyword of the conditional section is a parameter-entity reference, the

+parameter entity must be replaced by its content before the processor decides

+whether to include or ignore the conditional section.</p> <p>An example:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY % draft 'INCLUDE' >

+&lt;!ENTITY % final 'IGNORE' >

+

+&lt;![%draft;[

+&lt;!ELEMENT book (comments*, title, body, supplements?)>

+]]&gt;

+&lt;![%final;[

+&lt;!ELEMENT book (title, body, supplements?)>

+]]&gt;</pre></td>

+</tr>

+</table> </div>  </div>  <div class="div1"> <h2><a name="sec-physical-struct"></a>4

+Physical Structures</h2> <p>[<a title="Entity" name="dt-entity">Definition</a>:

+An XML document may consist of one or many storage units. These are called <b>entities</b>;

+they all have <b>content</b> and are all (except for the <a title="Document Entity"

+href="#dt-docent">document entity</a> and the <a title="Document Type Declaration"

+href="#dt-doctype">external DTD subset</a>) identified by entity <b>name</b>.]

+Each XML document has one entity called the <a title="Document Entity" href="#dt-docent">document

+entity</a>, which serves as the starting point for the <a title="XML Processor"

+href="#dt-xml-proc">XML processor</a> and may contain the whole document.</p> <p>Entities

+may be either parsed or unparsed. [<a title="Text Entity" name="dt-parsedent">Definition</a>:

+A <b>parsed entity's</b> contents are referred to as its <a title="Replacement Text"

+href="#dt-repltext">replacement text</a>; this <a title="Text" href="#dt-text">text</a>

+is considered an integral part of the document.]</p> <p>[<a title="Unparsed Entity"

+name="dt-unparsed">Definition</a>: An <b>unparsed entity</b> is a resource

+whose contents may or may not be <a title="Text" href="#dt-text">text</a>,

+and if text, may be other than XML. Each unparsed entity has an associated <a

+title="Notation" href="#dt-notation">notation</a>, identified by name. Beyond

+a requirement that an XML processor make the identifiers for the entity and

+notation available to the application, XML places no constraints on the contents

+of unparsed entities.]</p> <p>Parsed entities are invoked by name using entity

+references; unparsed entities by name, given in the value of <b>ENTITY</b>

+or <b>ENTITIES</b> attributes.</p> <p>[<a title="general entity" name="gen-entity">Definition</a>: <b>General

+entities</b> are entities for use within the document content. In this specification,

+general entities are sometimes referred to with the unqualified term <em>entity</em>

+when this leads to no ambiguity.] [<a title="Parameter entity" name="dt-PE">Definition</a>: <b>Parameter

+entities</b> are parsed entities for use within the DTD.] These two types

+of entities use different forms of reference and are recognized in different

+contexts. Furthermore, they occupy different namespaces; a parameter entity

+and a general entity with the same name are two distinct entities.</p> <div

+class="div2"> <h3><a name="sec-references"></a>4.1 Character and Entity References</h3> <p>[<a

+title="Character Reference" name="dt-charref">Definition</a>:  A <b>character

+reference</b> refers to a specific character in the ISO/IEC 10646 character

+set, for example one not directly accessible from available input devices.]</p> <h5>Character

+Reference</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-CharRef"></a>[66]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CharRef</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&amp;#' [0-9]+ ';' </code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| '&amp;#x' [0-9a-fA-F]+ ';'</code></td>

+<td><a href="#wf-Legalchar">[WFC: Legal Character]</a></td>

+</tr>

+</tbody></table> <div class="constraint"><p class="prefix"><a name="wf-Legalchar"></a><b>Well-formedness

+constraint: Legal Character</b></p><p>Characters referred to using character

+references must match the production for <a title="" href="#NT-Char">Char</a>.</p> </div> <p>If

+the character reference begins with "<code>&amp;#x</code>", the digits and

+letters up to the terminating <code>;</code> provide a hexadecimal representation

+of the character's code point in ISO/IEC 10646. If it begins just with "<code>&amp;#</code>",

+the digits up to the terminating <code>;</code> provide a decimal representation

+of the character's code point.</p> <p>[<a title="Entity Reference" name="dt-entref">Definition</a>:

+An <b>entity reference</b> refers to the content of a named entity.] [<a title="General Entity Reference"

+name="dt-GERef">Definition</a>: References to parsed general entities use

+ampersand (<code>&amp;</code>) and semicolon (<code>;</code>) as delimiters.]

+[<a title="Parameter-entity reference" name="dt-PERef">Definition</a>:  <b>Parameter-entity

+references</b> use percent-sign (<code>%</code>) and semicolon (<code>;</code>)

+as delimiters.]</p> <h5>Entity Reference</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-Reference"></a>[67]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Reference</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-EntityRef">EntityRef</a> | <a href="#NT-CharRef">CharRef</a></code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-EntityRef"></a>[68]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EntityRef</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&amp;' <a href="#NT-Name">Name</a> ';'</code></td>

+<td><a href="#wf-entdeclared">[WFC: Entity Declared]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#vc-entdeclared">[VC: Entity Declared]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#textent">[WFC: Parsed Entity]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#norecursion">[WFC: No Recursion]</a></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-PEReference"></a>[69]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PEReference</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'%' <a href="#NT-Name">Name</a> ';'</code></td>

+<td><a href="#vc-entdeclared">[VC: Entity Declared]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#norecursion">[WFC: No Recursion]</a></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td></td>

+<td><a href="#indtd">[WFC: In DTD]</a></td>

+</tr>

+</tbody></table> <div class="constraint"><p class="prefix"><a name="wf-entdeclared"></a><b>Well-formedness

+constraint: Entity Declared</b></p><p>In a document without any DTD, a document

+with only an internal DTD subset which contains no parameter entity references,

+or a document with "<code>standalone='yes'</code>", for an entity reference

+that does not occur within the external subset or a parameter entity, the <a

+href="#NT-Name">Name</a> given in the entity reference must <a title="match"

+href="#dt-match">match</a> that in an <a href="#sec-entity-decl"><cite>entity

+declaration</cite></a> that does not occur within the external subset or a

+parameter entity, except that well-formed documents need not declare any of

+the following entities: <code>amp</code>, <code>lt</code>, <code>gt</code>, <code>apos</code>, <code>quot</code>.

+The declaration of a general entity must precede any reference to it which

+appears in a default value in an attribute-list declaration.</p> <p>Note that

+if entities are declared in the external subset or in external parameter entities,

+a non-validating processor is <a href="#include-if-valid"><cite>not obligated

+to</cite></a> read and process their declarations; for such documents, the

+rule that an entity must be declared is a well-formedness constraint only

+if <a href="#sec-rmd"><cite>standalone='yes'</cite></a>.</p> </div> <div class="constraint"><p

+class="prefix"><a name="vc-entdeclared"></a><b>Validity constraint: Entity

+Declared</b></p><p>In a document with an external subset or external parameter

+entities with "<code>standalone='no'</code>", the <a href="#NT-Name">Name</a>

+given in the entity reference must <a title="match" href="#dt-match">match</a>

+that in an <a href="#sec-entity-decl"><cite>entity declaration</cite></a>.

+For interoperability, valid documents should declare the entities <code>amp</code>, <code>lt</code>, <code>gt</code>, <code>apos</code>, <code>quot</code

+>, in the form specified in <a href="#sec-predefined-ent"><b>4.6 Predefined

+Entities</b></a>. The declaration of a parameter entity must precede any reference

+to it. Similarly, the declaration of a general entity must precede any attribute-list

+declaration containing a default value with a direct or indirect reference

+to that general entity.</p> </div>  <div class="constraint"><p class="prefix"><a

+name="textent"></a><b>Well-formedness constraint: Parsed Entity</b></p><p>An

+entity reference must not contain the name of an <a title="Unparsed Entity"

+href="#dt-unparsed">unparsed entity</a>. Unparsed entities may be referred

+to only in <a title="Attribute Value" href="#dt-attrval">attribute values</a>

+declared to be of type <b>ENTITY</b> or <b>ENTITIES</b>.</p> </div> <div class="constraint"><p

+class="prefix"><a name="norecursion"></a><b>Well-formedness constraint: No

+Recursion</b></p><p>A parsed entity must not contain a recursive reference

+to itself, either directly or indirectly.</p> </div> <div class="constraint"><p

+class="prefix"><a name="indtd"></a><b>Well-formedness constraint: In DTD</b></p><p>Parameter-entity

+references may only appear in the <a title="Document Type Declaration" href="#dt-doctype">DTD</a>.</p> </div> <p>Examples

+of character and entity references:</p> <table class="eg" width="100%" border="1"

+cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>Type &lt;key>less-than&lt;/key> (&amp;#x3C;) to save options.

+This document was prepared on &amp;docdate; and

+is classified &amp;security-level;.</pre></td>

+</tr>

+</table> <p>Example of a parameter-entity reference:</p> <table class="eg"

+width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!-- declare the parameter entity "ISOLat2"... -->

+&lt;!ENTITY % ISOLat2

+         SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >

+&lt;!-- ... now reference it. -->

+%ISOLat2;</pre></td>

+</tr>

+</table> </div> <div class="div2"> <h3><a name="sec-entity-decl"></a>4.2 Entity

+Declarations</h3> <p>[<a title="entity declaration" name="dt-entdecl">Definition</a>:

+ Entities are declared thus:]</p> <h5>Entity Declaration</h5><table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td><a name="NT-EntityDecl"></a>[70]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EntityDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-GEDecl">GEDecl</a> | <a href="#NT-PEDecl">PEDecl</a></code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-GEDecl"></a>[71]&nbsp;&nbsp;&nbsp;</td>

+<td><code>GEDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!ENTITY' <a href="#NT-S">S</a> <a href="#NT-Name">Name</a> <a

+href="#NT-S">S</a> <a href="#NT-EntityDef">EntityDef</a> <a href="#NT-S">S</a>?

+'>'</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-PEDecl"></a>[72]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PEDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!ENTITY' <a href="#NT-S">S</a> '%' <a href="#NT-S">S</a> <a

+href="#NT-Name">Name</a> <a href="#NT-S">S</a> <a href="#NT-PEDef">PEDef</a> <a

+href="#NT-S">S</a>? '>'</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-EntityDef"></a>[73]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EntityDef</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-EntityValue">EntityValue</a> | (<a href="#NT-ExternalID">ExternalID</a> <a

+href="#NT-NDataDecl">NDataDecl</a>?)</code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-PEDef"></a>[74]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PEDef</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-EntityValue">EntityValue</a> | <a href="#NT-ExternalID">ExternalID</a></code></td>

+</tr>

+</tbody></table> <p>The <a href="#NT-Name">Name</a> identifies the entity

+in an <a title="Entity Reference" href="#dt-entref">entity reference</a> or,

+in the case of an unparsed entity, in the value of an <b>ENTITY</b> or <b>ENTITIES</b>

+attribute. If the same entity is declared more than once, the first declaration

+encountered is binding; at user option, an XML processor may issue a warning

+if entities are declared multiple times.</p> <div class="div3"> <h4><a name="sec-internal-ent"></a>4.2.1

+Internal Entities</h4> <p>[<a title="Internal Entity Replacement Text" name="dt-internent">Definition</a>:

+If the entity definition is an <a href="#NT-EntityValue">EntityValue</a>,

+the defined entity is called an <b>internal entity</b>. There is no separate

+physical storage object, and the content of the entity is given in the declaration.]

+Note that some processing of entity and character references in the <a title="Literal Entity Value"

+href="#dt-litentval">literal entity value</a> may be required to produce the

+correct <a title="Replacement Text" href="#dt-repltext">replacement text</a>:

+see <a href="#intern-replacement"><b>4.5 Construction of Internal Entity Replacement

+Text</b></a>.</p> <p>An internal entity is a <a title="Text Entity" href="#dt-parsedent">parsed

+entity</a>.</p> <p>Example of an internal entity declaration:</p> <table class="eg"

+width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY Pub-Status "This is a pre-release of the

+ specification."></pre></td>

+</tr>

+</table> </div> <div class="div3"> <h4><a name="sec-external-ent"></a>4.2.2

+External Entities</h4> <p>[<a title="External Entity" name="dt-extent">Definition</a>:

+If the entity is not internal, it is an <b>external entity</b>, declared as

+follows:]</p> <h5>External Entity Declaration</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-ExternalID"></a>[75]&nbsp;&nbsp;&nbsp;</td>

+<td><code>ExternalID</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'SYSTEM' <a href="#NT-S">S</a> <a href="#NT-SystemLiteral">SystemLiteral</a></code></td>

+</tr>

+<tr valign="baseline">

+<td></td>

+<td></td>

+<td></td>

+<td><code>| 'PUBLIC' <a href="#NT-S">S</a> <a href="#NT-PubidLiteral">PubidLiteral</a> <a

+href="#NT-S">S</a> <a href="#NT-SystemLiteral">SystemLiteral</a> </code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-NDataDecl"></a>[76]&nbsp;&nbsp;&nbsp;</td>

+<td><code>NDataDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-S">S</a> 'NDATA' <a href="#NT-S">S</a> <a href="#NT-Name">Name</a></code></td>

+<td><a href="#not-declared">[VC: Notation Declared]</a></td>

+</tr>

+</tbody></table> <p>If the <a href="#NT-NDataDecl">NDataDecl</a> is present,

+this is a general <a title="Unparsed Entity" href="#dt-unparsed">unparsed

+entity</a>; otherwise it is a parsed entity.</p> <div class="constraint"><p

+class="prefix"><a name="not-declared"></a><b>Validity constraint: Notation

+Declared</b></p><p>The <a href="#NT-Name">Name</a> must match the declared

+name of a <a title="Notation" href="#dt-notation">notation</a>.</p> </div> <p>[<a

+title="System Identifier" name="dt-sysid">Definition</a>: The <a href="#NT-SystemLiteral">SystemLiteral</a>

+is called the entity's <b>system identifier</b>. It is a URI reference (as

+defined in <a href="#rfc2396">[IETF RFC 2396]</a>, updated by <a href="#rfc2732">[IETF

+RFC 2732]</a>), meant to be dereferenced to obtain input for the XML processor

+to construct the entity's replacement text.] It is an error for a fragment

+identifier (beginning with a <code>#</code> character) to be part of a system

+identifier. Unless otherwise provided by information outside the scope of

+this specification (e.g. a special XML element type defined by a particular

+DTD, or a processing instruction defined by a particular application specification),

+relative URIs are relative to the location of the resource within which the

+entity declaration occurs. A URI might thus be relative to the <a title="Document Entity"

+href="#dt-docent">document entity</a>, to the entity containing the <a title="Document Type Declaration"

+href="#dt-doctype">external DTD subset</a>, or to some other <a title="External Entity"

+href="#dt-extent">external parameter entity</a>.</p> <p>URI references require

+encoding and escaping of certain characters. The disallowed characters include

+all non-ASCII characters, plus the excluded characters listed in Section 2.4

+of <a href="#rfc2396">[IETF RFC 2396]</a>, except for the number sign (<code>#</code>)

+and percent sign (<code>%</code>) characters and the square bracket characters

+re-allowed in <a href="#rfc2732">[IETF RFC 2732]</a>. Disallowed characters

+must be escaped as follows:</p> <ol>

+<li><p>Each disallowed character is converted to UTF-8 <a href="#rfc2279">[IETF

+RFC 2279]</a> as one or more bytes.</p></li>

+<li><p>Any octets corresponding to a disallowed character are escaped with

+the URI escaping mechanism (that is, converted to <code>%</code><var>HH</var>,

+where HH is the hexadecimal notation of the byte value).</p></li>

+<li><p>The original character is replaced by the resulting character sequence.</p> </li>

+</ol> <p>[<a title="Public identifier" name="dt-pubid">Definition</a>:  In

+addition to a system identifier, an external identifier may include a <b>public

+identifier</b>.] An XML processor attempting to retrieve the entity's content

+may use the public identifier to try to generate an alternative URI reference.

+If the processor is unable to do so, it must use the URI reference specified

+in the system literal. Before a match is attempted, all strings of white space

+in the public identifier must be normalized to single space characters (#x20),

+and leading and trailing white space must be removed.</p> <p>Examples of external

+entity declarations:</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY open-hatch

+         SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">

+&lt;!ENTITY open-hatch

+         PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"

+         "http://www.textuality.com/boilerplate/OpenHatch.xml">

+&lt;!ENTITY hatch-pic

+         SYSTEM "../grafix/OpenHatch.gif"

+         NDATA gif ></pre></td>

+</tr>

+</table> </div> </div> <div class="div2"> <h3><a name="TextEntities"></a>4.3

+Parsed Entities</h3> <div class="div3"> <h4><a name="sec-TextDecl"></a>4.3.1

+The Text Declaration</h4> <p>External parsed entities should each begin with

+a <b>text declaration</b>.</p> <h5>Text Declaration</h5><table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td><a name="NT-TextDecl"></a>[77]&nbsp;&nbsp;&nbsp;</td>

+<td><code>TextDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;?xml' <a href="#NT-VersionInfo">VersionInfo</a>? <a href="#NT-EncodingDecl">EncodingDecl</a> <a

+href="#NT-S">S</a>? '?>'</code></td>

+</tr>

+</tbody></table> <p>The text declaration must be provided literally, not by

+reference to a parsed entity. No text declaration may appear at any position

+other than the beginning of an external parsed entity. The text declaration

+in an external parsed entity is not considered part of its <a title="Replacement Text"

+href="#dt-repltext">replacement text</a>.</p> </div> <div class="div3"> <h4><a

+name="wf-entities"></a>4.3.2 Well-Formed Parsed Entities</h4> <p>The document

+entity is well-formed if it matches the production labeled <a href="#NT-document">document</a>.

+An external general parsed entity is well-formed if it matches the production

+labeled <a href="#NT-extParsedEnt">extParsedEnt</a>. All external parameter

+entities are well-formed by definition.</p> <h5>Well-Formed External Parsed

+Entity</h5><table class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-extParsedEnt"></a>[78]&nbsp;&nbsp;&nbsp;</td>

+<td><code>extParsedEnt</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-TextDecl">TextDecl</a>? <a href="#NT-content">content</a></code></td>

+</tr>

+</tbody></table> <p>An internal general parsed entity is well-formed if its

+replacement text matches the production labeled <a href="#NT-content">content</a>.

+All internal parameter entities are well-formed by definition.</p> <p>A consequence

+of well-formedness in entities is that the logical and physical structures

+in an XML document are properly nested; no <a title="Start-Tag" href="#dt-stag">start-tag</a>, <a

+title="End Tag" href="#dt-etag">end-tag</a>, <a title="Empty" href="#dt-empty">empty-element

+tag</a>, <a title="Element" href="#dt-element">element</a>, <a title="Comment"

+href="#dt-comment">comment</a>, <a title="Processing instruction" href="#dt-pi">processing

+instruction</a>, <a title="Character Reference" href="#dt-charref">character

+reference</a>, or <a title="Entity Reference" href="#dt-entref">entity reference</a>

+can begin in one entity and end in another.</p> </div> <div class="div3"> <h4><a

+name="charencoding"></a>4.3.3 Character Encoding in Entities</h4> <p>Each

+external parsed entity in an XML document may use a different encoding for

+its characters. All XML processors must be able to read entities in both the

+UTF-8 and UTF-16 encodings. The terms "UTF-8" and "UTF-16" in this specification

+do not apply to character encodings with any other labels, even if the encodings

+or labels are very similar to UTF-8 or UTF-16.</p> <p>Entities encoded in

+UTF-16 must begin with the Byte Order Mark described by Annex F of <a href="#ISO10646">[ISO/IEC

+10646]</a>, Annex H of <a href="#ISO10646-2000">[ISO/IEC 10646-2000]</a>,

+section 2.4 of <a href="#Unicode">[Unicode]</a>, and section 2.7 of <a href="#Unicode3">[Unicode3]</a>

+(the ZERO WIDTH NO-BREAK SPACE character, #xFEFF). This is an encoding signature,

+not part of either the markup or the character data of the XML document. XML

+processors must be able to use this character to differentiate between UTF-8

+and UTF-16 encoded documents.</p> <p>Although an XML processor is required

+to read only entities in the UTF-8 and UTF-16 encodings, it is recognized

+that other encodings are used around the world, and it may be desired for

+XML processors to read entities that use them. In the absence of external

+character encoding information (such as MIME headers), parsed entities which

+are stored in an encoding other than UTF-8 or UTF-16 must begin with a text

+declaration (see <a href="#sec-TextDecl"><b>4.3.1 The Text Declaration</b></a>)

+containing an encoding declaration:</p> <h5>Encoding Declaration</h5><table

+class="scrap"><tbody>

+<tr valign="baseline">

+<td><a name="NT-EncodingDecl"></a>[80]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EncodingDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-S">S</a> 'encoding' <a href="#NT-Eq">Eq</a> ('"' <a

+href="#NT-EncName">EncName</a> '"' | "'" <a href="#NT-EncName">EncName</a>

+"'" ) </code></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-EncName"></a>[81]&nbsp;&nbsp;&nbsp;</td>

+<td><code>EncName</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code></td>

+<td><i>/* Encoding name contains only Latin characters */</i></td>

+</tr>

+</tbody></table> <p>In the <a title="Document Entity" href="#dt-docent">document

+entity</a>, the encoding declaration is part of the <a title="XML Declaration"

+href="#dt-xmldecl">XML declaration</a>. The <a href="#NT-EncName">EncName</a>

+is the name of the encoding used.</p>  <p>In an encoding declaration, the

+values "<code>UTF-8</code>", "<code>UTF-16</code>", "<code>ISO-10646-UCS-2</code>",

+and "<code>ISO-10646-UCS-4</code>" should be used for the various encodings

+and transformations of Unicode / ISO/IEC 10646, the values "<code>ISO-8859-1</code>",

+"<code>ISO-8859-2</code>", ... "<code>ISO-8859-</code><var>n</var>" (where <var>n</var>

+is the part number) should be used for the parts of ISO 8859, and the values

+"<code>ISO-2022-JP</code>", "<code>Shift_JIS</code>", and "<code>EUC-JP</code>"

+should be used for the various encoded forms of JIS X-0208-1997. It is recommended

+that character encodings registered (as <em>charset</em>s) with the Internet

+Assigned Numbers Authority <a href="#IANA">[IANA-CHARSETS]</a>, other than

+those just listed, be referred to using their registered names; other encodings

+should use names starting with an "x-" prefix. XML processors should match

+character encoding names in a case-insensitive way and should either interpret

+an IANA-registered name as the encoding registered at IANA for that name or

+treat it as unknown (processors are, of course, not required to support all

+IANA-registered encodings).</p> <p>In the absence of information provided

+by an external transport protocol (e.g. HTTP or MIME), it is an <a title="Error"

+href="#dt-error">error</a> for an entity including an encoding declaration

+to be presented to the XML processor in an encoding other than that named

+in the declaration, or for an entity which begins with neither a Byte Order

+Mark nor an encoding declaration to use an encoding other than UTF-8. Note

+that since ASCII is a subset of UTF-8, ordinary ASCII entities do not strictly

+need an encoding declaration.</p> <p>It is a fatal error for a <a href="#NT-TextDecl">TextDecl</a>

+to occur other than at the beginning of an external entity.</p> <p>It is a <a

+title="Fatal Error" href="#dt-fatal">fatal error</a> when an XML processor

+encounters an entity with an encoding that it is unable to process. It is

+a fatal error if an XML entity is determined (via default, encoding declaration,

+or higher-level protocol) to be in a certain encoding but contains octet sequences

+that are not legal in that encoding. It is also a fatal error if an XML entity

+contains no encoding declaration and its content is not legal UTF-8 or UTF-16.</p> <p>Examples

+of text declarations containing encoding declarations:</p> <table class="eg"

+width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;?xml encoding='UTF-8'?>

+&lt;?xml encoding='EUC-JP'?></pre></td>

+</tr>

+</table> </div> </div> <div class="div2"> <h3><a name="entproc"></a>4.4 XML

+Processor Treatment of Entities and References</h3> <p>The table below summarizes

+the contexts in which character references, entity references, and invocations

+of unparsed entities might appear and the required behavior of an <a title="XML Processor"

+href="#dt-xml-proc">XML processor</a> in each case. The labels in the leftmost

+column describe the recognition context: </p><dl>

+<dt class="label">Reference in Content</dt>

+<dd> <p>as a reference anywhere after the <a title="Start-Tag" href="#dt-stag">start-tag</a>

+and before the <a title="End Tag" href="#dt-etag">end-tag</a> of an element;

+corresponds to the nonterminal <a href="#NT-content">content</a>.</p> </dd>

+<dt class="label">Reference in Attribute Value</dt>

+<dd> <p>as a reference within either the value of an attribute in a <a title="Start-Tag"

+href="#dt-stag">start-tag</a>, or a default value in an <a title="Attribute-List Declaration"

+href="#dt-attdecl">attribute declaration</a>; corresponds to the nonterminal <a

+href="#NT-AttValue">AttValue</a>.</p> </dd>

+<dt class="label">Occurs as Attribute Value</dt>

+<dd> <p>as a <a href="#NT-Name">Name</a>, not a reference, appearing either

+as the value of an attribute which has been declared as type <b>ENTITY</b>,

+or as one of the space-separated tokens in the value of an attribute which

+has been declared as type <b>ENTITIES</b>.</p> </dd>

+<dt class="label">Reference in Entity Value</dt>

+<dd> <p>as a reference within a parameter or internal entity's <a title="Literal Entity Value"

+href="#dt-litentval">literal entity value</a> in the entity's declaration;

+corresponds to the nonterminal <a href="#NT-EntityValue">EntityValue</a>.</p> </dd>

+<dt class="label">Reference in DTD</dt>

+<dd> <p>as a reference within either the internal or external subsets of the <a

+title="Document Type Declaration" href="#dt-doctype">DTD</a>, but outside

+of an <a href="#NT-EntityValue">EntityValue</a>, <a href="#NT-AttValue">AttValue</a>, <a

+href="#NT-PI">PI</a>, <a href="#NT-Comment">Comment</a>, <a href="#NT-SystemLiteral">SystemLiteral</a>, <a

+href="#NT-PubidLiteral">PubidLiteral</a>, or the contents of an ignored conditional

+section (see <a href="#sec-condition-sect"><b>3.4 Conditional Sections</b></a>).</p> <p>.</p> </dd>

+</dl><p></p> <table border="1" frame="border" cellpadding="7"><tbody align="center">

+<tr>

+<td rowspan="2" colspan="1"></td>

+<td rowspan="1" colspan="4" align="center" valign="bottom">Entity Type</td>

+<td rowspan="2" colspan="1" align="center">Character</td>

+</tr>

+<tr align="center" valign="bottom">

+<td rowspan="1" colspan="1">Parameter</td>

+<td rowspan="1" colspan="1">Internal General</td>

+<td rowspan="1" colspan="1">External Parsed General</td>

+<td rowspan="1" colspan="1">Unparsed</td>

+</tr>

+<tr align="center" valign="middle">

+<td rowspan="1" colspan="1" align="right">Reference in Content</td>

+<td rowspan="1" colspan="1"><a href="#not-recognized"><cite>Not recognized</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#included"><cite>Included</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#include-if-valid"><cite>Included if

+validating</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#included"><cite>Included</cite></a></td>

+</tr>

+<tr align="center" valign="middle">

+<td rowspan="1" colspan="1" align="right">Reference in Attribute Value</td>

+<td rowspan="1" colspan="1"><a href="#not-recognized"><cite>Not recognized</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#inliteral"><cite>Included in literal</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#included"><cite>Included</cite></a></td>

+</tr>

+<tr align="center" valign="middle">

+<td rowspan="1" colspan="1" align="right">Occurs as Attribute Value</td>

+<td rowspan="1" colspan="1"><a href="#not-recognized"><cite>Not recognized</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#notify"><cite>Notify</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#not-recognized"><cite>Not recognized</cite></a></td>

+</tr>

+<tr align="center" valign="middle">

+<td rowspan="1" colspan="1" align="right">Reference in EntityValue</td>

+<td rowspan="1" colspan="1"><a href="#inliteral"><cite>Included in literal</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#bypass"><cite>Bypassed</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#bypass"><cite>Bypassed</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#included"><cite>Included</cite></a></td>

+</tr>

+<tr align="center" valign="middle">

+<td rowspan="1" colspan="1" align="right">Reference in DTD</td>

+<td rowspan="1" colspan="1"><a href="#as-PE"><cite>Included as PE</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+<td rowspan="1" colspan="1"><a href="#forbidden"><cite>Forbidden</cite></a></td>

+</tr>

+</tbody></table> <div class="div3"> <h4><a name="not-recognized"></a>4.4.1

+Not Recognized</h4> <p>Outside the DTD, the <code>%</code> character has no

+special significance; thus, what would be parameter entity references in the

+DTD are not recognized as markup in <a href="#NT-content">content</a>. Similarly,

+the names of unparsed entities are not recognized except when they appear

+in the value of an appropriately declared attribute.</p> </div> <div class="div3"> <h4><a

+name="included"></a>4.4.2 Included</h4> <p>[<a title="Include" name="dt-include">Definition</a>:

+An entity is <b>included</b> when its <a title="Replacement Text" href="#dt-repltext">replacement

+text</a> is retrieved and processed, in place of the reference itself, as

+though it were part of the document at the location the reference was recognized.]

+The replacement text may contain both <a title="Character Data" href="#dt-chardata">character

+data</a> and (except for parameter entities) <a title="Markup" href="#dt-markup">markup</a>,

+which must be recognized in the usual way. (The string "<code>AT&amp;amp;T;</code>"

+expands to "<code>AT&amp;T;</code>" and the remaining ampersand is not recognized

+as an entity-reference delimiter.) A character reference is <b>included</b>

+when the indicated character is processed in place of the reference itself. </p> </div> <div

+class="div3"> <h4><a name="include-if-valid"></a>4.4.3 Included If Validating</h4> <p>When

+an XML processor recognizes a reference to a parsed entity, in order to <a

+title="Validity" href="#dt-valid">validate</a> the document, the processor

+must <a title="Include" href="#dt-include">include</a> its replacement text.

+If the entity is external, and the processor is not attempting to validate

+the XML document, the processor <a title="May" href="#dt-may">may</a>, but

+need not, include the entity's replacement text. If a non-validating processor

+does not include the replacement text, it must inform the application that

+it recognized, but did not read, the entity.</p> <p>This rule is based on

+the recognition that the automatic inclusion provided by the SGML and XML

+entity mechanism, primarily designed to support modularity in authoring, is

+not necessarily appropriate for other applications, in particular document

+browsing. Browsers, for example, when encountering an external parsed entity

+reference, might choose to provide a visual indication of the entity's presence

+and retrieve it for display only on demand.</p> </div> <div class="div3"> <h4><a

+name="forbidden"></a>4.4.4 Forbidden</h4> <p>The following are forbidden,

+and constitute <a title="Fatal Error" href="#dt-fatal">fatal</a> errors:</p> <ul>

+<li><p>the appearance of a reference to an <a title="Unparsed Entity" href="#dt-unparsed">unparsed

+entity</a>.</p></li>

+<li><p>the appearance of any character or general-entity reference in the

+DTD except within an <a href="#NT-EntityValue">EntityValue</a> or <a href="#NT-AttValue">AttValue</a>.</p> </li>

+<li><p>a reference to an external entity in an attribute value.</p></li>

+</ul> </div> <div class="div3"> <h4><a name="inliteral"></a>4.4.5 Included

+in Literal</h4> <p>When an <a title="Entity Reference" href="#dt-entref">entity

+reference</a> appears in an attribute value, or a parameter entity reference

+appears in a literal entity value, its <a title="Replacement Text" href="#dt-repltext">replacement

+text</a> is processed in place of the reference itself as though it were part

+of the document at the location the reference was recognized, except that

+a single or double quote character in the replacement text is always treated

+as a normal data character and will not terminate the literal. For example,

+this is well-formed:</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!--  -->

+&lt;!ENTITY % YN '"Yes"' >

+&lt;!ENTITY WhatHeSaid "He said %YN;" ></pre></td>

+</tr>

+</table> <p>while this is not:</p> <table class="eg" width="100%" border="1"

+cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY EndAttr "27'" >

+&lt;element attribute='a-&amp;EndAttr;></pre></td>

+</tr>

+</table> </div> <div class="div3"> <h4><a name="notify"></a>4.4.6 Notify</h4> <p>When

+the name of an <a title="Unparsed Entity" href="#dt-unparsed">unparsed entity</a>

+appears as a token in the value of an attribute of declared type <b>ENTITY</b>

+or <b>ENTITIES</b>, a validating processor must inform the application of

+the <a title="System Identifier" href="#dt-sysid">system</a> and <a title="Public identifier"

+href="#dt-pubid">public</a> (if any) identifiers for both the entity and its

+associated <a title="Notation" href="#dt-notation">notation</a>.</p> </div> <div

+class="div3"> <h4><a name="bypass"></a>4.4.7 Bypassed</h4> <p>When a general

+entity reference appears in the <a href="#NT-EntityValue">EntityValue</a>

+in an entity declaration, it is bypassed and left as is.</p> </div> <div class="div3"> <h4><a

+name="as-PE"></a>4.4.8 Included as PE</h4> <p>Just as with external parsed

+entities, parameter entities need only be <a href="#include-if-valid"><cite>included

+if validating</cite></a>. When a parameter-entity reference is recognized

+in the DTD and included, its <a title="Replacement Text" href="#dt-repltext">replacement

+text</a> is enlarged by the attachment of one leading and one following space

+(#x20) character; the intent is to constrain the replacement text of parameter

+entities to contain an integral number of grammatical tokens in the DTD. This

+behavior does not apply to parameter entity references within entity values;

+these are described in <a href="#inliteral"><b>4.4.5 Included in Literal</b></a>.</p> </div> </div> <div

+class="div2"> <h3><a name="intern-replacement"></a>4.5 Construction of Internal

+Entity Replacement Text</h3> <p>In discussing the treatment of internal entities,

+it is useful to distinguish two forms of the entity's value. [<a title="Literal Entity Value"

+name="dt-litentval">Definition</a>: The <b>literal entity value</b> is the

+quoted string actually present in the entity declaration, corresponding to

+the non-terminal <a href="#NT-EntityValue">EntityValue</a>.] [<a title="Replacement Text"

+name="dt-repltext">Definition</a>: The <b>replacement text</b> is the content

+of the entity, after replacement of character references and parameter-entity

+references.]</p> <p>The literal entity value as given in an internal entity

+declaration (<a href="#NT-EntityValue">EntityValue</a>) may contain character,

+parameter-entity, and general-entity references. Such references must be contained

+entirely within the literal entity value. The actual replacement text that

+is <a title="Include" href="#dt-include">included</a> as described above must

+contain the <em>replacement text</em> of any parameter entities referred to,

+and must contain the character referred to, in place of any character references

+in the literal entity value; however, general-entity references must be left

+as-is, unexpanded. For example, given the following declarations:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY % pub    "&amp;#xc9;ditions Gallimard" >

+&lt;!ENTITY   rights "All rights reserved" >

+&lt;!ENTITY   book   "La Peste: Albert Camus,

+&amp;#xA9; 1947 %pub;. &amp;rights;" ></pre></td>

+</tr>

+</table> <p>then the replacement text for the entity "<code>book</code>" is:</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>La Peste: Albert Camus,

+&copy; 1947 &Eacute;ditions Gallimard. &amp;rights;</pre></td>

+</tr>

+</table> <p>The general-entity reference "<code>&amp;rights;</code>" would

+be expanded should the reference "<code>&amp;book;</code>" appear in the document's

+content or an attribute value.</p> <p>These simple rules may have complex

+interactions; for a detailed discussion of a difficult example, see <a href="#sec-entexpand"><b>D

+Expansion of Entity and Character References</b></a>.</p> </div> <div class="div2"> <h3><a

+name="sec-predefined-ent"></a>4.6 Predefined Entities</h3> <p>[<a title="escape"

+name="dt-escape">Definition</a>: Entity and character references can both

+be used to <b>escape</b> the left angle bracket, ampersand, and other delimiters.

+A set of general entities (<code>amp</code>, <code>lt</code>, <code>gt</code>, <code>apos</code>, <code>quot</code>)

+is specified for this purpose. Numeric character references may also be used;

+they are expanded immediately when recognized and must be treated as character

+data, so the numeric character references "<code>&amp;#60;</code>" and "<code>&amp;#38;</code>"

+may be used to escape <code>&lt;</code> and <code>&amp;</code> when they occur

+in character data.]</p> <p>All XML processors must recognize these entities

+whether they are declared or not. <a title="For interoperability" href="#dt-interop">For

+interoperability</a>, valid XML documents should declare these entities, like

+any others, before using them. If the entities <code>lt</code> or <code>amp</code>

+are declared, they must be declared as internal entities whose replacement

+text is a character reference to the respective character (less-than sign

+or ampersand) being escaped; the double escaping is required for these entities

+so that references to them produce a well-formed result. If the entities <code>gt</code>, <code>apos</code>,

+or <code>quot</code> are declared, they must be declared as internal entities

+whose replacement text is the single character being escaped (or a character

+reference to that character; the double escaping here is unnecessary but harmless).

+For example:</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY lt     "&amp;#38;#60;">

+&lt;!ENTITY gt     "&amp;#62;">

+&lt;!ENTITY amp    "&amp;#38;#38;">

+&lt;!ENTITY apos   "&amp;#39;">

+&lt;!ENTITY quot   "&amp;#34;"></pre></td>

+</tr>

+</table>  </div> <div class="div2"> <h3><a name="Notations"></a>4.7 Notation

+Declarations</h3> <p>[<a title="Notation" name="dt-notation">Definition</a>: <b>Notations</b>

+identify by name the format of <a title="External Entity" href="#dt-extent">unparsed

+entities</a>, the format of elements which bear a notation attribute, or the

+application to which a <a title="Processing instruction" href="#dt-pi">processing

+instruction</a> is addressed.]</p> <p>[<a title="Notation Declaration" name="dt-notdecl">Definition</a>:

+ <b>Notation declarations</b> provide a name for the notation, for use in

+entity and attribute-list declarations and in attribute specifications, and

+an external identifier for the notation which may allow an XML processor or

+its client application to locate a helper application capable of processing

+data in the given notation.]</p> <h5>Notation Declarations</h5><table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td><a name="NT-NotationDecl"></a>[82]&nbsp;&nbsp;&nbsp;</td>

+<td><code>NotationDecl</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'&lt;!NOTATION' <a href="#NT-S">S</a> <a href="#NT-Name">Name</a> <a

+href="#NT-S">S</a> (<a href="#NT-ExternalID">ExternalID</a> | <a href="#NT-PublicID">PublicID</a>) <a

+href="#NT-S">S</a>? '>'</code></td>

+<td><a href="#UniqueNotationName">[VC: Unique Notation Name]</a></td>

+</tr>

+</tbody><tbody>

+<tr valign="baseline">

+<td><a name="NT-PublicID"></a>[83]&nbsp;&nbsp;&nbsp;</td>

+<td><code>PublicID</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>'PUBLIC' <a href="#NT-S">S</a> <a href="#NT-PubidLiteral">PubidLiteral</a> </code></td>

+</tr>

+</tbody></table> <div class="constraint"><p class="prefix"><a name="UniqueNotationName"></a><b>Validity

+constraint: Unique Notation Name</b></p><p>Only one notation declaration can

+declare a given <a href="#NT-Name">Name</a>.</p> </div> <p>XML processors

+must provide applications with the name and external identifier(s) of any

+notation declared and referred to in an attribute value, attribute definition,

+or entity declaration. They may additionally resolve the external identifier

+into the <a title="System Identifier" href="#dt-sysid">system identifier</a>,

+file name, or other information needed to allow the application to call a

+processor for data in the notation described. (It is not an error, however,

+for XML documents to declare and refer to notations for which notation-specific

+applications are not available on the system where the XML processor or application

+is running.)</p> </div> <div class="div2"> <h3><a name="sec-doc-entity"></a>4.8

+Document Entity</h3> <p>[<a title="Document Entity" name="dt-docent">Definition</a>:

+The <b>document entity</b> serves as the root of the entity tree and a starting-point

+for an <a title="XML Processor" href="#dt-xml-proc">XML processor</a>.] This

+specification does not specify how the document entity is to be located by

+an XML processor; unlike other entities, the document entity has no name and

+might well appear on a processor input stream without any identification at

+all.</p> </div> </div>  <div class="div1"> <h2><a name="sec-conformance"></a>5

+Conformance</h2> <div class="div2"> <h3><a name="proc-types"></a>5.1 Validating

+and Non-Validating Processors</h3> <p>Conforming <a title="XML Processor"

+href="#dt-xml-proc">XML processors</a> fall into two classes: validating and

+non-validating.</p> <p>Validating and non-validating processors alike must

+report violations of this specification's well-formedness constraints in the

+content of the <a title="Document Entity" href="#dt-docent">document entity</a>

+and any other <a title="Text Entity" href="#dt-parsedent">parsed entities</a>

+that they read.</p> <p>[<a title="Validating Processor" name="dt-validating">Definition</a>: <b>Validating

+processors</b> must, at user option, report violations of the constraints

+expressed by the declarations in the <a title="Document Type Declaration"

+href="#dt-doctype">DTD</a>, and failures to fulfill the validity constraints

+given in this specification.] To accomplish this, validating XML processors

+must read and process the entire DTD and all external parsed entities referenced

+in the document.</p> <p>Non-validating processors are required to check only

+the <a title="Document Entity" href="#dt-docent">document entity</a>, including

+the entire internal DTD subset, for well-formedness. [<a title="Process Declarations"

+name="dt-use-mdecl">Definition</a>:  While they are not required to check

+the document for validity, they are required to <b>process</b> all the declarations

+they read in the internal DTD subset and in any parameter entity that they

+read, up to the first reference to a parameter entity that they do <em>not</em>

+read; that is to say, they must use the information in those declarations

+to <a href="#AVNormalize"><cite>normalize</cite></a> attribute values, <a

+href="#included"><cite>include</cite></a> the replacement text of internal

+entities, and supply <a href="#sec-attr-defaults"><cite>default attribute

+values</cite></a>.] Except when <code>standalone="yes"</code>, they must not <a

+title="Process Declarations" href="#dt-use-mdecl">process</a> <a title="entity declaration"

+href="#dt-entdecl">entity declarations</a> or <a title="Attribute-List Declaration"

+href="#dt-attdecl">attribute-list declarations</a> encountered after a reference

+to a parameter entity that is not read, since the entity may have contained

+overriding declarations.</p> </div> <div class="div2"> <h3><a name="safe-behavior"></a>5.2

+Using XML Processors</h3> <p>The behavior of a validating XML processor is

+highly predictable; it must read every piece of a document and report all

+well-formedness and validity violations. Less is required of a non-validating

+processor; it need not read any part of the document other than the document

+entity. This has two effects that may be important to users of XML processors:</p> <ul>

+<li><p>Certain well-formedness errors, specifically those that require reading

+external entities, may not be detected by a non-validating processor. Examples

+include the constraints entitled <a href="#wf-entdeclared"><cite>Entity Declared</cite></a>, <a

+href="#textent"><cite>Parsed Entity</cite></a>, and <a href="#norecursion"><cite>No

+Recursion</cite></a>, as well as some of the cases described as <a href="#forbidden"><cite>forbidden</cite></a>

+in <a href="#entproc"><b>4.4 XML Processor Treatment of Entities and References</b></a>.</p></li>

+<li><p>The information passed from the processor to the application may vary,

+depending on whether the processor reads parameter and external entities.

+For example, a non-validating processor may not <a href="#AVNormalize"><cite>normalize</cite></a>

+attribute values, <a href="#included"><cite>include</cite></a> the replacement

+text of internal entities, or supply <a href="#sec-attr-defaults"><cite>default

+attribute values</cite></a>, where doing so depends on having read declarations

+in external or parameter entities.</p></li>

+</ul> <p>For maximum reliability in interoperating between different XML processors,

+applications which use non-validating processors should not rely on any behaviors

+not required of such processors. Applications which require facilities such

+as the use of default attributes or internal entities which are declared in

+external entities should use validating XML processors.</p> </div> </div> <div

+class="div1"> <h2><a name="sec-notation"></a>6 Notation</h2> <p>The formal

+grammar of XML is given in this specification using a simple Extended Backus-Naur

+Form (EBNF) notation. Each rule in the grammar defines one symbol, in the

+form</p> <table class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>symbol ::= expression</pre></td>

+</tr>

+</table> <p>Symbols are written with an initial capital letter if they are

+the start symbol of a regular language, otherwise with an initial lower case

+letter. Literal strings are quoted.</p> <p>Within the expression on the right-hand

+side of a rule, the following expressions are used to match strings of one

+or more characters: </p><dl>

+<dt class="label"><code>#xN</code></dt>

+<dd> <p>where <code>N</code> is a hexadecimal integer, the expression matches

+the character in ISO/IEC 10646 whose canonical (UCS-4) code value, when interpreted

+as an unsigned binary number, has the value indicated. The number of leading

+zeros in the <code>#xN</code> form is insignificant; the number of leading

+zeros in the corresponding code value is governed by the character encoding

+in use and is not significant for XML.</p> </dd>

+<dt class="label"><code>[a-zA-Z]</code>, <code>[#xN-#xN]</code></dt>

+<dd> <p>matches any <a href="#NT-Char">Char</a> with a value in the range(s)

+indicated (inclusive).</p> </dd>

+<dt class="label"><code>[abc]</code>, <code>[#xN#xN#xN]</code></dt>

+<dd> <p>matches any <a href="#NT-Char">Char</a> with a value among the characters

+enumerated. Enumerations and ranges can be mixed in one set of brackets.</p> </dd>

+<dt class="label"><code>[^a-z]</code>, <code>[^#xN-#xN]</code></dt>

+<dd> <p>matches any <a href="#NT-Char">Char</a> with a value <em>outside</em>

+the range indicated.</p> </dd>

+<dt class="label"><code>[^abc]</code>, <code>[^#xN#xN#xN]</code></dt>

+<dd> <p>matches any <a href="#NT-Char">Char</a> with a value not among the

+characters given. Enumerations and ranges of forbidden values can be mixed

+in one set of brackets.</p> </dd>

+<dt class="label"><code>"string"</code></dt>

+<dd> <p>matches a literal string <a title="match" href="#dt-match">matching</a>

+that given inside the double quotes.</p> </dd>

+<dt class="label"><code>'string'</code></dt>

+<dd> <p>matches a literal string <a title="match" href="#dt-match">matching</a>

+that given inside the single quotes.</p> </dd>

+</dl><p> These symbols may be combined to match more complex patterns as follows,

+where <code>A</code> and <code>B</code> represent simple expressions: </p><dl>

+<dt class="label">(<code>expression</code>)</dt>

+<dd> <p><code>expression</code> is treated as a unit and may be combined as

+described in this list.</p> </dd>

+<dt class="label"><code>A?</code></dt>

+<dd> <p>matches <code>A</code> or nothing; optional <code>A</code>.</p> </dd>

+<dt class="label"><code>A B</code></dt>

+<dd> <p>matches <code>A</code> followed by <code>B</code>. This operator has

+higher precedence than alternation; thus <code>A B | C D</code> is identical

+to <code>(A B) | (C D)</code>.</p> </dd>

+<dt class="label"><code>A | B</code></dt>

+<dd> <p>matches <code>A</code> or <code>B</code> but not both.</p> </dd>

+<dt class="label"><code>A - B</code></dt>

+<dd> <p>matches any string that matches <code>A</code> but does not match <code>B</code>.</p> </dd>

+<dt class="label"><code>A+</code></dt>

+<dd> <p>matches one or more occurrences of <code>A</code>.Concatenation has

+higher precedence than alternation; thus <code>A+ | B+</code> is identical

+to <code>(A+) | (B+)</code>.</p> </dd>

+<dt class="label"><code>A*</code></dt>

+<dd> <p>matches zero or more occurrences of <code>A</code>. Concatenation

+has higher precedence than alternation; thus <code>A* | B*</code> is identical

+to <code>(A*) | (B*)</code>.</p> </dd>

+</dl><p> Other notations used in the productions are: </p><dl>

+<dt class="label"><code>/* ... */</code></dt>

+<dd> <p>comment.</p> </dd>

+<dt class="label"><code>[ wfc: ... ]</code></dt>

+<dd> <p>well-formedness constraint; this identifies by name a constraint on <a

+title="Well-Formed" href="#dt-wellformed">well-formed</a> documents associated

+with a production.</p> </dd>

+<dt class="label"><code>[ vc: ... ]</code></dt>

+<dd> <p>validity constraint; this identifies by name a constraint on <a title="Validity"

+href="#dt-valid">valid</a> documents associated with a production.</p> </dd>

+</dl><p></p> </div> </div><div class="back">   <div class="div1"> <h2><a name="sec-bibliography"></a>A

+References</h2> <div class="div2"> <h3><a name="sec-existing-stds"></a>A.1

+Normative References</h3> <dl>

+<dt class="label"><a name="IANA"></a>IANA-CHARSETS</dt>

+<dd>(Internet Assigned Numbers Authority) <cite>Official Names for Character

+Sets</cite>, ed. Keld Simonsen et al. See <a href="ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets">ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets</a

+>. </dd>

+<dt class="label"><a name="RFC1766"></a>IETF RFC 1766</dt>

+<dd>IETF (Internet Engineering Task Force). <cite>RFC 1766: Tags for the Identification

+of Languages</cite>, ed. H. Alvestrand. 1995.  (See <a href="http://www.ietf.org/rfc/rfc1766.txt">http://www.ietf.org/rfc/rfc1766.txt</a>.)</dd>

+<dt class="label"><a name="ISO10646"></a>ISO/IEC 10646</dt>

+<dd>ISO (International Organization for Standardization). <cite>ISO/IEC 10646-1993

+(E). Information technology -- Universal Multiple-Octet Coded Character Set

+(UCS) -- Part 1: Architecture and Basic Multilingual Plane.</cite> [Geneva]:

+International Organization for Standardization, 1993 (plus amendments AM 1

+through AM 7).</dd>

+<dt class="label"><a name="ISO10646-2000"></a>ISO/IEC 10646-2000</dt>

+<dd> ISO (International Organization for Standardization). <cite>ISO/IEC 10646-1:2000.

+Information technology -- Universal Multiple-Octet Coded Character Set (UCS)

+-- Part 1: Architecture and Basic Multilingual Plane.</cite> [Geneva]: International

+Organization for Standardization, 2000.</dd>

+<dt class="label"><a name="Unicode"></a>Unicode</dt>

+<dd>The Unicode Consortium. <em>The Unicode Standard, Version 2.0.</em> Reading,

+Mass.: Addison-Wesley Developers Press, 1996.</dd>

+<dt class="label"><a name="Unicode3"></a>Unicode3</dt>

+<dd> The Unicode Consortium. <em>The Unicode Standard, Version 3.0.</em> Reading,

+Mass.: Addison-Wesley Developers Press, 2000. ISBN 0-201-61633-5.</dd>

+</dl></div> <div class="div2">  <h3><a name="null"></a>A.2 Other References</h3> <dl>

+<dt class="label"><a name="Aho"></a>Aho/Ullman</dt>

+<dd>Aho, Alfred V., Ravi Sethi, and Jeffrey D. Ullman. <cite>Compilers: Principles,

+Techniques, and Tools</cite>. Reading: Addison-Wesley, 1986, rpt. corr. 1988.</dd>

+<dt class="label"><a name="Berners-Lee"></a>Berners-Lee et al.</dt>

+<dd> Berners-Lee, T., R. Fielding, and L. Masinter. <cite>Uniform Resource

+Identifiers (URI): Generic Syntax and Semantics</cite>. 1997. (Work in progress;

+see updates to RFC1738.)</dd>

+<dt class="label"><a name="ABK"></a>Br&uuml;ggemann-Klein</dt>

+<dd>Br&uuml;ggemann-Klein, Anne. Formal Models in Document Processing. Habilitationsschrift.

+Faculty of Mathematics at the University of Freiburg, 1993. (See <a href="ftp://ftp.informatik.uni-freiburg.de/documents/papers/brueggem/habil.ps"

+>ftp://ftp.informatik.uni-freiburg.de/documents/papers/brueggem/habil.ps</a>.)</dd>

+<dt class="label"><a name="ABKDW"></a>Br&uuml;ggemann-Klein and Wood</dt>

+<dd>Br&uuml;ggemann-Klein, Anne, and Derick Wood. <cite>Deterministic Regular

+Languages</cite>. Universit&auml;t Freiburg, Institut f&uuml;r Informatik,

+Bericht 38, Oktober 1991. Extended abstract in A. Finkel, M. Jantzen, Hrsg.,

+STACS 1992, S. 173-184. Springer-Verlag, Berlin 1992. Lecture Notes in Computer

+Science 577. Full version titled <cite>One-Unambiguous Regular Languages</cite>

+in Information and Computation 140 (2): 229-253, February 1998.</dd>

+<dt class="label"><a name="Clark"></a>Clark</dt>

+<dd>James Clark. Comparison of SGML and XML. See <a href="http://www.w3.org/TR/NOTE-sgml-xml-971215">http://www.w3.org/TR/NOTE-sgml-xml-971215</a

+>. </dd>

+<dt class="label"><a name="IANA-LANGCODES"></a>IANA-LANGCODES</dt>

+<dd>(Internet Assigned Numbers Authority) <cite>Registry of Language Tags</cite>,

+ed. Keld Simonsen et al.  (See <a href="http://www.isi.edu/in-notes/iana/assignments/languages/">http://www.isi.edu/in-notes/iana/assignments/languages/</a

+>.)</dd>

+<dt class="label"><a name="RFC2141"></a>IETF RFC2141</dt>

+<dd>IETF (Internet Engineering Task Force). <em>RFC 2141: URN Syntax</em>,

+ed. R. Moats. 1997.   (See <a href="http://www.ietf.org/rfc/rfc2141.txt">http://www.ietf.org/rfc/rfc2141.txt</a>.)</dd>

+<dt class="label"><a name="rfc2279"></a>IETF RFC 2279</dt>

+<dd>IETF (Internet Engineering Task Force). <cite>RFC 2279: UTF-8, a transformation

+format of ISO 10646</cite>, ed. F. Yergeau, 1998.  (See <a href="http://www.ietf.org/rfc/rfc2279.txt">http://www.ietf.org/rfc/rfc2279.txt</a>.)</dd>

+<dt class="label"><a name="rfc2376"></a>IETF RFC 2376</dt>

+<dd>IETF (Internet Engineering Task Force). <cite>RFC 2376: XML Media Types</cite>.

+ed. E. Whitehead, M. Murata. 1998.  (See <a href="http://www.ietf.org/rfc/rfc2376.txt">http://www.ietf.org/rfc/rfc2376.txt</a>.)</dd>

+<dt class="label"><a name="rfc2396"></a>IETF RFC 2396</dt>

+<dd>IETF (Internet Engineering Task Force). <cite>RFC 2396: Uniform Resource

+Identifiers (URI): Generic Syntax</cite>. T. Berners-Lee, R. Fielding, L.

+Masinter. 1998.  (See <a href="http://www.ietf.org/rfc/rfc2396.txt">http://www.ietf.org/rfc/rfc2396.txt</a>.)</dd>

+<dt class="label"><a name="rfc2732"></a>IETF RFC 2732</dt>

+<dd>IETF (Internet Engineering Task Force). <cite>RFC 2732: Format for Literal

+IPv6 Addresses in URL's</cite>. R. Hinden, B. Carpenter, L. Masinter. 1999.

+ (See <a href="http://www.ietf.org/rfc/rfc2732.txt">http://www.ietf.org/rfc/rfc2732.txt</a>.)</dd>

+<dt class="label"><a name="rfc2781"></a>IETF RFC 2781</dt>

+<dd> IETF (Internet Engineering Task Force). <em>RFC 2781: UTF-16, an encoding

+of ISO 10646</em>, ed. P. Hoffman, F. Yergeau. 2000.  (See <a href="http://www.ietf.org/rfc/rfc2781.txt">http://www.ietf.org/rfc/rfc2781.txt</a>.)</dd>

+<dt class="label"><a name="ISO639"></a>ISO 639</dt>

+<dd> (International Organization for Standardization). <cite>ISO 639:1988

+(E). Code for the representation of names of languages.</cite> [Geneva]: International

+Organization for Standardization, 1988.</dd>

+<dt class="label"><a name="ISO3166"></a>ISO 3166</dt>

+<dd> (International Organization for Standardization). <cite>ISO 3166-1:1997

+(E). Codes for the representation of names of countries and their subdivisions

+-- Part 1: Country codes</cite> [Geneva]: International Organization for Standardization,

+1997.</dd>

+<dt class="label"><a name="ISO8879"></a>ISO 8879</dt>

+<dd>ISO (International Organization for Standardization). <cite>ISO 8879:1986(E).

+Information processing -- Text and Office Systems -- Standard Generalized

+Markup Language (SGML).</cite> First edition -- 1986-10-15. [Geneva]: International

+Organization for Standardization, 1986. </dd>

+<dt class="label"><a name="ISO10744"></a>ISO/IEC 10744</dt>

+<dd>ISO (International Organization for Standardization). <cite>ISO/IEC 10744-1992

+(E). Information technology -- Hypermedia/Time-based Structuring Language

+(HyTime). </cite> [Geneva]: International Organization for Standardization,

+1992. <em>Extended Facilities Annexe.</em> [Geneva]: International Organization

+for Standardization, 1996. </dd>

+<dt class="label"><a name="websgml"></a>WEBSGML</dt>

+<dd>ISO (International Organization for Standardization). <cite>ISO 8879:1986

+TC2. Information technology -- Document Description and Processing Languages. </cite>

+[Geneva]: International Organization for Standardization, 1998.  (See <a href="http://www.sgmlsource.com/8879rev/n0029.htm">http://www.sgmlsource.com/8879rev/n0029.htm</a

+>.)</dd>

+<dt class="label"><a name="xml-names"></a>XML Names</dt>

+<dd>Tim Bray, Dave Hollander, and Andrew Layman, editors. <cite>Namespaces

+in XML</cite>. Textuality, Hewlett-Packard, and Microsoft. World Wide Web

+Consortium, 1999.  (See <a href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</a>.)</dd>

+</dl></div> </div> <div class="div1"> <h2><a name="CharClasses"></a>B Character

+Classes</h2> <p>Following the characteristics defined in the Unicode standard,

+characters are classed as base characters (among others, these contain the

+alphabetic characters of the Latin alphabet), ideographic characters, and

+combining characters (among others, this class contains most diacritics) Digits

+and extenders are also distinguished.</p> <h5>Characters</h5><table class="scrap">

+<tbody>

+<tr valign="baseline">

+<td><a name="NT-Letter"></a>[84]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Letter</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code><a href="#NT-BaseChar">BaseChar</a> | <a href="#NT-Ideographic">Ideographic</a></code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-BaseChar"></a>[85]&nbsp;&nbsp;&nbsp;</td>

+<td><code>BaseChar</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>[#x0041-#x005A] |&nbsp;[#x0061-#x007A] |&nbsp;[#x00C0-#x00D6] |&nbsp;[#x00D8-#x00F6]

+|&nbsp;[#x00F8-#x00FF] |&nbsp;[#x0100-#x0131] |&nbsp;[#x0134-#x013E] |&nbsp;[#x0141-#x0148]

+|&nbsp;[#x014A-#x017E] |&nbsp;[#x0180-#x01C3] |&nbsp;[#x01CD-#x01F0] |&nbsp;[#x01F4-#x01F5]

+|&nbsp;[#x01FA-#x0217] |&nbsp;[#x0250-#x02A8] |&nbsp;[#x02BB-#x02C1] |&nbsp;#x0386

+|&nbsp;[#x0388-#x038A] |&nbsp;#x038C |&nbsp;[#x038E-#x03A1] |&nbsp;[#x03A3-#x03CE]

+|&nbsp;[#x03D0-#x03D6] |&nbsp;#x03DA |&nbsp;#x03DC |&nbsp;#x03DE |&nbsp;#x03E0

+|&nbsp;[#x03E2-#x03F3] |&nbsp;[#x0401-#x040C] |&nbsp;[#x040E-#x044F] |&nbsp;[#x0451-#x045C]

+|&nbsp;[#x045E-#x0481] |&nbsp;[#x0490-#x04C4] |&nbsp;[#x04C7-#x04C8] |&nbsp;[#x04CB-#x04CC]

+|&nbsp;[#x04D0-#x04EB] |&nbsp;[#x04EE-#x04F5] |&nbsp;[#x04F8-#x04F9] |&nbsp;[#x0531-#x0556]

+|&nbsp;#x0559 |&nbsp;[#x0561-#x0586] |&nbsp;[#x05D0-#x05EA] |&nbsp;[#x05F0-#x05F2]

+|&nbsp;[#x0621-#x063A] |&nbsp;[#x0641-#x064A] |&nbsp;[#x0671-#x06B7] |&nbsp;[#x06BA-#x06BE]

+|&nbsp;[#x06C0-#x06CE] |&nbsp;[#x06D0-#x06D3] |&nbsp;#x06D5 |&nbsp;[#x06E5-#x06E6]

+|&nbsp;[#x0905-#x0939] |&nbsp;#x093D |&nbsp;[#x0958-#x0961] |&nbsp;[#x0985-#x098C]

+|&nbsp;[#x098F-#x0990] |&nbsp;[#x0993-#x09A8] |&nbsp;[#x09AA-#x09B0] |&nbsp;#x09B2

+|&nbsp;[#x09B6-#x09B9] |&nbsp;[#x09DC-#x09DD] |&nbsp;[#x09DF-#x09E1] |&nbsp;[#x09F0-#x09F1]

+|&nbsp;[#x0A05-#x0A0A] |&nbsp;[#x0A0F-#x0A10] |&nbsp;[#x0A13-#x0A28] |&nbsp;[#x0A2A-#x0A30]

+|&nbsp;[#x0A32-#x0A33] |&nbsp;[#x0A35-#x0A36] |&nbsp;[#x0A38-#x0A39] |&nbsp;[#x0A59-#x0A5C]

+|&nbsp;#x0A5E |&nbsp;[#x0A72-#x0A74] |&nbsp;[#x0A85-#x0A8B] |&nbsp;#x0A8D

+|&nbsp;[#x0A8F-#x0A91] |&nbsp;[#x0A93-#x0AA8] |&nbsp;[#x0AAA-#x0AB0] |&nbsp;[#x0AB2-#x0AB3]

+|&nbsp;[#x0AB5-#x0AB9] |&nbsp;#x0ABD |&nbsp;#x0AE0 |&nbsp;[#x0B05-#x0B0C]

+|&nbsp;[#x0B0F-#x0B10] |&nbsp;[#x0B13-#x0B28] |&nbsp;[#x0B2A-#x0B30] |&nbsp;[#x0B32-#x0B33]

+|&nbsp;[#x0B36-#x0B39] |&nbsp;#x0B3D |&nbsp;[#x0B5C-#x0B5D] |&nbsp;[#x0B5F-#x0B61]

+|&nbsp;[#x0B85-#x0B8A] |&nbsp;[#x0B8E-#x0B90] |&nbsp;[#x0B92-#x0B95] |&nbsp;[#x0B99-#x0B9A]

+|&nbsp;#x0B9C |&nbsp;[#x0B9E-#x0B9F] |&nbsp;[#x0BA3-#x0BA4] |&nbsp;[#x0BA8-#x0BAA]

+|&nbsp;[#x0BAE-#x0BB5] |&nbsp;[#x0BB7-#x0BB9] |&nbsp;[#x0C05-#x0C0C] |&nbsp;[#x0C0E-#x0C10]

+|&nbsp;[#x0C12-#x0C28] |&nbsp;[#x0C2A-#x0C33] |&nbsp;[#x0C35-#x0C39] |&nbsp;[#x0C60-#x0C61]

+|&nbsp;[#x0C85-#x0C8C] |&nbsp;[#x0C8E-#x0C90] |&nbsp;[#x0C92-#x0CA8] |&nbsp;[#x0CAA-#x0CB3]

+|&nbsp;[#x0CB5-#x0CB9] |&nbsp;#x0CDE |&nbsp;[#x0CE0-#x0CE1] |&nbsp;[#x0D05-#x0D0C]

+|&nbsp;[#x0D0E-#x0D10] |&nbsp;[#x0D12-#x0D28] |&nbsp;[#x0D2A-#x0D39] |&nbsp;[#x0D60-#x0D61]

+|&nbsp;[#x0E01-#x0E2E] |&nbsp;#x0E30 |&nbsp;[#x0E32-#x0E33] |&nbsp;[#x0E40-#x0E45]

+|&nbsp;[#x0E81-#x0E82] |&nbsp;#x0E84 |&nbsp;[#x0E87-#x0E88] |&nbsp;#x0E8A

+|&nbsp;#x0E8D |&nbsp;[#x0E94-#x0E97] |&nbsp;[#x0E99-#x0E9F] |&nbsp;[#x0EA1-#x0EA3]

+|&nbsp;#x0EA5 |&nbsp;#x0EA7 |&nbsp;[#x0EAA-#x0EAB] |&nbsp;[#x0EAD-#x0EAE]

+|&nbsp;#x0EB0 |&nbsp;[#x0EB2-#x0EB3] |&nbsp;#x0EBD |&nbsp;[#x0EC0-#x0EC4]

+|&nbsp;[#x0F40-#x0F47] |&nbsp;[#x0F49-#x0F69] |&nbsp;[#x10A0-#x10C5] |&nbsp;[#x10D0-#x10F6]

+|&nbsp;#x1100 |&nbsp;[#x1102-#x1103] |&nbsp;[#x1105-#x1107] |&nbsp;#x1109

+|&nbsp;[#x110B-#x110C] |&nbsp;[#x110E-#x1112] |&nbsp;#x113C |&nbsp;#x113E

+|&nbsp;#x1140 |&nbsp;#x114C |&nbsp;#x114E |&nbsp;#x1150 |&nbsp;[#x1154-#x1155]

+|&nbsp;#x1159 |&nbsp;[#x115F-#x1161] |&nbsp;#x1163 |&nbsp;#x1165 |&nbsp;#x1167

+|&nbsp;#x1169 |&nbsp;[#x116D-#x116E] |&nbsp;[#x1172-#x1173] |&nbsp;#x1175

+|&nbsp;#x119E |&nbsp;#x11A8 |&nbsp;#x11AB |&nbsp;[#x11AE-#x11AF] |&nbsp;[#x11B7-#x11B8]

+|&nbsp;#x11BA |&nbsp;[#x11BC-#x11C2] |&nbsp;#x11EB |&nbsp;#x11F0 |&nbsp;#x11F9

+|&nbsp;[#x1E00-#x1E9B] |&nbsp;[#x1EA0-#x1EF9] |&nbsp;[#x1F00-#x1F15] |&nbsp;[#x1F18-#x1F1D]

+|&nbsp;[#x1F20-#x1F45] |&nbsp;[#x1F48-#x1F4D] |&nbsp;[#x1F50-#x1F57] |&nbsp;#x1F59

+|&nbsp;#x1F5B |&nbsp;#x1F5D |&nbsp;[#x1F5F-#x1F7D] |&nbsp;[#x1F80-#x1FB4]

+|&nbsp;[#x1FB6-#x1FBC] |&nbsp;#x1FBE |&nbsp;[#x1FC2-#x1FC4] |&nbsp;[#x1FC6-#x1FCC]

+|&nbsp;[#x1FD0-#x1FD3] |&nbsp;[#x1FD6-#x1FDB] |&nbsp;[#x1FE0-#x1FEC] |&nbsp;[#x1FF2-#x1FF4]

+|&nbsp;[#x1FF6-#x1FFC] |&nbsp;#x2126 |&nbsp;[#x212A-#x212B] |&nbsp;#x212E

+|&nbsp;[#x2180-#x2182] |&nbsp;[#x3041-#x3094] |&nbsp;[#x30A1-#x30FA] |&nbsp;[#x3105-#x312C]

+|&nbsp;[#xAC00-#xD7A3] </code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Ideographic"></a>[86]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Ideographic</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>[#x4E00-#x9FA5] |&nbsp;#x3007 |&nbsp;[#x3021-#x3029] </code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-CombiningChar"></a>[87]&nbsp;&nbsp;&nbsp;</td>

+<td><code>CombiningChar</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>[#x0300-#x0345] |&nbsp;[#x0360-#x0361] |&nbsp;[#x0483-#x0486] |&nbsp;[#x0591-#x05A1]

+|&nbsp;[#x05A3-#x05B9] |&nbsp;[#x05BB-#x05BD] |&nbsp;#x05BF |&nbsp;[#x05C1-#x05C2]

+|&nbsp;#x05C4 |&nbsp;[#x064B-#x0652] |&nbsp;#x0670 |&nbsp;[#x06D6-#x06DC]

+|&nbsp;[#x06DD-#x06DF] |&nbsp;[#x06E0-#x06E4] |&nbsp;[#x06E7-#x06E8] |&nbsp;[#x06EA-#x06ED]

+|&nbsp;[#x0901-#x0903] |&nbsp;#x093C |&nbsp;[#x093E-#x094C] |&nbsp;#x094D

+|&nbsp;[#x0951-#x0954] |&nbsp;[#x0962-#x0963] |&nbsp;[#x0981-#x0983] |&nbsp;#x09BC

+|&nbsp;#x09BE |&nbsp;#x09BF |&nbsp;[#x09C0-#x09C4] |&nbsp;[#x09C7-#x09C8]

+|&nbsp;[#x09CB-#x09CD] |&nbsp;#x09D7 |&nbsp;[#x09E2-#x09E3] |&nbsp;#x0A02

+|&nbsp;#x0A3C |&nbsp;#x0A3E |&nbsp;#x0A3F |&nbsp;[#x0A40-#x0A42] |&nbsp;[#x0A47-#x0A48]

+|&nbsp;[#x0A4B-#x0A4D] |&nbsp;[#x0A70-#x0A71] |&nbsp;[#x0A81-#x0A83] |&nbsp;#x0ABC

+|&nbsp;[#x0ABE-#x0AC5] |&nbsp;[#x0AC7-#x0AC9] |&nbsp;[#x0ACB-#x0ACD] |&nbsp;[#x0B01-#x0B03]

+|&nbsp;#x0B3C |&nbsp;[#x0B3E-#x0B43] |&nbsp;[#x0B47-#x0B48] |&nbsp;[#x0B4B-#x0B4D]

+|&nbsp;[#x0B56-#x0B57] |&nbsp;[#x0B82-#x0B83] |&nbsp;[#x0BBE-#x0BC2] |&nbsp;[#x0BC6-#x0BC8]

+|&nbsp;[#x0BCA-#x0BCD] |&nbsp;#x0BD7 |&nbsp;[#x0C01-#x0C03] |&nbsp;[#x0C3E-#x0C44]

+|&nbsp;[#x0C46-#x0C48] |&nbsp;[#x0C4A-#x0C4D] |&nbsp;[#x0C55-#x0C56] |&nbsp;[#x0C82-#x0C83]

+|&nbsp;[#x0CBE-#x0CC4] |&nbsp;[#x0CC6-#x0CC8] |&nbsp;[#x0CCA-#x0CCD] |&nbsp;[#x0CD5-#x0CD6]

+|&nbsp;[#x0D02-#x0D03] |&nbsp;[#x0D3E-#x0D43] |&nbsp;[#x0D46-#x0D48] |&nbsp;[#x0D4A-#x0D4D]

+|&nbsp;#x0D57 |&nbsp;#x0E31 |&nbsp;[#x0E34-#x0E3A] |&nbsp;[#x0E47-#x0E4E]

+|&nbsp;#x0EB1 |&nbsp;[#x0EB4-#x0EB9] |&nbsp;[#x0EBB-#x0EBC] |&nbsp;[#x0EC8-#x0ECD]

+|&nbsp;[#x0F18-#x0F19] |&nbsp;#x0F35 |&nbsp;#x0F37 |&nbsp;#x0F39 |&nbsp;#x0F3E

+|&nbsp;#x0F3F |&nbsp;[#x0F71-#x0F84] |&nbsp;[#x0F86-#x0F8B] |&nbsp;[#x0F90-#x0F95]

+|&nbsp;#x0F97 |&nbsp;[#x0F99-#x0FAD] |&nbsp;[#x0FB1-#x0FB7] |&nbsp;#x0FB9

+|&nbsp;[#x20D0-#x20DC] |&nbsp;#x20E1 |&nbsp;[#x302A-#x302F] |&nbsp;#x3099

+|&nbsp;#x309A </code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Digit"></a>[88]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Digit</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>[#x0030-#x0039] |&nbsp;[#x0660-#x0669] |&nbsp;[#x06F0-#x06F9] |&nbsp;[#x0966-#x096F]

+|&nbsp;[#x09E6-#x09EF] |&nbsp;[#x0A66-#x0A6F] |&nbsp;[#x0AE6-#x0AEF] |&nbsp;[#x0B66-#x0B6F]

+|&nbsp;[#x0BE7-#x0BEF] |&nbsp;[#x0C66-#x0C6F] |&nbsp;[#x0CE6-#x0CEF] |&nbsp;[#x0D66-#x0D6F]

+|&nbsp;[#x0E50-#x0E59] |&nbsp;[#x0ED0-#x0ED9] |&nbsp;[#x0F20-#x0F29] </code></td>

+</tr>

+<tr valign="baseline">

+<td><a name="NT-Extender"></a>[89]&nbsp;&nbsp;&nbsp;</td>

+<td><code>Extender</code></td>

+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>

+<td><code>#x00B7 |&nbsp;#x02D0 |&nbsp;#x02D1 |&nbsp;#x0387 |&nbsp;#x0640 |&nbsp;#x0E46

+|&nbsp;#x0EC6 |&nbsp;#x3005 |&nbsp;[#x3031-#x3035] |&nbsp;[#x309D-#x309E]

+|&nbsp;[#x30FC-#x30FE] </code></td>

+</tr>

+</tbody></table> <p>The character classes defined here can be derived from

+the Unicode 2.0 character database as follows:</p> <ul>

+<li><p>Name start characters must have one of the categories Ll, Lu, Lo, Lt,

+Nl.</p></li>

+<li><p>Name characters other than Name-start characters must have one of the

+categories Mc, Me, Mn, Lm, or Nd.</p></li>

+<li><p>Characters in the compatibility area (i.e. with character code greater

+than #xF900 and less than #xFFFE) are not allowed in XML names.</p></li>

+<li><p>Characters which have a font or compatibility decomposition (i.e. those

+with a "compatibility formatting tag" in field 5 of the database -- marked

+by field 5 beginning with a "&lt;") are not allowed.</p></li>

+<li><p>The following characters are treated as name-start characters rather

+than name characters, because the property file classifies them as Alphabetic:

+[#x02BB-#x02C1], #x0559, #x06E5, #x06E6.</p></li>

+<li><p>Characters #x20DD-#x20E0 are excluded (in accordance with Unicode 2.0,

+section 5.14).</p></li>

+<li><p>Character #x00B7 is classified as an extender, because the property

+list so identifies it.</p></li>

+<li><p>Character #x0387 is added as a name character, because #x00B7 is its

+canonical equivalent.</p></li>

+<li><p>Characters ':' and '_' are allowed as name-start characters.</p> </li>

+<li><p>Characters '-' and '.' are allowed as name characters.</p></li>

+</ul> </div> <div class="div1"> <h2><a name="sec-xml-and-sgml"></a>C XML and

+SGML (Non-Normative)</h2> <p>XML is designed to be a subset of SGML, in that

+every XML document should also be a conforming SGML document. For a detailed

+comparison of the additional restrictions that XML places on documents beyond

+those of SGML, see <a href="#Clark">[Clark]</a>.</p> </div> <div class="div1"> <h2><a

+name="sec-entexpand"></a>D Expansion of Entity and Character References (Non-Normative)</h2> <p>This

+appendix contains some examples illustrating the sequence of entity- and character-reference

+recognition and expansion, as specified in <a href="#entproc"><b>4.4 XML Processor

+Treatment of Entities and References</b></a>.</p> <p>If the DTD contains the

+declaration</p> <table class="eg" width="100%" border="1" cellpadding="5"

+bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;!ENTITY example "&lt;p>An ampersand (&amp;#38;#38;) may be escaped

+numerically (&amp;#38;#38;#38;) or with a general entity

+(&amp;amp;amp;).&lt;/p>" ></pre></td>

+</tr>

+</table> <p>then the XML processor will recognize the character references

+when it parses the entity declaration, and resolve them before storing the

+following string as the value of the entity "<code>example</code>":</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>&lt;p>An ampersand (&amp;#38;) may be escaped

+numerically (&amp;#38;#38;) or with a general entity

+(&amp;amp;amp;).&lt;/p></pre></td>

+</tr>

+</table> <p>A reference in the document to "<code>&amp;example;</code>" will

+cause the text to be reparsed, at which time the start- and end-tags of the <code>p</code>

+element will be recognized and the three references will be recognized and

+expanded, resulting in a <code>p</code> element with the following content

+(all data, no delimiters or markup):</p> <table class="eg" width="100%" border="1"

+cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>An ampersand (&amp;) may be escaped

+numerically (&amp;#38;) or with a general entity

+(&amp;amp;).</pre></td>

+</tr>

+</table> <p>A more complex example will illustrate the rules and their effects

+fully. In the following example, the line numbers are solely for reference.</p> <table

+class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">

+<tr>

+<td><pre>1 &lt;?xml version='1.0'?>

+2 &lt;!DOCTYPE test [

+3 &lt;!ELEMENT test (#PCDATA) >

+4 &lt;!ENTITY % xx '&amp;#37;zz;'>

+5 &lt;!ENTITY % zz '&amp;#60;!ENTITY tricky "error-prone" >' >

+6 %xx;

+7 ]>

+8 &lt;test>This sample shows a &amp;tricky; method.&lt;/test></pre></td>

+</tr>

+</table> <p>This produces the following:</p> <ul>

+<li><p>in line 4, the reference to character 37 is expanded immediately, and

+the parameter entity "<code>xx</code>" is stored in the symbol table with

+the value "<code>%zz;</code>". Since the replacement text is not rescanned,

+the reference to parameter entity "<code>zz</code>" is not recognized. (And

+it would be an error if it were, since "<code>zz</code>" is not yet declared.)</p></li>

+<li><p>in line 5, the character reference "<code>&amp;#60;</code>" is expanded

+immediately and the parameter entity "<code>zz</code>" is stored with the

+replacement text "<code>&lt;!ENTITY tricky "error-prone" ></code>", which

+is a well-formed entity declaration.</p></li>

+<li><p>in line 6, the reference to "<code>xx</code>" is recognized, and the

+replacement text of "<code>xx</code>" (namely "<code>%zz;</code>") is parsed.

+The reference to "<code>zz</code>" is recognized in its turn, and its replacement

+text ("<code>&lt;!ENTITY tricky "error-prone" ></code>") is parsed. The general

+entity "<code>tricky</code>" has now been declared, with the replacement text

+"<code>error-prone</code>".</p> </li>

+<li><p>in line 8, the reference to the general entity "<code>tricky</code>"

+is recognized, and it is expanded, so the full content of the <code>test</code>

+element is the self-describing (and ungrammatical) string <em>This sample

+shows a error-prone method.</em></p></li>

+</ul> </div> <div class="div1"> <h2><a name="determinism"></a>E Deterministic

+Content Models (Non-Normative)</h2> <p>As noted in <a href="#sec-element-content"><b>3.2.1

+Element Content</b></a>, it is required that content models in element type

+declarations be deterministic. This requirement is <a title="For Compatibility"

+href="#dt-compat">for compatibility</a> with SGML (which calls deterministic

+content models "unambiguous"); XML processors built using SGML systems may

+flag non-deterministic content models as errors.</p> <p>For example, the content

+model <code>((b, c) | (b, d))</code> is non-deterministic, because given an

+initial <code>b</code> the XML processor cannot know which <code>b</code>

+in the model is being matched without looking ahead to see which element follows

+the <code>b</code>. In this case, the two references to <code>b</code> can

+be collapsed into a single reference, making the model read <code>(b, (c |

+d))</code>. An initial <code>b</code> now clearly matches only a single name

+in the content model. The processor doesn't need to look ahead to see what

+follows; either <code>c</code> or <code>d</code> would be accepted.</p> <p>More

+formally: a finite state automaton may be constructed from the content model

+using the standard algorithms, e.g. algorithm 3.5 in section 3.9 of Aho, Sethi,

+and Ullman <a href="#Aho">[Aho/Ullman]</a>. In many such algorithms, a follow

+set is constructed for each position in the regular expression (i.e., each

+leaf node in the syntax tree for the regular expression); if any position

+has a follow set in which more than one following position is labeled with

+the same element type name, then the content model is in error and may be

+reported as an error.</p> <p>Algorithms exist which allow many but not all

+non-deterministic content models to be reduced automatically to equivalent

+deterministic models; see Br&uuml;ggemann-Klein 1991 <a href="#ABK">[Br&uuml;ggemann-Klein]</a>.</p> </div> <div

+class="div1"> <h2><a name="sec-guessing"></a>F Autodetection of Character

+Encodings (Non-Normative)</h2> <p>The XML encoding declaration functions as

+an internal label on each entity, indicating which character encoding is in

+use. Before an XML processor can read the internal label, however, it apparently

+has to know what character encoding is in use--which is what the internal

+label is trying to indicate. In the general case, this is a hopeless situation.

+It is not entirely hopeless in XML, however, because XML limits the general

+case in two ways: each implementation is assumed to support only a finite

+set of character encodings, and the XML encoding declaration is restricted

+in position and content in order to make it feasible to autodetect the character

+encoding in use in each entity in normal cases. Also, in many cases other

+sources of information are available in addition to the XML data stream itself.

+Two cases may be distinguished, depending on whether the XML entity is presented

+to the processor without, or with, any accompanying (external) information.

+We consider the first case first.</p> <div class="div2"> <h3><a name="sec-guessing-no-ext-info"></a>F.1

+Detection Without External Encoding Information</h3> <p>Because each XML entity

+not accompanied by external encoding information and not in UTF-8 or UTF-16

+encoding <em>must</em> begin with an XML encoding declaration, in which the

+first characters must be '<code>&lt;?xml</code>', any conforming processor

+can detect, after two to four octets of input, which of the following cases

+apply. In reading this list, it may help to know that in UCS-4, '&lt;' is

+"<code>#x0000003C</code>" and '?' is "<code>#x0000003F</code>", and the Byte

+Order Mark required of UTF-16 data streams is "<code>#xFEFF</code>". The notation <var>##</var>

+is used to denote any byte value except that two consecutive <var>##</var>s

+cannot be both 00.</p> <p>With a Byte Order Mark:</p> <table border="1" frame="border">

+<tbody>

+<tr>

+<td rowspan="1" colspan="1"><code>00 00 FE FF</code></td>

+<td rowspan="1" colspan="1">UCS-4, big-endian machine (1234 order)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>FF FE 00 00</code></td>

+<td rowspan="1" colspan="1">UCS-4, little-endian machine (4321 order)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>00 00 FF FE</code></td>

+<td rowspan="1" colspan="1">UCS-4, unusual octet order (2143)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>FE FF 00 00</code></td>

+<td rowspan="1" colspan="1">UCS-4, unusual octet order (3412)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>FE FF ## ##</code></td>

+<td rowspan="1" colspan="1">UTF-16, big-endian</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>FF FE ## ##</code></td>

+<td rowspan="1" colspan="1">UTF-16, little-endian</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>EF BB BF</code></td>

+<td rowspan="1" colspan="1">UTF-8</td>

+</tr>

+</tbody></table> <p>Without a Byte Order Mark:</p> <table border="1" frame="border">

+<tbody>

+<tr>

+<td rowspan="1" colspan="1"><code>00&nbsp;00&nbsp;00&nbsp;3C</code></td>

+<td rowspan="4" colspan="1">UCS-4 or other encoding with a 32-bit code unit

+and ASCII characters encoded as ASCII values, in respectively big-endian (1234),

+little-endian (4321) and two unusual byte orders (2143 and 3412). The encoding

+declaration must be read to determine which of UCS-4 or other supported 32-bit

+encodings applies.</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>3C 00 00 00</code></td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>00 00 3C 00</code></td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>00 3C 00 00</code></td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>00 3C 00 3F</code></td>

+<td rowspan="1" colspan="1">UTF-16BE or big-endian ISO-10646-UCS-2 or other

+encoding with a 16-bit code unit in big-endian order and ASCII characters

+encoded as ASCII values (the encoding declaration must be read to determine

+which)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>3C 00 3F 00</code></td>

+<td rowspan="1" colspan="1">UTF-16LE or little-endian ISO-10646-UCS-2 or other

+encoding with a 16-bit code unit in little-endian order and ASCII characters

+encoded as ASCII values (the encoding declaration must be read to determine

+which)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>3C 3F 78 6D</code></td>

+<td rowspan="1" colspan="1">UTF-8, ISO 646, ASCII, some part of ISO 8859,

+Shift-JIS, EUC, or any other 7-bit, 8-bit, or mixed-width encoding which ensures

+that the characters of ASCII have their normal positions, width, and values;

+the actual encoding declaration must be read to detect which of these applies,

+but since all of these encodings use the same bit patterns for the relevant

+ASCII characters, the encoding declaration itself may be read reliably</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1"><code>4C 6F A7 94</code></td>

+<td rowspan="1" colspan="1">EBCDIC (in some flavor; the full encoding declaration

+must be read to tell which code page is in use)</td>

+</tr>

+<tr>

+<td rowspan="1" colspan="1">Other</td>

+<td rowspan="1" colspan="1">UTF-8 without an encoding declaration, or else

+the data stream is mislabeled (lacking a required encoding declaration), corrupt,

+fragmentary, or enclosed in a wrapper of some kind</td>

+</tr>

+</tbody></table> <div class="note"><p class="prefix"><b>Note:</b></p> <p>In

+cases above which do not require reading the encoding declaration to determine

+the encoding, section 4.3.3 still requires that the encoding declaration,

+if present, be read and that the encoding name be checked to match the actual

+encoding of the entity. Also, it is possible that new character encodings

+will be invented that will make it necessary to use the encoding declaration

+to determine the encoding, in cases where this is not required at present.</p> </div> <p>This

+level of autodetection is enough to read the XML encoding declaration and

+parse the character-encoding identifier, which is still necessary to distinguish

+the individual members of each family of encodings (e.g. to tell UTF-8 from

+8859, and the parts of 8859 from each other, or to distinguish the specific

+EBCDIC code page in use, and so on).</p> <p>Because the contents of the encoding

+declaration are restricted to characters from the ASCII repertoire (however

+encoded), a processor can reliably read the entire encoding declaration as

+soon as it has detected which family of encodings is in use. Since in practice,

+all widely used character encodings fall into one of the categories above,

+the XML encoding declaration allows reasonably reliable in-band labeling of

+character encodings, even when external sources of information at the operating-system

+or transport-protocol level are unreliable. Character encodings such as UTF-7

+that make overloaded usage of ASCII-valued bytes may fail to be reliably detected.</p> <p>Once

+the processor has detected the character encoding in use, it can act appropriately,

+whether by invoking a separate input routine for each case, or by calling

+the proper conversion function on each character of input.</p> <p>Like any

+self-labeling system, the XML encoding declaration will not work if any software

+changes the entity's character set or encoding without updating the encoding

+declaration. Implementors of character-encoding routines should be careful

+to ensure the accuracy of the internal and external information used to label

+the entity.</p> </div> <div class="div2"> <h3><a name="sec-guessing-with-ext-info"></a>F.2

+Priorities in the Presence of External Encoding Information</h3> <p>The second

+possible case occurs when the XML entity is accompanied by encoding information,

+as in some file systems and some network protocols. When multiple sources

+of information are available, their relative priority and the preferred method

+of handling conflict should be specified as part of the higher-level protocol

+used to deliver XML. In particular, please refer to <a href="#rfc2376">[IETF

+RFC 2376]</a> or its successor, which defines the <code>text/xml</code> and <code>application/xml</code>

+MIME types and provides some useful guidance. In the interests of interoperability,

+however, the following rule is recommended.</p> <ul>

+<li><p>If an XML entity is in a file, the Byte-Order Mark and encoding declaration

+are used (if present) to determine the character encoding.</p> </li>

+</ul>   </div> </div> <div class="div1"> <h2><a name="sec-xml-wg"></a>G W3C

+XML Working Group (Non-Normative)</h2> <p>This specification was prepared

+and approved for publication by the W3C XML Working Group (WG). WG approval

+of this specification does not necessarily imply that all WG members voted

+for its approval. The current and former members of the XML WG are:</p> <ul>

+<li>Jon Bosak, Sun (<i>Chair</i>)  </li>

+<li>James Clark (<i>Technical Lead</i>) </li>

+<li>Tim Bray, Textuality and Netscape  (<i>XML Co-editor</i>) </li>

+<li>Jean Paoli, Microsoft (<i>XML Co-editor</i>) </li>

+<li>C. M. Sperberg-McQueen, U. of Ill.  (<i>XML Co-editor</i>) </li>

+<li>Dan Connolly, W3C (<i>W3C Liaison</i>)  </li>

+<li>Paula Angerstein, Texcel</li>

+<li>Steve DeRose, INSO</li>

+<li>Dave Hollander, HP</li>

+<li>Eliot Kimber, ISOGEN</li>

+<li>Eve Maler, ArborText</li>

+<li>Tom Magliery, NCSA</li>

+<li>Murray Maloney, SoftQuad, Grif SA, Muzmo and Veo Systems</li>

+<li>MURATA Makoto (FAMILY Given), Fuji Xerox Information Systems</li>

+<li>Joel Nava, Adobe</li>

+<li>Conleth O'Connell, Vignette </li>

+<li>Peter Sharpe, SoftQuad</li>

+<li>John Tigue, DataChannel</li>

+</ul> </div> <div class="div1"> <h2><a name="sec-core-wg"></a>H W3C XML Core

+Group (Non-Normative)</h2> <p>The second edition of this specification was

+prepared by the W3C XML Core Working Group (WG). The members of the WG at

+the time of publication of this edition were:</p> <ul>

+<li>Paula Angerstein, Vignette</li>

+<li>Daniel Austin, Ask Jeeves</li>

+<li>Tim Boland</li>

+<li>Allen Brown, Microsoft</li>

+<li>Dan Connolly, W3C (<i>Staff Contact</i>) </li>

+<li>John Cowan, Reuters Limited </li>

+<li>John Evdemon, XMLSolutions Corporation </li>

+<li>Paul Grosso, Arbortext (<i>Co-Chair</i>)  </li>

+<li>Arnaud Le Hors, IBM (<i>Co-Chair</i>)  </li>

+<li>Eve Maler, Sun Microsystems  (<i>Second Edition Editor</i>) </li>

+<li>Jonathan Marsh, Microsoft</li>

+<li>MURATA Makoto (FAMILY Given), IBM </li>

+<li>Mark Needleman, Data Research Associates </li>

+<li>David Orchard, Jamcracker</li>

+<li>Lew Shannon, NCR</li>

+<li>Richard Tobin, University of Edinburgh </li>

+<li>Daniel Veillard, W3C</li>

+<li>Dan Vint, Lexica</li>

+<li>Norman Walsh, Sun Microsystems </li>

+<li>Fran&ccedil;ois Yergeau, Alis Technologies  (<i>Errata List Editor</i>) </li>

+<li>Kongyi Zhou, Oracle</li>

+</ul> </div> <div class="div1"> <h2><a name="b4d250b6c21"></a>I Production

+Notes (Non-Normative)</h2> <p>This Second Edition was encoded in the <a href="http://www.w3.org/XML/1998/06/xmlspec-v21.dtd">XMLspec

+DTD</a> (which has <a href="http://www.w3.org/XML/1998/06/xmlspec-report-v21.htm">documentation</a>

+available). The HTML versions were produced with a combination of the <a href="http://www.w3.org/XML/1998/06/xmlspec.xsl">xmlspec.xsl</a>, <a

+href="http://www.w3.org/XML/1998/06/diffspec.xsl">diffspec.xsl</a>, and <a

+href="http://www.w3.org/XML/1998/06/REC-xml-2e.xsl">REC-xml-2e.xsl</a> XSLT

+stylesheets.  The PDF version was produced with the <a href="http://www.tdb.uu.se/~jan/html2ps.html">html2ps</a>

+facility and a distiller program.</p> </div> </div></body>

+</html>

diff --git a/samples/data/org/w3c/www/TR/xml-stylesheet.html b/samples/data/org/w3c/www/TR/xml-stylesheet.html
new file mode 100644
index 0000000..de8e119
--- /dev/null
+++ b/samples/data/org/w3c/www/TR/xml-stylesheet.html
@@ -0,0 +1,341 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>Associating Style Sheets with XML documents</title>
+<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-REC">
+<style type="text/css">code { font-family: monospace }</style>
+</head>
+<body>
+<div class="head">
+<a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/WWW/w3c_home" alt="W3C" height="48" width="72"></a>
+<h1>Associating Style Sheets with XML documents<br>Version 1.0</h1>
+<h2>W3C Recommendation 29 June 1999</h2>
+<dl>
+<dt>This version:</dt>
+<dd>
+<a href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629">http://www.w3.org/1999/06/REC-xml-stylesheet-19990629</a>
+<br>
+</dd>
+<dt>Latest version:</dt>
+<dd>
+<a href="http://www.w3.org/TR/xml-stylesheet">http://www.w3.org/TR/xml-stylesheet</a>
+<br>
+</dd>
+<dt>Previous version:</dt>
+<dd>
+<a href="http://www.w3.org/TR/1999/xml-stylesheet-19990428">http://www.w3.org/TR/1999/xml-stylesheet-19990428</a>
+<br>
+</dd>
+<dt>Editor:</dt>
+<dd>
+
+James Clark
+<a href="mailto:jjc@jclark.com">&lt;jjc@jclark.com&gt;</a>
+<br>
+</dd>
+</dl>
+<p class="copyright">
+<a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Copyright">
+		Copyright</a> &nbsp;&copy;&nbsp; 1999 <a href="http://www.w3.org">W3C</a>
+		(<a href="http://www.lcs.mit.edu">MIT</a>,
+		<a href="http://www.inria.fr/">INRIA</a>,
+		<a href="http://www.keio.ac.jp/">Keio</a> ), All Rights Reserved. W3C
+		<a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Legal Disclaimer">liability,</a><a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#W3C Trademarks">trademark</a>,
+		<a href="http://www.w3.org/Consortium/Legal/copyright-documents.html">document use </a>and
+		<a href="http://www.w3.org/Consortium/Legal/copyright-software.html">software licensing </a>rules apply.
+	</p>
+<hr title="Separator for header">
+</div>
+<h2>
+<a name="abstract">Abstract</a>
+</h2>
+
+<p>This document allows a style sheet to be associated with an XML
+document by including one or more processing instructions with a
+target of <code>xml-stylesheet</code> in the document's prolog.</p>
+
+<h2>
+<a name="status">Status of this document</a>
+</h2>
+
+<p>This document has been reviewed by W3C Members and other interested
+parties and has been endorsed by the Director as a W3C <a href="http://www.w3.org/Consortium/Process/#RecsW3C">Recommendation</a>. It
+is a stable document and may be used as reference material or cited as
+a normative reference from other documents. W3C's role in making the
+Recommendation is to draw attention to the specification and to
+promote its widespread deployment. This enhances the functionality and
+interoperability of the Web.</p>
+
+<p>The list of known errors in this specifications is available at
+<a href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/errata">http://www.w3.org/TR/1999/xml-stylesheet-19990629/errata</a>.</p>
+
+<p>Comments on this specification may be sent to &lt;<a href="mailto:www-xml-stylesheet-comments@w3.org">www-xml-stylesheet-comments@w3.org</a>&gt;. The archive of public
+comments is available at <a href="http://www.w3.org/Archives/Public/www-xml-stylesheet-comments">http://w3.org/Archives/Public/www-xml-stylesheet-comments</a>.</p>
+
+<p>A list of current W3C Recommendations and other technical documents
+can be found at <a href="http://www.w3.org/TR">http://www.w3.org/TR</a>.</p>
+
+<p>The Working Group expects additional mechanisms for linking style
+sheets to XML document to be defined in a future specification.</p>
+
+<p>The use of XML processing instructions in this specification should
+not be taken as a precedent.  The W3C does not anticipate recommending
+the use of processing instructions in any future specification.  The
+<a href="#rationale">Rationale</a> explains why they were used in
+this specification.</p>
+
+<p>This document was produced as part of the <a href="http://www.w3.org/XML/Activity">W3C XML Activity</a>.</p>
+
+
+<h2>
+<a name="contents">Table of contents</a>
+</h2>1 <a href="#The xml-stylesheet processing instruction">The xml-stylesheet processing instruction</a>
+<br>
+<h3>Appendices</h3>A <a href="#References">References</a>
+<br>B <a href="#rationale">Rationale</a>
+<br>
+<hr>
+
+<h2>
+<a name="The xml-stylesheet processing instruction"></a>1 The <code>xml-stylesheet</code> processing instruction</h2>
+
+<p>Style Sheets can be associated with an XML<a href="#XML">[XML10]</a>
+document by using a processing instruction whose target is
+<code>xml-stylesheet</code>.  This processing instruction follows the
+behaviour of the HTML 4.0 <code>&lt;LINK
+REL="stylesheet"&gt;</code><a href="#HTML">[HTML40]</a>.</p>
+
+<p>The <code>xml-stylesheet</code> processing instruction is parsed in
+the same way as a start-tag, with the exception that entities other
+than predefined entities must not be referenced.</p>
+
+<p>The following grammar is given using the same notation as the
+grammar in the XML Recommendation<a href="#XML">[XML10]</a>.  Symbols in the
+grammar that are not defined here are defined in the XML
+Recommendation.</p>
+
+<h5>xml-stylesheet processing instruction</h5>
+<table class="scrap">
+<tbody>
+<tr valign="baseline">
+<td>
+<a name="NT-StyleSheetPI"></a>[1]&nbsp;&nbsp;&nbsp;</td>
+<td>StyleSheetPI</td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
+<td>'&lt;?xml-stylesheet' (<a href="http://www.w3.org/TR/REC-xml#NT-S">S</a> <a href="#NT-PseudoAtt">PseudoAtt</a>)* <a href="http://www.w3.org/TR/REC-xml#NT-S">S</a>? '?&gt;'</td>
+<td>
+</td>
+</tr>
+<tr valign="baseline">
+<td>
+<a name="NT-PseudoAtt"></a>[2]&nbsp;&nbsp;&nbsp;</td>
+<td>PseudoAtt</td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
+<td>
+<a href="http://www.w3.org/TR/REC-xml#NT-Name">Name</a> <a href="http://www.w3.org/TR/REC-xml#NT-S">S</a>? '=' <a href="http://www.w3.org/TR/REC-xml#NT-S">S</a>? <a href="#NT-PseudoAttValue">PseudoAttValue</a>
+</td>
+<td>
+</td>
+</tr>
+<tr valign="baseline">
+<td>
+<a name="NT-PseudoAttValue"></a>[3]&nbsp;&nbsp;&nbsp;</td>
+<td>PseudoAttValue</td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
+<td>('"' ([^"&lt;&amp;] | <a href="http://www.w3.org/TR/REC-xml#NT-CharRef">CharRef</a> | <a href="#NT-PredefEntityRef">PredefEntityRef</a>)* '"'</td>
+<td>
+</td>
+</tr>
+<tr valign="baseline">
+<td>
+</td>
+<td>
+</td>
+<td>
+</td>
+<td>| "'" ([^'&lt;&amp;] | <a href="http://www.w3.org/TR/REC-xml#NT-CharRef">CharRef</a> | <a href="#NT-PredefEntityRef">PredefEntityRef</a>)* "'")</td>
+<td>
+</td>
+</tr>
+<tr valign="baseline">
+<td>
+</td>
+<td>
+</td>
+<td>
+</td>
+<td>- (<a href="http://www.w3.org/TR/REC-xml#NT-Char">Char</a>* '?&gt;' <a href="http://www.w3.org/TR/REC-xml#NT-Char">Char</a>*)</td>
+<td>
+</td>
+</tr>
+<tr valign="baseline">
+<td>
+<a name="NT-PredefEntityRef"></a>[4]&nbsp;&nbsp;&nbsp;</td>
+<td>PredefEntityRef</td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
+<td>'&amp;amp;' | '&amp;lt;' | '&amp;gt;' | '&amp;quot;' | '&amp;apos;'</td>
+<td>
+</td>
+</tr>
+</tbody>
+</table>
+
+<p>In <a href="#NT-PseudoAttValue">PseudoAttValue</a>, a <a href="http://www.w3.org/TR/REC-xml#NT-CharRef">CharRef</a> or a <a href="#NT-PredefEntityRef">PredefEntityRef</a> is interpreted in the
+same manner as in a normal XML attribute value.  The actual value of
+the pseudo-attribute is the value after each reference is replaced by
+the character it references.  This replacement is not performed
+automatically by an XML processor.</p>
+
+<p>The <code>xml-stylesheet</code> processing instruction is allowed
+only in the prolog of an XML document. The syntax of XML constrains
+where processing instructions are allowed in the prolog; the
+<code>xml-stylesheet</code> processing instruction is allowed anywhere
+in the prolog that meets these constraints.</p>
+
+<blockquote>
+<b>NOTE: </b>If the <code>xml-stylesheet</code> processing instruction
+occurs in the external DTD subset or in a parameter entity, it is
+possible that it may not be processed by a non-validating XML
+processor (see <a href="#XML">[XML10]</a>).</blockquote>
+
+<p>The following pseudo attributes are defined</p>
+
+<pre>href CDATA #REQUIRED
+type CDATA #REQUIRED
+title CDATA #IMPLIED
+media CDATA #IMPLIED
+charset CDATA #IMPLIED
+alternate (yes|no) "no"</pre>
+
+<p>The semantics of the pseudo-attributes are exactly as with
+<code>&lt;LINK REL="stylesheet"&gt;</code> in HTML 4.0, with the
+exception of the <code>alternate</code> pseudo-attribute.  If
+<code>alternate="yes"</code> is specified, then the processing
+instruction has the semantics of <code>&lt;LINK REL="alternate
+stylesheet"&gt;</code> instead of <code>&lt;LINK
+REL="stylesheet"&gt;</code>.</p>
+
+<blockquote>
+<b>NOTE: </b>Since the value of the <code>href</code> attribute is a URI
+reference, it may be a relative URI and it may contain a fragment
+identifier. In particular the URI reference may contain only a
+fragment identifier.  Such a URI reference is a reference to a part of
+the document containing the <code>xml-stylesheet</code> processing
+instruction (see <a href="#RFC2396">[RFC2396]</a>). The consequence is that the
+<code>xml-stylesheet</code> processing instruction allows style sheets
+to be embedded in the same document as the <code>xml-stylesheet</code>
+processing instruction.</blockquote>
+
+<p>In some cases, style sheets may be linked with an XML document by
+means external to the document. For example, earlier versions of HTTP
+<a href="#RFC2068">[RFC2068]</a> (section 19.6.2.4) allowed style sheets to be
+associated with XML documents by means of the <code>Link</code>
+header.  Any links to style sheets that are specified externally to the
+document are considered to occur before the links specified by the
+<code>xml-stylesheet</code> processing instructions.  This is the same
+as in HTML 4.0 (see <a href="http://www.w3.org/TR/REC-html40/present/styles.html#h-14.6">section
+14.6</a>).</p>
+
+<p>Here are some examples from HTML 4.0 with the corresponding
+processing instruction:</p>
+
+<pre>&lt;LINK href="mystyle.css" rel="style sheet" type="text/css"&gt;
+&lt;?xml-stylesheet href="mystyle.css" type="text/css"?&gt;
+
+&lt;LINK href="mystyle.css" title="Compact" rel="stylesheet"
+type="text/css"&gt;
+&lt;?xml-stylesheet href="mystyle.css" title="Compact" type="text/css"?&gt;
+
+&lt;LINK href="mystyle.css" title="Medium" rel="alternate stylesheet"
+type="text/css"&gt;
+&lt;?xml-stylesheet alternate="yes" href="mystyle.css" title="Medium"
+type="text/css"?&gt;</pre>
+
+<p>Multiple <code>xml-stylesheet</code> processing instructions are
+also allowed with exactly the same semantics as with <code>LINK
+REL="stylesheet"</code>. For example,</p>
+
+<pre>&lt;LINK rel="alternate stylesheet" title="compact" href="small-base.css"
+type="text/css"&gt;
+&lt;LINK rel="alternate stylesheet" title="compact" href="small-extras.css"
+type="text/css"&gt;
+&lt;LINK rel="alternate stylesheet" title="big print" href="bigprint.css"
+type="text/css"&gt;
+&lt;LINK rel="stylesheet" href="common.css" type="text/css"&gt;</pre>
+
+<p>would be equivalent to:</p>
+
+<pre>&lt;?xml-stylesheet alternate="yes" title="compact" href="small-base.css"
+type="text/css"?&gt;
+&lt;?xml-stylesheet alternate="yes" title="compact" href="small-extras.css"
+type="text/css"?&gt;
+&lt;?xml-stylesheet alternate="yes" title="big print" href="bigprint.css"
+type="text/css"?&gt;
+&lt;?xml-stylesheet href="common.css" type="text/css"?&gt;</pre>
+
+
+
+<hr title="Separator from footer">
+
+<h2>
+<a name="References"></a>A References</h2>
+
+<dl>
+
+<dt>
+<a name="HTML">HTML40</a>
+</dt>
+<dd>World Wide Web
+Consortium. <i>HTML 4.0 Specification.</i> W3C Recommendation. See
+<a href="http://www.w3.org/TR/REC-html40">http://www.w3.org/TR/REC-html40</a>
+</dd>
+
+<dt>
+<a name="RFC2068">RFC2068</a>
+</dt>
+<dd>R. Fielding, J. Gettys, J. Mogul,
+H. Frystyk Nielsen, and T. Berners-Lee.  <i>Hypertext Transfer
+Protocol -- HTTP/1.1.</i>. IETF RFC 2068. See <a href="http://www.ietf.org/rfc/rfc2068.txt">http://www.ietf.org/rfc/rfc2068.txt</a>.</dd>
+
+<dt>
+<a name="RFC2396">RFC2396</a>
+</dt>
+<dd>T. Berners-Lee, R. Fielding, and
+L. Masinter.  <i>Uniform Resource Identifiers (URI): Generic
+Syntax</i>. IETF RFC 2396. See <a href="http://www.ietf.org/rfc/rfc2396.txt">http://www.ietf.org/rfc/rfc2396.txt</a>.</dd>
+
+<dt>
+<a name="XML">XML10</a>
+</dt>
+<dd>World Wide Web Consortium. <i>Extensible
+Markup Language (XML) 1.0.</i> W3C Recommendation. See <a href="http://www.w3.org/TR/1998/REC-xml-19980210">http://www.w3.org/TR/1998/REC-xml-19980210</a>
+</dd>
+
+</dl>
+
+
+
+
+<h2>
+<a name="rationale"></a>B Rationale</h2>
+
+<p>There was an urgent requirement for a specification for style sheet
+linking that could be completed in time for the next release from
+major browser vendors.  Only by choosing a simple mechanism closely
+based on a proven existing mechanism could the specification be
+completed in time to meet this requirement.</p>
+
+<p>Use of a processing instruction avoids polluting the main document
+structure with application specific processing information.</p>
+
+<p>The mechanism chosen for this version of the specification is not a
+constraint on the additional mechanisms planned for future versions.
+There is no expectation that these will use processing instructions;
+indeed they may not include the linking information in the source
+document.</p>
+
+
+
+
+</body>
+</html>
diff --git a/samples/data/xmldsig-core-schema.xsd b/samples/data/xmldsig-core-schema.xsd
new file mode 100644
index 0000000..df126b3
--- /dev/null
+++ b/samples/data/xmldsig-core-schema.xsd
@@ -0,0 +1,318 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema 
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified"> 
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence> 
+    <element ref="ds:SignedInfo"/> 
+    <element ref="ds:SignatureValue"/> 
+    <element ref="ds:KeyInfo" minOccurs="0"/> 
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/> 
+  </sequence>  
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/> 
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence> 
+    <element ref="ds:CanonicalizationMethod"/> 
+    <element ref="ds:SignatureMethod"/> 
+    <element ref="ds:Reference" maxOccurs="unbounded"/> 
+  </sequence>  
+  <attribute name="Id" type="ID" use="optional"/> 
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/> 
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/> 
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/> 
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence> 
+    <element ref="ds:Transforms" minOccurs="0"/> 
+    <element ref="ds:DigestMethod"/> 
+    <element ref="ds:DigestValue"/> 
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/> 
+  <attribute name="URI" type="anyURI" use="optional"/> 
+  <attribute name="Type" type="anyURI" use="optional"/> 
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>  
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded"> 
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/> 
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/> 
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true"> 
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>    
+  <attribute name="Algorithm" type="anyURI" use="required"/> 
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/> 
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">     
+    <element ref="ds:KeyName"/> 
+    <element ref="ds:KeyValue"/> 
+    <element ref="ds:RetrievalMethod"/> 
+    <element ref="ds:X509Data"/> 
+    <element ref="ds:PGPData"/> 
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/> 
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/> 
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/> 
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/> 
+    </sequence>  
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/> 
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType"> 
+  <sequence> 
+    <element name="X509IssuerName" type="string"/> 
+    <element name="X509SerialNumber" type="integer"/> 
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/> 
+<complexType name="PGPDataType"> 
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/> 
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/> 
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/> 
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/> 
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType> 
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/> 
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/> 
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/> 
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/> 
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/> 
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/> 
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/> 
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/> 
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/> 
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/> 
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/> 
+     <attribute name="Id" type="ID" use="optional"/> 
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/> 
+    <element name="Exponent" type="ds:CryptoBinary"/> 
+  </sequence>
+</complexType> 
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
diff --git a/samples/javax/xml/crypto/dsig/samples/GenDetached.java b/samples/javax/xml/crypto/dsig/samples/GenDetached.java
new file mode 100644
index 0000000..42c2e2c
--- /dev/null
+++ b/samples/javax/xml/crypto/dsig/samples/GenDetached.java
@@ -0,0 +1,157 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.xml.crypto.dsig.samples;
+
+import javax.xml.crypto.*;
+import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dom.*;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.security.*;
+import java.util.Collections;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+
+/**
+ * This is a simple example of generating a Detached XML
+ * Signature using the JSR 105 API. The resulting signature will look
+ * like (key and signature values will be different):
+ *
+ * <pre><code>
+ * <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+ *   <SignedInfo>
+ *     <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
+ *     <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
+ *     <Reference URI="http://www.w3.org/TR/xml-stylesheet">
+ *       <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ *       <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
+ *     </Reference>
+ *   </SignedInfo>
+ *   <SignatureValue>
+ *     DpEylhQoiUKBoKWmYfajXO7LZxiDYgVtUtCNyTgwZgoChzorA2nhkQ==
+ *   </SignatureValue>
+ *   <KeyInfo>
+ *     <KeyValue>
+ *       <DSAKeyValue>
+ *	   <P>
+ *           rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+ *           FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+ *           UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+ *         </P>
+ *         <Q>
+ *           kEjAFpCe4lcUOdwphpzf+tBaUds=
+ *         </Q>
+ *         <G>
+ *           oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+ *           SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+ *           BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+ *         </G>
+ *         <Y>
+ *           pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+ *           AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+ *           jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+ *         </Y>
+ *       </DSAKeyValue>
+ *     </KeyValue>
+ *   </KeyInfo>
+ * </Signature>
+ * </code></pre>
+ */
+public class GenDetached {
+
+    //
+    // Synopsis: java GenDetached [output]
+    //
+    // where output is the name of the file that will contain the detached
+    // signature. If not specified, standard output is used.
+    //
+    public static void main(String[] args) throws Exception {
+
+        // First, create a DOM XMLSignatureFactory that will be used to
+        // generate the XMLSignature and marshal it to DOM.
+        String providerName = System.getProperty
+            ("jsr105Provider", "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI");
+        XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
+            (Provider) Class.forName(providerName).newInstance());
+
+        // Create a Reference to an external URI that will be digested
+        // using the SHA1 digest algorithm
+        Reference ref =
+            fac.newReference(
+                "http://www.w3.org/TR/xml-stylesheet",
+                fac.newDigestMethod(DigestMethod.SHA1, null)
+            );
+
+        // Create the SignedInfo
+        SignedInfo si = fac.newSignedInfo(
+            fac.newCanonicalizationMethod
+                (CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
+                 (C14NMethodParameterSpec) null),
+            fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
+            Collections.singletonList(ref));
+
+        // Create a DSA KeyPair
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
+        kpg.initialize(512);
+        KeyPair kp = kpg.generateKeyPair();
+
+        // Create a KeyValue containing the DSA PublicKey that was generated
+        KeyInfoFactory kif = fac.getKeyInfoFactory();
+        KeyValue kv = kif.newKeyValue(kp.getPublic());
+
+        // Create a KeyInfo and add the KeyValue to it
+        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
+
+        // Create the XMLSignature (but don't sign it yet)
+        XMLSignature signature = fac.newXMLSignature(si, ki);
+
+        // Create the Document that will hold the resulting XMLSignature
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true); // must be set
+        Document doc = dbf.newDocumentBuilder().newDocument();
+
+        // Create a DOMSignContext and set the signing Key to the DSA
+        // PrivateKey and specify where the XMLSignature should be inserted
+        // in the target document (in this case, the document root)
+        DOMSignContext signContext = new DOMSignContext(kp.getPrivate(), doc);
+
+        // Marshal, generate (and sign) the detached XMLSignature. The DOM
+        // Document will contain the XML Signature if this method returns
+        // successfully.
+        signature.sign(signContext);
+
+        // output the resulting document
+        OutputStream os;
+        if (args.length > 0) {
+           os = new FileOutputStream(args[0]);
+        } else {
+           os = System.out;
+        }
+
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Transformer trans = tf.newTransformer();
+        trans.transform(new DOMSource(doc), new StreamResult(os));
+    }
+}
diff --git a/samples/javax/xml/crypto/dsig/samples/GenEnveloped.java b/samples/javax/xml/crypto/dsig/samples/GenEnveloped.java
new file mode 100644
index 0000000..1c5b76e
--- /dev/null
+++ b/samples/javax/xml/crypto/dsig/samples/GenEnveloped.java
@@ -0,0 +1,167 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.xml.crypto.dsig.samples;
+
+import javax.xml.crypto.*;
+import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dom.*;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.spec.*;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.security.*;
+import java.util.Collections;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+
+/**
+ * This is a simple example of generating an Enveloped XML
+ * Signature using the JSR 105 API. The resulting signature will look
+ * like (key and signature values will be different):
+ *
+ * <pre><code>
+ *<Envelope xmlns="urn:envelope">
+ * <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+ *   <SignedInfo>
+ *     <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n
+-20010315"/>
+ *     <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
+ *     <Reference URI="">
+ *       <Transforms>
+ *         <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+ *       </Transforms>
+ *       <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ *       <DigestValue>K8M/lPbKnuMDsO0Uzuj75lQtzQI=<DigestValue>
+ *     </Reference>
+ *   </SignedInfo>
+ *   <SignatureValue>
+ *     DpEylhQoiUKBoKWmYfajXO7LZxiDYgVtUtCNyTgwZgoChzorA2nhkQ==
+ *   </SignatureValue>
+ *   <KeyInfo>
+ *     <KeyValue>
+ *       <DSAKeyValue>
+ *         <P>
+ *           rFto8uPQM6y34FLPmDh40BLJ1rVrC8VeRquuhPZ6jYNFkQuwxnu/wCvIAMhukPBL
+ *           FET8bJf/b2ef+oqxZajEb+88zlZoyG8g/wMfDBHTxz+CnowLahnCCTYBp5kt7G8q
+ *           UobJuvjylwj1st7V9Lsu03iXMXtbiriUjFa5gURasN8=
+ *         </P>
+ *         <Q>
+ *           kEjAFpCe4lcUOdwphpzf+tBaUds=
+ *         </Q>
+ *         <G>
+ *           oe14R2OtyKx+s+60O5BRNMOYpIg2TU/f15N3bsDErKOWtKXeNK9FS7dWStreDxo2
+ *           SSgOonqAd4FuJ/4uva7GgNL4ULIqY7E+mW5iwJ7n/WTELh98mEocsLXkNh24HcH4
+ *           BZfSCTruuzmCyjdV1KSqX/Eux04HfCWYmdxN3SQ/qqw=
+ *         </G>
+ *         <Y>
+ *           pA5NnZvcd574WRXuOA7ZfC/7Lqt4cB0MRLWtHubtJoVOao9ib5ry4rTk0r6ddnOv
+ *           AIGKktutzK3ymvKleS3DOrwZQgJ+/BDWDW8kO9R66o6rdjiSobBi/0c2V1+dkqOg
+ *           jFmKz395mvCOZGhC7fqAVhHat2EjGPMfgSZyABa7+1k=
+ *         </Y>
+ *       </DSAKeyValue>
+ *     </KeyValue>
+ *   </KeyInfo>
+ * </Signature>
+ *</Envelope>
+ * </code></pre>
+ */
+public class GenEnveloped {
+
+    //
+    // Synopsis: java GenEnveloped [document] [output]
+    //
+    //    where "document" is the name of a file containing the XML document
+    //    to be signed, and "output" is the name of the file to store the
+    //    signed document. The 2nd argument is optional - if not specified,
+    //    standard output will be used.
+    //
+    public static void main(String[] args) throws Exception {
+
+        // Create a DOM XMLSignatureFactory that will be used to generate the
+        // enveloped signature
+        String providerName = System.getProperty
+            ("jsr105Provider", "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI");
+        XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
+             (Provider) Class.forName(providerName).newInstance());
+
+        // Create a Reference to the enveloped document (in this case we are
+        // signing the whole document, so a URI of "" signifies that) and
+        // also specify the SHA1 digest algorithm and the ENVELOPED Transform.
+        Reference ref = fac.newReference
+            ("", fac.newDigestMethod(DigestMethod.SHA1, null),
+             Collections.singletonList
+              (fac.newTransform
+                (Transform.ENVELOPED, (TransformParameterSpec) null)),
+             null, null);
+
+        // Create the SignedInfo
+        SignedInfo si = fac.newSignedInfo
+            (fac.newCanonicalizationMethod
+             (CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
+              (C14NMethodParameterSpec) null),
+             fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
+             Collections.singletonList(ref));
+
+        // Create a DSA KeyPair
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
+        kpg.initialize(512);
+        KeyPair kp = kpg.generateKeyPair();
+
+        // Create a KeyValue containing the DSA PublicKey that was generated
+        KeyInfoFactory kif = fac.getKeyInfoFactory();
+        KeyValue kv = kif.newKeyValue(kp.getPublic());
+
+        // Create a KeyInfo and add the KeyValue to it
+        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
+
+        // Instantiate the document to be signed
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        Document doc =
+            dbf.newDocumentBuilder().parse(new FileInputStream(args[0]));
+
+        // Create a DOMSignContext and specify the DSA PrivateKey and
+        // location of the resulting XMLSignature's parent element
+        DOMSignContext dsc = new DOMSignContext
+            (kp.getPrivate(), doc.getDocumentElement());
+
+        // Create the XMLSignature (but don't sign it yet)
+        XMLSignature signature = fac.newXMLSignature(si, ki);
+
+        // Marshal, generate (and sign) the enveloped signature
+        signature.sign(dsc);
+
+        // output the resulting document
+        OutputStream os;
+        if (args.length > 1) {
+           os = new FileOutputStream(args[1]);
+        } else {
+           os = System.out;
+        }
+
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Transformer trans = tf.newTransformer();
+        trans.transform(new DOMSource(doc), new StreamResult(os));
+    }
+}
diff --git a/samples/javax/xml/crypto/dsig/samples/GenEnveloping.java b/samples/javax/xml/crypto/dsig/samples/GenEnveloping.java
new file mode 100644
index 0000000..5289ffb
--- /dev/null
+++ b/samples/javax/xml/crypto/dsig/samples/GenEnveloping.java
@@ -0,0 +1,160 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.xml.crypto.dsig.samples;
+
+import javax.xml.crypto.*;
+import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dom.*;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.security.*;
+import java.util.Collections;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * This is a simple example of generating an Enveloping XML
+ * Signature using the JSR 105 API. The signature in this case references a
+ * local URI that points to an Object element.
+ * The resulting signature will look like (certificate and
+ * signature values will be different):
+ *
+ * <pre><code>
+ * <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+ *   <SignedInfo>
+ *     <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
+ *     <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
+ *     <Reference URI="#object">
+ *       <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ *       <DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
+ *     </Reference>
+ *   </SignedInfo>
+ *   <SignatureValue>
+ *     RpMRbtMHLa0siSS+BwUpLIEmTfh/0fsld2JYQWZzCzfa5kBTz25+XA==
+ *   </SignatureValue>
+ *   <KeyInfo>
+ *     <KeyValue>
+ *       <DSAKeyValue>
+ *         <P>
+ *           /KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0Imbz
+ *           RMqzVDZkVG9xD7nN1kuFw==
+ *         </P>
+ *         <Q>
+ *           li7dzDacuo67Jg7mtqEm2TRuOMU=
+ *         </Q>
+ *         <G>
+ *           Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOH
+ *           CBiNU0NogpsQW5QvnlMpA==
+ *         </G>
+ *         <Y>
+ *           wbEUaCgHZXqK4qLvbdYrAc6+Do0XVcsziCJqxzn4cJJRxwc3E1xnEXHscVgr1Cql9
+ *           i5fanOKQbFXzmb+bChqig==
+ *         </Y>
+ *       </DSAKeyValue>
+ *     </KeyValue>
+ *   </KeyInfo>
+ *   <Object Id="object">some text</Object>
+ * </Signature>
+ *
+ * </code></pre>
+ */
+public class GenEnveloping {
+
+    //
+    // Synopis: java GenEnveloping [output]
+    //
+    //   where "output" is the name of a file that will contain the
+    //   generated signature. If not specified, standard ouput will be used.
+    //
+    public static void main(String[] args) throws Exception {
+
+        // First, create the DOM XMLSignatureFactory that will be used to
+        // generate the XMLSignature
+        String providerName = System.getProperty
+            ("jsr105Provider", "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI");
+        XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
+            (Provider) Class.forName(providerName).newInstance());
+
+        // Next, create a Reference to a same-document URI that is an Object
+        // element and specify the SHA1 digest algorithm
+        Reference ref = fac.newReference("#object",
+            fac.newDigestMethod(DigestMethod.SHA1, null));
+
+        // Next, create the referenced Object
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        Document doc = dbf.newDocumentBuilder().newDocument();
+        Node text = doc.createTextNode("some text");
+        XMLStructure content = new DOMStructure(text);
+        XMLObject obj = fac.newXMLObject
+            (Collections.singletonList(content), "object", null, null);
+
+        // Create the SignedInfo
+        SignedInfo si = fac.newSignedInfo(
+            fac.newCanonicalizationMethod
+                (CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
+                 (C14NMethodParameterSpec) null),
+            fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
+            Collections.singletonList(ref));
+
+        // Create a DSA KeyPair
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
+        kpg.initialize(512);
+        KeyPair kp = kpg.generateKeyPair();
+
+        // Create a KeyValue containing the DSA PublicKey that was generated
+        KeyInfoFactory kif = fac.getKeyInfoFactory();
+        KeyValue kv = kif.newKeyValue(kp.getPublic());
+
+        // Create a KeyInfo and add the KeyValue to it
+        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
+
+        // Create the XMLSignature (but don't sign it yet)
+        XMLSignature signature = fac.newXMLSignature(si, ki,
+            Collections.singletonList(obj), null, null);
+
+        // Create a DOMSignContext and specify the DSA PrivateKey for signing
+        // and the document location of the XMLSignature
+        DOMSignContext dsc = new DOMSignContext(kp.getPrivate(), doc);
+
+        // Lastly, generate the enveloping signature using the PrivateKey
+        signature.sign(dsc);
+
+        // output the resulting document
+        OutputStream os;
+        if (args.length > 0) {
+           os = new FileOutputStream(args[0]);
+        } else {
+           os = System.out;
+        }
+
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Transformer trans = tf.newTransformer();
+        trans.transform(new DOMSource(doc), new StreamResult(os));
+    }
+}
diff --git a/samples/javax/xml/crypto/dsig/samples/Validate.java b/samples/javax/xml/crypto/dsig/samples/Validate.java
new file mode 100644
index 0000000..40d68ba
--- /dev/null
+++ b/samples/javax/xml/crypto/dsig/samples/Validate.java
@@ -0,0 +1,159 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.xml.crypto.dsig.samples;
+
+import javax.xml.crypto.*;
+import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dom.*;
+import javax.xml.crypto.dsig.dom.DOMValidateContext;
+import javax.xml.crypto.dsig.keyinfo.*;
+import java.io.FileInputStream;
+import java.security.*;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+/**
+ * This is a simple example of validating an XML
+ * Signature using the JSR 105 API. It assumes the key needed to
+ * validate the signature is contained in a KeyValue KeyInfo.
+ */
+public class Validate {
+
+    //
+    // Synopsis: java Validate [document]
+    //
+    //	  where "document" is the name of a file containing the XML document
+    //	  to be validated.
+    //
+    public static void main(String[] args) throws Exception {
+
+        // Instantiate the document to be validated
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        Document doc =
+            dbf.newDocumentBuilder().parse(new FileInputStream(args[0]));
+
+        // Find Signature element
+        NodeList nl =
+            doc.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature");
+        if (nl.getLength() == 0) {
+            throw new Exception("Cannot find Signature element");
+        }
+
+        // Create a DOM XMLSignatureFactory that will be used to unmarshal the
+        // document containing the XMLSignature
+        String providerName = System.getProperty
+            ("jsr105Provider", "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI");
+        XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
+            (Provider) Class.forName(providerName).newInstance());
+
+        // Create a DOMValidateContext and specify a KeyValue KeySelector
+        // and document context
+        DOMValidateContext valContext = new DOMValidateContext
+            (new KeyValueKeySelector(), nl.item(0));
+
+        // unmarshal the XMLSignature
+        XMLSignature signature = fac.unmarshalXMLSignature(valContext);
+
+        // Validate the XMLSignature (generated above)
+        boolean coreValidity = signature.validate(valContext);
+
+        // Check core validation status
+        if (coreValidity == false) {
+            System.err.println("Signature failed core validation");
+            boolean sv = signature.getSignatureValue().validate(valContext);
+            System.out.println("signature validation status: " + sv);
+            // check the validation status of each Reference
+            Iterator i = signature.getSignedInfo().getReferences().iterator();
+            for (int j = 0; i.hasNext(); j++) {
+                boolean refValid =
+                    ((Reference) i.next()).validate(valContext);
+                System.out.println("ref[" + j + "] validity status: " + refValid);
+            }
+        } else {
+            System.out.println("Signature passed core validation");
+        }
+    }
+
+    /**
+     * KeySelector which retrieves the public key out of the
+     * KeyValue element and returns it.
+     * NOTE: If the key algorithm doesn't match signature algorithm,
+     * then the public key will be ignored.
+     */
+    private static class KeyValueKeySelector extends KeySelector {
+        public KeySelectorResult select(KeyInfo keyInfo,
+                                        KeySelector.Purpose purpose,
+                                        AlgorithmMethod method,
+                                        XMLCryptoContext context)
+            throws KeySelectorException {
+            if (keyInfo == null) {
+                throw new KeySelectorException("Null KeyInfo object!");
+            }
+            SignatureMethod sm = (SignatureMethod) method;
+            List list = keyInfo.getContent();
+
+            for (int i = 0; i < list.size(); i++) {
+                XMLStructure xmlStructure = (XMLStructure) list.get(i);
+                if (xmlStructure instanceof KeyValue) {
+                    PublicKey pk = null;
+                    try {
+                        pk = ((KeyValue)xmlStructure).getPublicKey();
+                    } catch (KeyException ke) {
+                        throw new KeySelectorException(ke);
+                    }
+                    // make sure algorithm is compatible with method
+                    if (algEquals(sm.getAlgorithm(), pk.getAlgorithm())) {
+                        return new SimpleKeySelectorResult(pk);
+                    }
+                }
+            }
+            throw new KeySelectorException("No KeyValue element found!");
+        }
+
+        //@@@FIXME: this should also work for key types other than DSA/RSA
+        static boolean algEquals(String algURI, String algName) {
+            if (algName.equalsIgnoreCase("DSA") &&
+                algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) {
+                return true;
+            } else if (algName.equalsIgnoreCase("RSA") &&
+                algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1)) {
+                return true;
+            } else if (algName.equalsIgnoreCase("EC") &&
+                algURI.equalsIgnoreCase("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256")) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    }
+
+    private static class SimpleKeySelectorResult implements KeySelectorResult {
+        private PublicKey pk;
+        SimpleKeySelectorResult(PublicKey pk) {
+            this.pk = pk;
+        }
+
+        public Key getKey() { return pk; }
+    }
+}
diff --git a/samples/javax/xml/crypto/dsig/samples/envelope.xml b/samples/javax/xml/crypto/dsig/samples/envelope.xml
new file mode 100644
index 0000000..d02d43c
--- /dev/null
+++ b/samples/javax/xml/crypto/dsig/samples/envelope.xml
@@ -0,0 +1,2 @@
+<Envelope xmlns="urn:envelope">
+</Envelope>
diff --git a/samples/javax/xml/crypto/dsig/samples/envelopedSignature.xml b/samples/javax/xml/crypto/dsig/samples/envelopedSignature.xml
new file mode 100644
index 0000000..9e204a3
--- /dev/null
+++ b/samples/javax/xml/crypto/dsig/samples/envelopedSignature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="urn:envelope">
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" xmlns="http://www.w3.org/2000/09/xmldsig#"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" xmlns="http://www.w3.org/2000/09/xmldsig#"/><Reference URI="" xmlns="http://www.w3.org/2000/09/xmldsig#"><Transforms xmlns="http://www.w3.org/2000/09/xmldsig#"><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" xmlns="http://www.w3.org/2000/09/xmldsig#"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns="http://www.w3.org/2000/09/xmldsig#"/><DigestValue xmlns="http://www.w3.org/2000/09/xmldsig#">uooqbWYa5VCqcJCbuymBKqm17vY=</DigestValue></Reference></SignedInfo><SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">eO7K1BdC0kzNvr1HpMf4hKoWsvl+oI04nMw55GO+Z5hyI6By3Oihow==</SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#"><DSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#"><P xmlns="http://www.w3.org/2000/09/xmldsig#">/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9
+xD7nN1kuFw==</P><Q xmlns="http://www.w3.org/2000/09/xmldsig#">li7dzDacuo67Jg7mtqEm2TRuOMU=</Q><G xmlns="http://www.w3.org/2000/09/xmldsig#">Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps
+QW5QvnlMpA==</G><Y xmlns="http://www.w3.org/2000/09/xmldsig#">OqFi0sGpvroi6Ut3m154QNWc6gavH3j2ZoRPDW7qVBbgk7XompuKvZe1owz0yvxq+1K+mWbL7ST+
+t5nr6UFBCg==</Y></DSAKeyValue></KeyValue></KeyInfo></Signature></Envelope>
\ No newline at end of file
diff --git a/samples/org/apache/xml/security/samples/AxisSigner.java b/samples/org/apache/xml/security/samples/AxisSigner.java
new file mode 100644
index 0000000..b439972
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/AxisSigner.java
@@ -0,0 +1,142 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.utils.Constants;
+import org.apache.xml.security.utils.XMLUtils;
+import org.w3c.dom.Element;
+
+/**
+ * @author $Author$
+ */
+public class AxisSigner {
+
+    /** Field AXIS_SIGNATURE_FILENAME           */
+    public static final String AXIS_SIGNATURE_FILENAME = "build/axisSignature.xml";
+
+    /**
+     * Method main
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void main(String unused[]) throws Exception {
+
+        org.apache.xml.security.Init.init();
+
+        String keystoreType = "JKS";
+        String keystoreFile = "samples/data/keystore.jks";
+        String keystorePass = "xmlsecurity";
+        String privateKeyAlias = "test";
+        String privateKeyPass = "xmlsecurity";
+        String certificateAlias = "test";
+        File signatureFile = new File(AXIS_SIGNATURE_FILENAME);
+
+        KeyStore ks = KeyStore.getInstance(keystoreType);
+        FileInputStream fis = new FileInputStream(keystoreFile);
+
+        ks.load(fis, keystorePass.toCharArray());
+
+        PrivateKey privateKey =
+            (PrivateKey) ks.getKey(privateKeyAlias, privateKeyPass.toCharArray());
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+        dbf.setNamespaceAware(true);
+
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        org.w3c.dom.Document doc = db.newDocument();
+
+        /*
+         * Start SOAP infrastructure code. This is to be made compatible with Axis.
+         *
+         */
+        String soapNS = "http://www.w3.org/2001/12/soap-envelope";
+        String SOAPSECNS = "http://schemas.xmlsoap.org/soap/security/2000-12";
+
+        Element envelopeElement = doc.createElementNS(soapNS, "env:Envelope");
+
+        envelopeElement.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:env", soapNS);
+        doc.appendChild(envelopeElement);
+
+        Element headerElem = doc.createElementNS(soapNS, "env:Header");
+        Element bodyElem = doc.createElementNS(soapNS, "env:Body");
+
+        envelopeElement.appendChild(doc.createTextNode("\n"));
+        envelopeElement.appendChild(headerElem);
+        envelopeElement.appendChild(doc.createTextNode("\n"));
+        envelopeElement.appendChild(bodyElem);
+        envelopeElement.appendChild(doc.createTextNode("\n"));
+        bodyElem.appendChild(
+            doc.createTextNode("This is signed together with it's Body ancestor")
+        );
+
+        bodyElem.setAttributeNS(SOAPSECNS, "SOAP-SEC:id", "Body");
+        bodyElem.setIdAttributeNS(SOAPSECNS, "id", true);
+
+        Element soapSignatureElem = doc.createElementNS(SOAPSECNS, "SOAP-SEC:Signature");
+
+        envelopeElement.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:SOAP-SEC", SOAPSECNS);
+        envelopeElement.setAttributeNS(null, "actor", "some-uri");
+        envelopeElement.setAttributeNS(null, "mustUnderstand", "1");
+        envelopeElement.appendChild(doc.createTextNode("\n"));
+        headerElem.appendChild(soapSignatureElem);
+
+        /*
+         *
+         * End SOAP infrastructure code. This is to be made compatible with Axis.
+         */
+        String BaseURI = signatureFile.toURI().toURL().toString();
+        XMLSignature sig = new XMLSignature(doc, BaseURI, XMLSignature.ALGO_ID_SIGNATURE_DSA);
+
+        soapSignatureElem.appendChild(sig.getElement());
+
+        {
+            sig.addDocument("#Body");
+        }
+
+        {
+            X509Certificate cert =
+                (X509Certificate) ks.getCertificate(certificateAlias);
+
+            sig.addKeyInfo(cert);
+            sig.addKeyInfo(cert.getPublicKey());
+            sig.sign(privateKey);
+        }
+
+        FileOutputStream f = new FileOutputStream(signatureFile);
+
+        XMLUtils.outputDOMc14nWithComments(doc, f);
+        f.close();
+        System.out.println("Wrote signature to " + BaseURI);
+
+        for (int i = 0; i < sig.getSignedInfo().getSignedContentLength(); i++) {
+            System.out.println("--- Signed Content follows ---");
+            System.out.println(new String(sig.getSignedInfo().getSignedContentItem(i)));
+        }
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/AxisVerifier.java b/samples/org/apache/xml/security/samples/AxisVerifier.java
new file mode 100644
index 0000000..07fb3ce
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/AxisVerifier.java
@@ -0,0 +1,93 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.utils.Constants;
+import org.w3c.dom.Element;
+
+/**
+ * @author $Author$
+ */
+public class AxisVerifier {
+
+    /**
+     * Method main
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void main(String unused[]) throws Exception {
+
+        org.apache.xml.security.Init.init();
+
+        File signatureFile = new File(AxisSigner.AXIS_SIGNATURE_FILENAME);
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+        dbf.setNamespaceAware(true);
+
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        org.w3c.dom.Document doc = db.parse(new FileInputStream(signatureFile));
+        String BaseURI = signatureFile.toURI().toURL().toString();
+
+        XPathFactory xpf = XPathFactory.newInstance();
+        XPath xpath = xpf.newXPath();
+        DSNamespaceContext context = new DSNamespaceContext();
+        xpath.setNamespaceContext(context);
+
+        String expression = "//ds:Signature[1]";
+        Element sigElement =
+            (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);
+
+        expression = "//env:Body[1]";
+        context.putPrefix("env", "http://www.w3.org/2001/12/soap-envelope");
+        Element bodyElement =
+            (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);
+        bodyElement.setIdAttributeNS("http://schemas.xmlsoap.org/soap/security/2000-12", "id", true);
+
+        XMLSignature sig = new XMLSignature(sigElement, BaseURI);
+        boolean verify = sig.checkSignatureValue(sig.getKeyInfo().getPublicKey());
+
+        System.out.println("The signature is" + (verify ? " " : " not ") + "valid");
+
+        for (int i = 0; i < sig.getSignedInfo().getSignedContentLength(); i++) {
+            boolean thisOneWasSigned =
+                sig.getSignedInfo().getVerificationResult(i);
+
+            if (thisOneWasSigned) {
+                System.out.println("--- Signed Content follows ---");
+                System.out.println(new String(sig.getSignedInfo().getSignedContentItem(i)));
+            }
+        }
+
+        System.out.println("");
+        System.out.println("Prior transforms");
+        System.out.println(
+            new String(sig.getSignedInfo().getReferencedContentBeforeTransformsItem(0).getBytes())
+        );
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/DSNamespaceContext.java b/samples/org/apache/xml/security/samples/DSNamespaceContext.java
new file mode 100644
index 0000000..45ccdae
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/DSNamespaceContext.java
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ * A NamespaceContext implementation for digital signatures
+ */
+public class DSNamespaceContext implements NamespaceContext {
+
+    private Map<String, String> namespaceMap =
+        new HashMap<String, String>();
+
+    public DSNamespaceContext() {
+        namespaceMap.put("ds", "http://www.w3.org/2000/09/xmldsig#");
+    }
+
+    public DSNamespaceContext(Map<String, String> namespaces) {
+        this();
+        namespaceMap.putAll(namespaces);
+    }
+
+    public String getNamespaceURI(String arg0) {
+        return namespaceMap.get(arg0);
+    }
+
+    public void putPrefix(String prefix, String namespace) {
+        namespaceMap.put(prefix, namespace);
+    }
+
+    public String getPrefix(String arg0) {
+        for (String key : namespaceMap.keySet()) {
+            String value = namespaceMap.get(key);
+            if (value.equals(arg0)) {
+                return key;
+            }
+        }
+        return null;
+    }
+
+    public Iterator<String> getPrefixes(String arg0) {
+        return namespaceMap.keySet().iterator();
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/MyResolver.java b/samples/org/apache/xml/security/samples/MyResolver.java
new file mode 100644
index 0000000..f8987bd
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/MyResolver.java
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples;
+
+import java.io.ByteArrayInputStream;
+
+import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.w3c.dom.Attr;
+
+/**
+ * @author $Author$
+ */
+public class MyResolver extends ResourceResolverSpi {
+
+    /**
+     * Method engineResolve
+     * @inheritDoc
+     * @param uri
+     * @param BaseURI
+     *
+     */
+    public XMLSignatureInput engineResolve(Attr uri, String BaseURI) {
+        ByteArrayInputStream is =
+            new ByteArrayInputStream("string".getBytes());
+        return new XMLSignatureInput(is);
+    }
+
+    /**
+     * Method engineCanResolve
+     * @inheritDoc
+     * @param uri
+     * @param BaseURI
+     *
+     */
+    public boolean engineCanResolve(Attr uri, String BaseURI) {
+        return true;
+    }
+
+}
diff --git a/samples/org/apache/xml/security/samples/SampleUtils.java b/samples/org/apache/xml/security/samples/SampleUtils.java
new file mode 100644
index 0000000..92256c9
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/SampleUtils.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples;
+
+import org.apache.xml.security.utils.Constants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class SampleUtils {
+
+    /**
+     * Method createDSctx
+     *
+     * @param doc
+     * @param prefix
+     * @param namespace
+     * @return the element.
+     */
+    public static Element createDSctx
+        (Document doc, String prefix, String namespace) {
+
+        if ((prefix == null) || (prefix.trim().length() == 0)) {
+            throw new IllegalArgumentException("You must supply a prefix");
+        }
+
+        Element ctx = doc.createElementNS(null, "namespaceContext");
+
+        ctx.setAttributeNS
+            (Constants.NamespaceSpecNS, "xmlns:" + prefix.trim(), namespace);
+
+        return ctx;
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/algorithms/HMacSHA1RoundTrip.java b/samples/org/apache/xml/security/samples/algorithms/HMacSHA1RoundTrip.java
new file mode 100644
index 0000000..5b4d65a
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/algorithms/HMacSHA1RoundTrip.java
@@ -0,0 +1,158 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.algorithms;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.xml.security.algorithms.SignatureAlgorithm;
+import org.apache.xml.security.utils.Base64;
+import org.apache.xml.security.utils.XMLUtils;
+import org.w3c.dom.Document;
+
+/**
+ *
+ * @author $Author$
+ */
+public class HMacSHA1RoundTrip {
+
+    static {
+        org.apache.xml.security.Init.init();
+    }
+
+    /**
+     * Method main
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void main(String unused[]) throws Exception {
+        String keystoreType = "JKS";
+        String keystoreFile = "samples/data/keystore.jks";
+        String keystorePass = "xmlsecurity";
+        String privateKeyAlias = "test";
+        String privateKeyPass = "xmlsecurity";
+        String certificateAlias = "test";
+        File signatureFile = new File("signature.xml");
+
+        KeyStore ks = KeyStore.getInstance(keystoreType);
+        FileInputStream fis = new FileInputStream(keystoreFile);
+
+        ks.load(fis, keystorePass.toCharArray());
+
+        PrivateKey privateKey =
+            (PrivateKey) ks.getKey(privateKeyAlias, privateKeyPass.toCharArray());
+        X509Certificate cert =
+            (X509Certificate) ks.getCertificate(certificateAlias);
+        PublicKey publicKey = cert.getPublicKey();
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+
+        dbf.setNamespaceAware(true);
+
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        Document doc = db.newDocument();
+
+        SignatureAlgorithm sa =
+            new SignatureAlgorithm(doc, "http://www.w3.org/2000/09/xmldsig#dsa-sha1");
+
+        sa.initSign(privateKey);
+        sa.update("sdjhfkjashkjf".getBytes());
+
+        byte signatureValue[] = sa.sign();
+
+        System.out.println(Base64.encode(signatureValue));
+        doc.appendChild(sa.getElement());
+        XMLUtils.outputDOM(doc, System.out);
+        System.out.println("");
+        System.out.println("");
+
+        SignatureAlgorithm verifier =
+            new SignatureAlgorithm(doc.getDocumentElement(), "file:");
+
+        verifier.initVerify(publicKey);
+        verifier.update("sdjhfkjashkjf".getBytes());
+
+        boolean result = verifier.verify(signatureValue);
+
+        if (result) {
+            System.out.println("It verified");
+        } else {
+            System.out.println("It failed");
+        }
+    }
+
+    /**
+     * Method mainSha1
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void mainSha1(String unused[]) throws Exception {
+
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        Document doc = db.newDocument();
+
+        SignatureAlgorithm sa =
+            new SignatureAlgorithm(doc, "http://www.w3.org/2000/09/xmldsig#hmac-sha1", 33);
+
+        byte keybytes[] = "01234567890123456789".getBytes();
+        SecretKey sk = new SecretKeySpec(keybytes, sa.getJCEAlgorithmString());
+
+        sa.initSign(sk);
+        sa.update("sdjhfkjashkjf".getBytes());
+
+        byte signatureValue[] = sa.sign();
+
+        System.out.println(Base64.encode(signatureValue));
+        doc.appendChild(sa.getElement());
+        XMLUtils.outputDOM(doc, System.out);
+        System.out.println("");
+        System.out.println("");
+
+        javax.crypto.Mac a;
+        SignatureAlgorithm verifier =
+            new SignatureAlgorithm(doc.getDocumentElement(), "file:");
+        SecretKey pk =
+            new SecretKeySpec("01234567890123456789".getBytes(), verifier.getJCEAlgorithmString());
+
+        verifier.initVerify(pk);
+        verifier.update("sdjhfkjashkjf".getBytes());
+
+        boolean result = verifier.verify(signatureValue);
+
+        if (result) {
+            System.out.println("It verified");
+        } else {
+            System.out.println("It failed");
+        }
+    }
+
+}
diff --git a/samples/org/apache/xml/security/samples/canonicalization/CanonByTransform.java b/samples/org/apache/xml/security/samples/canonicalization/CanonByTransform.java
new file mode 100644
index 0000000..6753050
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/canonicalization/CanonByTransform.java
@@ -0,0 +1,92 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.canonicalization;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.transforms.Transforms;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * @author Christian Geuer-Pollmann
+ */
+public class CanonByTransform {
+    static String input = ""
+        + "<!DOCTYPE doc [<!ATTLIST e9 attr CDATA \"default\">]>\n"
+        + "<!-- Comment 2 --><doc><!-- comment inside -->\n"
+        + "   <e1   />\n"
+        + "   <e2   ></e2>\n"
+        + "   <e3    name = \"elem3\"   id=\"elem3\"    />\n"
+        + "   <e4    name=\"elem4\"   id=\"elem4\"    ></e4>\n"
+        + "   <e5 a:attr=\"out\" b:attr=\"sorted\" attr2=\"all\" attr=\"I'm\"\n"
+        + "       xmlns:b=\"http://www.ietf.org\"\n"
+        + "       xmlns:a=\"http://www.w3.org\"\n"
+        + "       xmlns=\"http://example.org\"/>\n"
+        + "   <e6 xmlns=\"\" xmlns:a=\"http://www.w3.org\">\n"
+        + "       <e7 xmlns=\"http://www.ietf.org\">\n"
+        + "           <e8 xmlns=\"\" xmlns:a=\"http://www.w3.org\">\n"
+        + "               <e9 xmlns=\"\" xmlns:a=\"http://www.ietf.org\"/>\n"
+        + "               <text>&#169;</text>\n"
+        + "           </e8>\n"
+        + "       </e7>\n"
+        + "   </e6>\n"
+        + "</doc><!-- Comment 3 -->\n"
+        ;
+
+    /**
+     * Method main
+     *
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String args[]) throws Exception {
+        org.apache.xml.security.Init.init();
+
+        DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
+
+        dfactory.setNamespaceAware(true);
+        dfactory.setValidating(true);
+
+        DocumentBuilder documentBuilder = dfactory.newDocumentBuilder();
+
+        // this is to throw away all validation warnings
+        documentBuilder.setErrorHandler(new org.apache.xml.security.utils.IgnoreAllErrorHandler());
+
+        byte inputBytes[] = input.getBytes();
+        Document inputDoc =
+            documentBuilder.parse(new ByteArrayInputStream(inputBytes));
+
+        // after playing around, we have our document now
+        XMLSignatureInput signatureInput = new XMLSignatureInput((Node) inputDoc);
+        Document transformDoc = documentBuilder.newDocument();
+
+        Transforms c14nTrans = new Transforms(transformDoc);
+        transformDoc.appendChild(c14nTrans.getElement());
+        c14nTrans.addTransform("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
+        XMLSignatureInput c14nResult = c14nTrans.performTransforms(signatureInput);
+        byte outputBytes[] = c14nResult.getBytes();
+
+        System.out.println(new String(outputBytes));
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/canonicalization/CanonDirect.java b/samples/org/apache/xml/security/samples/canonicalization/CanonDirect.java
new file mode 100644
index 0000000..67b59dd
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/canonicalization/CanonDirect.java
@@ -0,0 +1,87 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.canonicalization;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.w3c.dom.Document;
+
+/**
+ *
+ *
+ * @author Christian Geuer-Pollmann
+ */
+public class CanonDirect {
+    static String input = ""
+        + "<!DOCTYPE doc [<!ATTLIST e9 attr CDATA \"default\">]>\n"
+        + "<!-- Comment 2 --><doc>\n"
+        + "   <e1   />\n"
+        + "   <e2   ></e2>\n"
+        + "   <e3    name = \"elem3\"   id=\"elem3\"    />\n"
+        + "   <e4    name=\"elem4\"   id=\"elem4\"    ></e4>\n"
+        + "   <e5 a:attr=\"out\" b:attr=\"sorted\" attr2=\"all\" attr=\"I'm\"\n"
+        + "       xmlns:b=\"http://www.ietf.org\"\n"
+        + "       xmlns:a=\"http://www.w3.org\"\n"
+        + "       xmlns=\"http://example.org\"/>\n"
+        + "   <e6 xmlns=\"\" xmlns:a=\"http://www.w3.org\">\n"
+        + "       <e7 xmlns=\"http://www.ietf.org\">\n"
+        + "           <e8 xmlns=\"\" xmlns:a=\"http://www.w3.org\">\n"
+        + "               <e9 xmlns=\"\" xmlns:a=\"http://www.ietf.org\"/>\n"
+        + "               <text>&#169;</text>\n"
+        + "           </e8>\n"
+        + "       </e7>\n"
+        + "   </e6>\n"
+        + "</doc><!-- Comment 3 -->\n"
+        ;
+
+    /**
+     * Method main
+     *
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String args[]) throws Exception {
+        org.apache.xml.security.Init.init();
+
+        DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
+
+        dfactory.setNamespaceAware(true);
+        dfactory.setValidating(true);
+
+        DocumentBuilder documentBuilder = dfactory.newDocumentBuilder();
+
+        // this is to throw away all validation warnings
+        documentBuilder.setErrorHandler(new org.apache.xml.security.utils.IgnoreAllErrorHandler());
+
+        byte inputBytes[] = input.getBytes();
+        Document doc =
+            documentBuilder.parse(new ByteArrayInputStream(inputBytes));
+
+        // after playing around, we have our document now
+        Canonicalizer c14n = Canonicalizer.getInstance(
+            "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
+        byte outputBytes[] = c14n.canonicalizeSubtree(doc);
+
+        System.out.println(new String(outputBytes));
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/canonicalization/CanonSubTree.java b/samples/org/apache/xml/security/samples/canonicalization/CanonSubTree.java
new file mode 100644
index 0000000..498fea8
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/canonicalization/CanonSubTree.java
@@ -0,0 +1,104 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.canonicalization;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.apache.xml.security.samples.DSNamespaceContext;
+import org.apache.xml.security.samples.SampleUtils;
+import org.apache.xml.security.utils.Constants;
+import org.apache.xml.security.utils.XMLUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ *
+ * @author Christian Geuer-Pollmann
+ */
+public class CanonSubTree {
+    static String input = ""
+        + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+        + "<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\n"
+        + "  <SignedInfo><!-- comment inside -->\n"
+        + "    <CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" />\n"
+        + "    <SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\" />\n"
+        + "    <Reference URI=\"http://www.w3.org/TR/xml-stylesheet\">\n"
+        + "      <DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" />\n"
+        + "      <DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>\n"
+        + "    </Reference>\n"
+        + "  </SignedInfo>\n"
+        + "  <SignatureValue>\n"
+        + "    fKMmy9GYF2s8rLFrZdVugTOFuWx19ccX7jh5HqFd4vMOY7LWAj52ykjSdvtW3fNY\n"
+        + "    PPYGC4MFL19oPSId5GEsMtFMpGXB3XaCtoKjMCHQsN3+kom8YnGf7Ge1JNRcGty5\n"
+        + "    0UsoP6Asj47+QR7QECT64uoziha4WRDVyXjDrg24W+U=\n"
+        + "  </SignatureValue>\n"
+        + "  <KeyInfo>\n"
+        + "    <KeyName>Lugh</KeyName>\n"
+        + "  </KeyInfo>\n"
+        + "</Signature>\n"
+        ;
+
+    /**
+     * Method main
+     *
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String args[]) throws Exception {
+        org.apache.xml.security.Init.init();
+
+        DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
+
+        dfactory.setNamespaceAware(true);
+        dfactory.setValidating(true);
+
+        DocumentBuilder documentBuilder = dfactory.newDocumentBuilder();
+
+        // this is to throw away all validation warnings
+        documentBuilder.setErrorHandler(new org.apache.xml.security.utils.IgnoreAllErrorHandler());
+
+        byte inputBytes[] = input.getBytes();
+        Document doc =
+            documentBuilder.parse(new ByteArrayInputStream(inputBytes));
+        Canonicalizer c14n =
+            Canonicalizer
+            .getInstance("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
+
+        XPathFactory xpf = XPathFactory.newInstance();
+        XPath xpath = xpf.newXPath();
+        xpath.setNamespaceContext(new DSNamespaceContext());
+
+        String expression = "//ds:SignedInfo[1]";
+        Element signedInfo =
+            (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);
+        byte outputBytes[] = c14n.canonicalizeSubtree(signedInfo);
+
+        if (outputBytes != null) {
+            System.out.println(new String(outputBytes));
+        }
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/encryption/Decrypter.java b/samples/org/apache/xml/security/samples/encryption/Decrypter.java
new file mode 100755
index 0000000..262e264
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/encryption/Decrypter.java
@@ -0,0 +1,139 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.encryption;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import java.security.Key;
+
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESedeKeySpec;
+
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.utils.JavaUtils;
+import org.apache.xml.security.utils.EncryptionConstants;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.OutputKeys;
+
+/**
+ * This sample demonstrates how to decrypt data inside an xml document.
+ *
+ * @author Vishal Mahajan (Sun Microsystems)
+ */
+public class Decrypter {
+
+    static org.slf4j.Logger log =
+        org.slf4j.LoggerFactory.getLogger(
+            Decrypter.class.getName());
+
+    static {
+        org.apache.xml.security.Init.init();
+    }
+
+    private static Document loadEncryptionDocument() throws Exception {
+        String fileName = "build/encryptedInfo.xml";
+        File encryptionFile = new File(fileName);
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        Document document = db.parse(encryptionFile);
+        System.out.println(
+            "Encryption document loaded from " + encryptionFile.toURI().toURL().toString()
+        );
+        return document;
+    }
+
+    private static SecretKey loadKeyEncryptionKey() throws Exception {
+        String fileName = "build/kek";
+        String jceAlgorithmName = "DESede";
+
+        File kekFile = new File(fileName);
+
+        DESedeKeySpec keySpec =
+            new DESedeKeySpec(JavaUtils.getBytesFromFile(fileName));
+        SecretKeyFactory skf =
+             SecretKeyFactory.getInstance(jceAlgorithmName);
+        SecretKey key = skf.generateSecret(keySpec);
+
+        System.out.println(
+            "Key encryption key loaded from " + kekFile.toURI().toURL().toString()
+        );
+        return key;
+    }
+
+    private static void outputDocToFile(Document doc, String fileName) throws Exception {
+        File encryptionFile = new File(fileName);
+        FileOutputStream f = new FileOutputStream(encryptionFile);
+
+        TransformerFactory factory = TransformerFactory.newInstance();
+        Transformer transformer = factory.newTransformer();
+        transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+        DOMSource source = new DOMSource(doc);
+        StreamResult result = new StreamResult(f);
+        transformer.transform(source, result);
+
+        f.close();
+        System.out.println(
+            "Wrote document containing decrypted data to " + encryptionFile.toURI().toURL().toString()
+        );
+    }
+
+    public static void main(String unused[]) throws Exception {
+        Document document = loadEncryptionDocument();
+
+        Element encryptedDataElement =
+            (Element) document.getElementsByTagNameNS(
+                EncryptionConstants.EncryptionSpecNS,
+                EncryptionConstants._TAG_ENCRYPTEDDATA).item(0);
+
+        /*
+         * Load the key to be used for decrypting the xml data
+         * encryption key.
+         */
+        Key kek = loadKeyEncryptionKey();
+
+        String providerName = "BC";
+
+        XMLCipher xmlCipher =
+            XMLCipher.getInstance();
+        /*
+         * The key to be used for decrypting xml data would be obtained
+         * from the keyinfo of the EncrypteData using the kek.
+         */
+        xmlCipher.init(XMLCipher.DECRYPT_MODE, null);
+        xmlCipher.setKEK(kek);
+        /*
+         * The following doFinal call replaces the encrypted data with
+         * decrypted contents in the document.
+         */
+        xmlCipher.doFinal(document, encryptedDataElement);
+
+        outputDocToFile(document, "build/decryptedInfo.xml");
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/encryption/Encrypter.java b/samples/org/apache/xml/security/samples/encryption/Encrypter.java
new file mode 100755
index 0000000..893d32d
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/encryption/Encrypter.java
@@ -0,0 +1,193 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.encryption;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import java.security.Key;
+
+import javax.crypto.SecretKey;
+import javax.crypto.KeyGenerator;
+
+import org.apache.xml.security.keys.KeyInfo;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.EncryptedData;
+import org.apache.xml.security.encryption.EncryptedKey;
+import org.apache.xml.security.utils.Constants;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.OutputKeys;
+
+/**
+ * This sample demonstrates how to encrypt data inside an xml document.
+ *
+ * @author Vishal Mahajan (Sun Microsystems)
+ */
+public class Encrypter {
+
+    static org.slf4j.Logger log =
+        org.slf4j.LoggerFactory.getLogger(
+            Encrypter.class.getName());
+
+    static {
+        org.apache.xml.security.Init.init();
+    }
+
+    private static Document createSampleDocument() throws Exception {
+
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        Document document = db.newDocument();
+
+        /**
+         * Build a sample document. It will look something like:
+         *
+         * <apache:RootElement xmlns:apache="http://www.apache.org/ns/#app1">
+         * <apache:foo>Some simple text</apache:foo>
+         * </apache:RootElement>
+         */
+        Element root =
+            document.createElementNS("http://www.apache.org/ns/#app1", "apache:RootElement");
+        root.setAttributeNS(
+            Constants.NamespaceSpecNS, "xmlns:apache", "http://www.apache.org/ns/#app1"
+        );
+        document.appendChild(root);
+
+        root.appendChild(document.createTextNode("\n"));
+
+        Element childElement =
+            document.createElementNS("http://www.apache.org/ns/#app1", "apache:foo");
+        childElement.appendChild(
+            document.createTextNode("Some simple text"));
+        root.appendChild(childElement);
+
+        root.appendChild(document.createTextNode("\n"));
+
+        return document;
+    }
+
+    private static SecretKey GenerateAndStoreKeyEncryptionKey() throws Exception {
+        String jceAlgorithmName = "DESede";
+        KeyGenerator keyGenerator =
+            KeyGenerator.getInstance(jceAlgorithmName);
+        SecretKey kek = keyGenerator.generateKey();
+
+        byte[] keyBytes = kek.getEncoded();
+        File kekFile = new File("build/kek");
+        FileOutputStream f = new FileOutputStream(kekFile);
+        f.write(keyBytes);
+        f.close();
+        System.out.println("Key encryption key stored in " + kekFile.toURI().toURL().toString());
+
+        return kek;
+    }
+
+    private static SecretKey GenerateDataEncryptionKey() throws Exception {
+        String jceAlgorithmName = "AES";
+        KeyGenerator keyGenerator =
+            KeyGenerator.getInstance(jceAlgorithmName);
+        keyGenerator.init(128);
+        return keyGenerator.generateKey();
+    }
+
+    private static void outputDocToFile(Document doc, String fileName) throws Exception {
+        File encryptionFile = new File(fileName);
+        FileOutputStream f = new FileOutputStream(encryptionFile);
+
+        TransformerFactory factory = TransformerFactory.newInstance();
+        Transformer transformer = factory.newTransformer();
+        transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+        DOMSource source = new DOMSource(doc);
+        StreamResult result = new StreamResult(f);
+        transformer.transform(source, result);
+
+        f.close();
+        System.out.println(
+            "Wrote document containing encrypted data to " + encryptionFile.toURI().toURL().toString()
+        );
+    }
+
+    public static void main(String unused[]) throws Exception {
+
+        Document document = createSampleDocument();
+
+        /*
+         * Get a key to be used for encrypting the element.
+         * Here we are generating an AES key.
+         */
+        Key symmetricKey = GenerateDataEncryptionKey();
+
+        /*
+         * Get a key to be used for encrypting the symmetric key.
+         * Here we are generating a DESede key.
+         */
+        Key kek = GenerateAndStoreKeyEncryptionKey();
+
+        String algorithmURI = XMLCipher.TRIPLEDES_KeyWrap;
+
+        XMLCipher keyCipher =
+            XMLCipher.getInstance(algorithmURI);
+        keyCipher.init(XMLCipher.WRAP_MODE, kek);
+        EncryptedKey encryptedKey =
+            keyCipher.encryptKey(document, symmetricKey);
+
+        /*
+         * Let us encrypt the contents of the document element.
+         */
+        Element rootElement = document.getDocumentElement();
+
+        algorithmURI = XMLCipher.AES_128;
+
+        XMLCipher xmlCipher =
+            XMLCipher.getInstance(algorithmURI);
+        xmlCipher.init(XMLCipher.ENCRYPT_MODE, symmetricKey);
+
+        /*
+         * Setting keyinfo inside the encrypted data being prepared.
+         */
+        EncryptedData encryptedData = xmlCipher.getEncryptedData();
+        KeyInfo keyInfo = new KeyInfo(document);
+        keyInfo.add(encryptedKey);
+        encryptedData.setKeyInfo(keyInfo);
+
+        /*
+         * doFinal -
+         * "true" below indicates that we want to encrypt element's content
+         * and not the element itself. Also, the doFinal method would
+         * modify the document by replacing the EncrypteData element
+         * for the data to be encrypted.
+         */
+        xmlCipher.doFinal(document, rootElement, true);
+
+        /*
+         * Output the document containing the encrypted information into
+         * a file.
+         */
+        outputDocToFile(document, "build/encryptedInfo.xml");
+    }
+}
diff --git a/samples/org/apache/xml/security/samples/iaik/IAIKInterOp.java b/samples/org/apache/xml/security/samples/iaik/IAIKInterOp.java
new file mode 100644
index 0000000..c1e6ad3
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/iaik/IAIKInterOp.java
@@ -0,0 +1,206 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.iaik;
+
+import java.io.File;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.xml.security.keys.KeyInfo;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.samples.DSNamespaceContext;
+import org.apache.xml.security.samples.SampleUtils;
+import org.apache.xml.security.utils.Constants;
+import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.apache.xml.security.utils.resolver.implementations.ResolverAnonymous;
+import org.w3c.dom.Element;
+
+/**
+ * @author $Author$
+ */
+public class IAIKInterOp {
+
+    static org.slf4j.Logger log =
+        org.slf4j.LoggerFactory.getLogger(IAIKInterOp.class);
+
+    /** Field schemaValidate */
+    static final boolean schemaValidate = false;
+
+    /** Field signatureSchemaFile */
+    static final String signatureSchemaFile = "samples/data/xmldsig-core-schema.xsd";
+
+    static {
+        org.apache.xml.security.Init.init();
+    }
+
+    /**
+     * Method main
+     *
+     * @param unused
+     */
+    public static void main(String unused[]) {
+
+        if (schemaValidate) {
+            System.out.println("We do schema-validation");
+        } else {
+            System.out.println("We do not schema-validation");
+        }
+
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+        if (IAIKInterOp.schemaValidate) {
+            dbf.setAttribute("http://apache.org/xml/features/validation/schema", Boolean.TRUE);
+            dbf.setAttribute("http://apache.org/xml/features/dom/defer-node-expansion", Boolean.TRUE);
+            dbf.setValidating(true);
+            dbf.setAttribute("http://xml.org/sax/features/validation", Boolean.TRUE);
+            dbf.setAttribute("http://apache.org/xml/properties/schema/external-schemaLocation",
+                             Constants.SignatureSpecNS + " " + IAIKInterOp.signatureSchemaFile);
+        }
+
+        dbf.setNamespaceAware(true);
+        dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE);
+
+        String gregorsDir = "samples/data/at/iaik/ixsil/";
+        String filenames[] = {
+                              gregorsDir + "signatureAlgorithms/signatures/hMACSignature.xml"
+                              ,gregorsDir + "signatureAlgorithms/signatures/hMACShortSignature.xml"
+                              ,gregorsDir + "signatureAlgorithms/signatures/dSASignature.xml"
+                              ,gregorsDir + "signatureAlgorithms/signatures/rSASignature.xml"
+                              ,gregorsDir + "transforms/signatures/base64DecodeSignature.xml"
+                              ,gregorsDir + "transforms/signatures/c14nSignature.xml"
+                              ,gregorsDir + "coreFeatures/signatures/manifestSignature.xml"
+                              ,gregorsDir + "transforms/signatures/xPathSignature.xml"
+                              ,gregorsDir + "coreFeatures/signatures/signatureTypesSignature.xml"
+                              ,gregorsDir + "transforms/signatures/envelopedSignatureSignature.xml"
+        };
+        verifyAnonymous(gregorsDir, dbf);
+
+        for (int i = 0; i < 2; i++) {
+            String signatureFileName = filenames[i];
+
+            try {
+                org.apache.xml.security.samples.signature
+                .VerifyMerlinsExamplesFifteen.verifyHMAC(dbf, signatureFileName);
+            } catch (Exception ex) {
+                System.out.println("The XML signature in file "
+                                   + signatureFileName + " crashed the application (bad)");
+                ex.printStackTrace();
+                System.out.println();
+            }
+        }
+
+        for (int i = 2; i < filenames.length; i++) {
+            String signatureFileName = filenames[i];
+
+            try {
+                org.apache.xml.security.samples.signature
+                .VerifyMerlinsExamplesSixteen.verify(dbf, signatureFileName);
+            } catch (Exception ex) {
+                System.out.println("The XML signature in file "
+                                   + signatureFileName + " crashed the application (bad)");
+                ex.printStackTrace();
+                System.out.println();
+            }
+        }
+
+        for (int i = 2; i < filenames.length; i++) {
+            String signatureFileName = filenames[i];
+
+            try {
+                org.apache.xml.security.samples.signature
+                .VerifyMerlinsExamplesTwentyThree.verify(dbf, signatureFileName);
+            } catch (Exception ex) {
+                System.out.println("The XML signature in file "
+                                   + signatureFileName + " crashed the application (bad)");
+                ex.printStackTrace();
+                System.out.println();
+            }
+        }
+    }
+
+    public static void verifyAnonymous(String gregorsDir, DocumentBuilderFactory dbf) {
+        String filename =
+            gregorsDir + "coreFeatures/signatures/anonymousReferenceSignature.xml";
+        try {
+            String anonymousRef =
+                gregorsDir + "coreFeatures/samples/anonymousReferenceContent.xml";
+            ResourceResolverSpi resolver = new ResolverAnonymous(anonymousRef);
+            File f = new File(filename);
+
+            System.out.println("Try to verify " + f.toURI().toURL().toString());
+
+            javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+            org.w3c.dom.Document doc = db.parse(new java.io.FileInputStream(f));
+
+            XPathFactory xpf = XPathFactory.newInstance();
+            XPath xpath = xpf.newXPath();
+            xpath.setNamespaceContext(new DSNamespaceContext());
+
+            String expression = "//ds:Signature[1]";
+            Element sigElement =
+                (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);
+
+            XMLSignature signature = new XMLSignature(sigElement, f.toURI().toURL().toString());
+
+            signature.setFollowNestedManifests(false);
+            signature.addResourceResolver(resolver);
+
+            KeyInfo ki = signature.getKeyInfo();
+
+            if (ki != null) {
+                X509Certificate cert = signature.getKeyInfo().getX509Certificate();
+
+                if (cert != null) {
+                    System.out.println(
+                        "The XML signature in file " + f.toURI().toURL().toString() + " is "
+                        + (signature.checkSignatureValue(cert) ? "valid (good)"
+                        : "invalid !!!!! (bad)")
+                    );
+                } else {
+                    PublicKey pk = signature.getKeyInfo().getPublicKey();
+
+                    if (pk != null) {
+                        System.out.println(
+                            "The XML signature in file " + f.toURI().toURL().toString() + " is "
+                            + (signature.checkSignatureValue(pk) ? "valid (good)"
+                            : "invalid !!!!! (bad)")
+                        );
+                    } else {
+                        System.out.println("Did not find a public key, so I can't check the signature");
+                    }
+                }
+            } else {
+                System.out.println("Did not find a KeyInfo");
+            }
+        } catch (Exception ex) {
+            System.out.println("The XML signature in file "
+                               + filename + " crashed the application (bad)");
+            ex.printStackTrace();
+            System.out.println();
+        }
+    }
+
+}
diff --git a/samples/org/apache/xml/security/samples/keys/CreateKeyInfo.java b/samples/org/apache/xml/security/samples/keys/CreateKeyInfo.java
new file mode 100644
index 0000000..f295a0f
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/keys/CreateKeyInfo.java
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.keys;
+
+import java.io.FileInputStream;
+import java.math.BigInteger;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+
+import org.apache.xml.security.keys.KeyInfo;
+import org.apache.xml.security.keys.content.X509Data;
+import org.apache.xml.security.keys.content.keyvalues.RSAKeyValue;
+import org.apache.xml.security.utils.XMLUtils;
+
+/**
+ * Class CreateKeyInfo
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public class CreateKeyInfo {
+
+    /**
+     * Method main
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void main(String unused[]) throws Exception {
+
+        KeyStore ks = KeyStore.getInstance("JKS");
+        FileInputStream fis = new FileInputStream(
+            "samples/data/keystore.jks");
+
+        ks.load(fis, "xmlsecurity".toCharArray());
+
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+        dbf.setNamespaceAware(true);
+
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        org.w3c.dom.Document doc = db.newDocument();
+        KeyInfo ki = new KeyInfo(doc);
+
+        doc.appendChild(ki.getElement());
+        ki.setId("myKI");
+        ki.addKeyName("A simple key");
+
+        X509Certificate cert = (X509Certificate) ks.getCertificate("test");
+
+        ki.addKeyValue(cert.getPublicKey());
+
+        X509Data x509Data = new X509Data(doc);
+
+        ki.add(x509Data);
+        x509Data.addCertificate(cert);
+        x509Data.addSubjectName("Subject name");
+        x509Data.addIssuerSerial("Subject nfsdfhs", 6786);
+        ki.add(new RSAKeyValue(doc, new BigInteger("678"), new BigInteger("6870")));
+        XMLUtils.outputDOMc14nWithComments(doc, System.out);
+    }
+
+}
diff --git a/samples/org/apache/xml/security/samples/signature/CreateCollectableSignature.java b/samples/org/apache/xml/security/samples/signature/CreateCollectableSignature.java
new file mode 100644
index 0000000..f160771
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/signature/CreateCollectableSignature.java
@@ -0,0 +1,150 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.signature;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import org.apache.xml.security.keys.content.KeyName;
+import org.apache.xml.security.signature.SignedInfo;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.transforms.Transforms;
+import org.apache.xml.security.transforms.params.XPathContainer;
+import org.apache.xml.security.utils.Constants;
+import org.apache.xml.security.utils.XMLUtils;
+import org.w3c.dom.Element;
+
+/**
+ * These ones can be used to create Signatures which can be collected
+ * using your text editors cut-and-paste feature to create a file wich
+ * contains multiple signatures which remain valid after cut-and-paste.
+ *
+ * This program creates a Signature which can be used for cut-and-paste to be
+ * put into a larger document.
+ *
+ * @author $Author$
+ */
+public class CreateCollectableSignature {
+
+    static org.slf4j.Logger log =
+        org.slf4j.LoggerFactory.getLogger(CreateCollectableSignature.class);
+
+    /** Field passphrase */
+    public static final String passphrase =
+        "The super-mega-secret public static passphrase";
+
+    static {
+        org.apache.xml.security.Init.init();
+
+        // org.apache.xml.security.utils.Constants.setSignatureSpecNSprefix("");
+    }
+
+    /**
+     * Method main
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void main(String unused[]) throws Exception {
+        File signatureFile = new File("build/collectableSignature.xml");
+        String BaseURI = signatureFile.toURI().toURL().toString();
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+        dbf.setNamespaceAware(true);
+
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        org.w3c.dom.Document doc = db.newDocument();
+        Element rootElement = doc.createElementNS(null, "root");
+
+        doc.appendChild(rootElement);
+
+        Element signedResourceElement = doc.createElementNS(null, "signedContent");
+
+        signedResourceElement.appendChild(doc.createTextNode("Signed Text\n"));
+        rootElement.appendChild(signedResourceElement);
+
+        XMLSignature sig =
+            new XMLSignature(doc, BaseURI, XMLSignature.ALGO_ID_MAC_HMAC_SHA1);
+
+        signedResourceElement.appendChild(sig.getElement());
+
+        {
+            String rootnamespace = signedResourceElement.getNamespaceURI();
+            boolean rootprefixed = (rootnamespace != null) && (rootnamespace.length() > 0);
+            String rootlocalname = signedResourceElement.getNodeName();
+            Transforms transforms = new Transforms(doc);
+            XPathContainer xpath = new XPathContainer(doc);
+
+            xpath.setXPathNamespaceContext("ds", Constants.SignatureSpecNS);
+
+            if (rootprefixed) {
+                xpath.setXPathNamespaceContext("root", rootnamespace);
+            }
+
+            String xpathStr = "\n"
+                + "count(                                                                 " + "\n"
+                + " ancestor-or-self::" + (rootprefixed ? "root:" : "") + rootlocalname + "" + "\n"
+                + " |                                                                     " + "\n"
+                + " here()/ancestor::" + (rootprefixed ? "root:" : "") + rootlocalname + "[1] " + "\n"
+                + ") <= count(                                                             " + "\n"
+                + " ancestor-or-self::" + (rootprefixed ? "root:" : "") + rootlocalname + "" + "\n"
+                + ")                                                                      " + "\n"
+                + " and                                                                   " + "\n"
+                + "count(                                                                 " + "\n"
+                + " ancestor-or-self::ds:Signature                                        " + "\n"
+                + " |                                                                     " + "\n"
+                + " here()/ancestor::ds:Signature[1]                                      " + "\n"
+                + ") > count(                                                             " + "\n"
+                + " ancestor-or-self::ds:Signature                                        " + "\n"
+                + ")                                                                      " + "\n"
+
+
+
+                ;
+            xpath.setXPath(xpathStr);
+            transforms.addTransform(Transforms.TRANSFORM_XPATH,
+                                    xpath.getElementPlusReturns());
+            sig.addDocument("", transforms, Constants.ALGO_ID_DIGEST_SHA1);
+        }
+
+        {
+            sig.getKeyInfo().add(new KeyName(doc, CreateCollectableSignature.passphrase));
+            System.out.println("Start signing");
+            sig.sign(sig.createSecretKey(CreateCollectableSignature.passphrase.getBytes()));
+            System.out.println("Finished signing");
+        }
+
+        FileOutputStream f = new FileOutputStream(signatureFile);
+
+        XMLUtils.outputDOMc14nWithComments(doc, f);
+        f.close();
+        System.out.println("Wrote signature to " + BaseURI);
+
+        SignedInfo s = sig.getSignedInfo();
+
+        for (int i = 0; i < s.getSignedContentLength(); i++) {
+            System.out.println("################ Signed Resource " + i
+                               + " ################");
+            System.out.println(new String(s.getSignedContentItem(i)));
+            System.out.println();
+        }
+    }
+
+}
diff --git a/samples/org/apache/xml/security/samples/signature/CreateEnvelopingSignature.java b/samples/org/apache/xml/security/samples/signature/CreateEnvelopingSignature.java
new file mode 100644
index 0000000..ab15d71
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/signature/CreateEnvelopingSignature.java
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.signature;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import org.apache.xml.security.signature.ObjectContainer;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.transforms.Transforms;
+import org.apache.xml.security.utils.Constants;
+import org.apache.xml.security.utils.XMLUtils;
+import org.w3c.dom.Element;
+
+/**
+ * @author $Author$
+ */
+public class CreateEnvelopingSignature {
+
+    static org.slf4j.Logger log =
+        org.slf4j.LoggerFactory.getLogger(CreateSignature.class);
+
+    static {
+        org.apache.xml.security.Init.init();
+    }
+
+    /**
+     * Method main
+     *
+     * @param unused
+     * @throws Exception
+     */
+    public static void main(String unused[]) throws Exception {
+        String keystoreType = "JKS";
+        String keystoreFile = "samples/data/keystore.jks";
+        String keystorePass = "xmlsecurity";
+        String privateKeyAlias = "test";
+        String privateKeyPass = "xmlsecurity";
+        String certificateAlias = "test";
+        File signatureFile = new File("build/signature.xml");
+
+        KeyStore ks = KeyStore.getInstance(keystoreType);
+        FileInputStream fis = new FileInputStream(keystoreFile);
+
+        ks.load(fis, keystorePass.toCharArray());
+
+        PrivateKey privateKey =
+            (PrivateKey) ks.getKey(privateKeyAlias, privateKeyPass.toCharArray());
+        javax.xml.parsers.DocumentBuilderFactory dbf =
+            javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+        dbf.setNamespaceAware(true);
+
+        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
+        org.w3c.dom.Document doc = db.newDocument();
+        String BaseURI = signatureFile.toURI().toURL().toString();
+        XMLSignature sig =
+            new XMLSignature(doc, BaseURI, XMLSignature.ALGO_ID_SIGNATURE_DSA);
+
+        doc.appendChild(sig.getElement());
+
+        {
+            ObjectContainer obj = new ObjectContainer(doc);
+            Element anElement = doc.createElementNS(null, "InsideObject");
+
+            anElement.appendChild(doc.createTextNode("A text in a box"));
+            obj.appendChild(anElement);
+
+            String Id = "TheFirstObject";
+
+            obj.setId(Id);
+            sig.appendObject(obj);
+
+            Transforms transforms = new Transforms(doc);
+
+            transforms.addTransform(Transforms.TRANSFORM_C14N_WITH_COMMENTS);
+            sig.addDocument("#" + Id, transforms, Constants.ALGO_ID_DIGEST_SHA1);
+        }
+
+        {
+            X509Certificate cert =
+                (X509Certificate) ks.getCertificate(certificateAlias);
+
+            sig.addKeyInfo(cert);
+            sig.addKeyInfo(cert.getPublicKey());
+            System.out.println("Start signing");
+            sig.sign(privateKey);
+            System.out.println("Finished signing");
+        }
+
+        FileOutputStream f = new FileOutputStream(signatureFile);
+
+        XMLUtils.outputDOMc14nWithComments(doc, f);
+        f.close();
+        System.out.println("Wrote signature to " + BaseURI);
+
+        for (int i = 0; i < sig.getSignedInfo().getSignedContentLength(); i++) {
+            System.out.println("--- Signed Content follows ---");
+            System.out.println(new String(sig.getSignedInfo().getSignedContentItem(i)));
+        }
+    }
+
+}
diff --git a/samples/org/apache/xml/security/samples/signature/CreateMerlinsExampleSixteen.java b/samples/org/apache/xml/security/samples/signature/CreateMerlinsExampleSixteen.java
new file mode 100644
index 0000000..e4132e5
--- /dev/null
+++ b/samples/org/apache/xml/security/samples/signature/CreateMerlinsExampleSixteen.java
@@ -0,0 +1,479 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.samples.signature;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import org.apache.xml.security.keys.content.RetrievalMethod;
+import org.apache.xml.security.keys.content.X509Data;
+import org.apache.xml.security.keys.content.x509.XMLX509Certificate;
+import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial;
+import org.apache.xml.security.keys.content.x509.XMLX509SubjectName;
+import org.apache.xml.security.samples.utils.resolver.OfflineResolver;
+import org.apache.xml.security.signature.Manifest;
+import org.apache.xml.security.signature.ObjectContainer;
+import org.apache.xml.security.signature.Reference;
+import org.apache.xml.security.signature.SignatureProperties;
+import org.apache.xml.security.signature.SignatureProperty;
+import org.apache.xml.security.signature.SignedInfo;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.transforms.Transforms;
+import org.apache.xml.security.transforms.params.XPathContainer;
+impor