Page 1 of 1

Restricting Namespace! Help-me plz!

Posted: Thu May 11, 2006 3:21 pm
by sulley
Hi people!

I'm with a big problem. I have to restrict the namespaces of my schema xsd.

-------
For Example:

In xsd schema there is:
<TestXML xmlns:ds="http://www.w3.org/2000/09/xmldsig#" ...>

I need validate this value with this list:
http://www.test.com/xmldsig#
http://www.aol.com/xmldsig#
--------

This is necessary because when user change the value of xmlns:ds tag, the signature value of my xml is changed. To solve this, I define a list of namespaces and the value informed needs to belong in the list.

Sorry my english, I'm studying.

Thanks!

Luiz - Procergs - Porto Alegre - RS - Brazil

OOOppppssss....

Posted: Thu May 11, 2006 4:15 pm
by sulley
People,

One correction...

I spoke with my partner and We find a error in this post.

I have a tag xmlns:xsi, xmlns:nfe and xmlns:xsi. We don't permit other tag.

If user put xmlns:BR the shema need report a error.

Please, need help!

Thanks.

Posted: Thu May 11, 2006 4:24 pm
by george
XML Schema does not put any constraints on the namespace declarations you may have in an XML document. So for instance if you have a schema that validates:

<test/>

then it will equally validate

<test xmlns:whatever="something"/>

Best Regards,
George

More one question...

Posted: Thu May 11, 2006 4:50 pm
by sulley
Thanks George but I dont understood very well.

Not Is possible validate if user type the tag xmlsns:BR? I don't need validate the value of this tag. Only if it's exists or not.

Tks!

Luiz

Posted: Thu May 11, 2006 4:58 pm
by george
Hi Luiz,

That is not a tag, it is a namespace declaration. XML Schema does not constraint in any way the namespace declarations and what prefixes should be used to express an instance document. For XML Schema there is no difference between the following:

<test xmlns="http://www.example.com/test/">

<test:test xmlns:test="http://www.example.com/test/">

<x:test xmlns:x="http://www.example.com/test/">

Best Regards,
George

Closing this question

Posted: Thu May 11, 2006 5:10 pm
by sulley
Thanks George. Have a nice day.