Hi,
 
I'm interested in doing a profile of the XML Signatures schema. I.e. I want do do a restriction of the XML Signature schema.
 
However while doing this I have bumbed into a few problems.
 
At first I got an error saying:
[Error] General Schema Error: Grammar with uri: http://www.w3.org/2001/XMLSchema
 , can not be found; schema namespace may be wrong:  Xerces supports schemas fro
m the "http://www.w3.org/2001/XMLSchema" namespace or the instance document's na
mespace may not match the targetNamespace of the schema.
 
I found some info about this and solved this problem by adding the following to my schema:
<!DOCTYPE xsd:schema [
<!ENTITY % schemaAttrs 'xsi:schemaLocation CDATA #IMPLIED xmlns:xsi CDATA #IMPLIED'>
]>
 
This enables me to point to where the XMLSchema is at. Now I bump into another problem that I have not solved yet, and I'm not sure what causes it.
 
[Error] test.xsd:13:44  Schema error: prefix : [xml] cannot be resolved to a URI
 
Below is my schema, any suggestions?
 
Thanks,
 
/Peter
 
---------------------------------------
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE xsd:schema [
<!ENTITY % schemaAttrs 'xsi:schemaLocation CDATA #IMPLIED xmlns:xsi CDATA #IMPLIED'>
]>
 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
  http://www.w3.org/2001/XMLSchema.xsd"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:test="http://www.w3.org/test"   
  targetNamespace="http://www.w3.org/test">
 
 <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" />
 
 <xsd:element name="foo" type="test:bar" />
 <xsd:complexType name="bar">
  <xsd:complexContent>
   <xsd:restriction base="ds:Signature">
    <xsd:sequence>
     <xsd:element ref="ds:SignedInfo" />
     <xsd:element ref="ds:SignatureValue" />
     <xsd:element ref="ds:KeyInfo" />
    </xsd:sequence>
   </xsd:restriction>
  </xsd:complexContent>
 </xsd:complexType>
 
</xsd:schema>
 
 

Reply via email to