Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have to read an xsd for create the xml structure on a dataset.
when I do
Dim Dati_xml As New DataSet
    Dati_xml.ReadXmlSchema("xsdpath")

I get this error
Element 'http://www.w3.org/2000/09/xmldsig#:Signature' is not declared.

Can you help me?
thank you

this is the header of the xsd
XML
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="http://www.fatturapa.gov.it/sdi/fatturapa/v1.1" targetNamespace="http://www.fatturapa.gov.it/sdi/fatturapa/v1.1" version="1.1">
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>




I had understood that this problem is related with the xml signature.
In the xsd i have the element signature that is referenced in another xsd
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemalocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd" xmlns:xs="#unknown">


this is the link of the xsd schema
[^]
any help?
Posted
Updated 11-Aug-15 3:53am
v4
Comments
Maciej Los 10-Aug-15 17:09pm    
This question is not well-formed. Not enough details to provide answer. We need bit more details.
gregorio89 11-Aug-15 5:41am    
what kind of details do you need?
It's exactly what I have to do, with the specific code.
I have to write an xml file, so I decided to using dataset for semplificate the insert of the data in code.
I have the xsd so i wonna to read it with the code above but when I do i get that error.
I think it's a problem with xml library included in a xml file but I'm not sure of it..
Maciej Los 11-Aug-15 5:51am    
For example: complete error message, the content of xsd file, etc.
Library is OK.
[no name] 11-Aug-15 9:59am    

You did not provide enough information to help you. So, we can only refer to similar questions and answers which may help you to find a way to resolve your issue:
Validating Signature element of XML fails against XSD
Validate signed XML with XSD - xmldsig
 
Share this answer
 
Comments
gregorio89 11-Aug-15 6:52am    
it's not good for me. I have improved my question with the xml header.
Maciej Los 11-Aug-15 7:23am    
This is exactly what you want. Please, read related threads carefully. You have to add XmlReaderSetting. That's all.
gregorio89 11-Aug-15 8:16am    
sorry I haven't understood.
Can you post some code?
Maciej Los 11-Aug-15 8:20am    
The code has been provided there. Is there any reason to not use it?
gregorio89 11-Aug-15 8:27am    
§I already said that I haven't understood what do you mean with this articles so,
if you want to help me, please can you post your solution?
because I do not understand the relevance with my problem, so I can't copy and paste without understad what I write.
It's enough?
Not the solution, but a "pragamtic workaround" to proceed work.

I'm far away from be an expert on this, but my inspration told me to remove this "signature things", so I removed the line:
<xs:element ref="ds:Signature" minOccurs="0" />


And see... the DataSet will be created and I can Display the tables.

So at least you can go on with coding and parallel you can search for a clean solution of the above.

I don't know what I'm doing, but I'm doing it good :)
Regards
 
Share this answer
 
v2
Comments
Maciej Los 11-Aug-15 17:34pm    
Philosophical question: if you don't know what are you doing, how can you be sure that you're doing it good?
[no name] 12-Aug-15 3:22am    
I did not wrote "I'm sure" :)
Maciej Los 12-Aug-15 3:30am    
You stated (for sure!) that you're doing it good ;)
As per OP question: removing this node is not proper solution, becuase it makes that xml can't be properly validated.
Cheers, Maciej
[no name] 12-Aug-15 3:34am    
I mentioned that it is only a Workaround, which alows at least to go on with the tables for the moment.
Regards, Bruno
You missed .xsd or.xml extension in the code. It should be like

VB
Dim Dati_xml As DataSet = New DataSet
Dati_xml.ReadXmlSchema("xsdpath.xsd")


for more refer here : https://msdn.microsoft.com/en-us/library/atchhx4f(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1[^]
 
Share this answer
 
Comments
gregorio89 11-Aug-15 5:37am    
No It's not true.
i wrote xsd path and the extension is included in a path.
I think it's a problem with xml library included in a xml file.
sreeyush sudhakaran 11-Aug-15 6:10am    
ok..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900