Thank you for your reply,
at the top of the xml-instance document i have this code
<xbrli:xbrl xmlns:xbrli="http://www.xbrl.org/2003/instance"
xmlns:link="http://www.xbrl.org/2003/linkbase"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:t-me="http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/t-me-2006-07-01"
xmlns:d-hh="http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-hh-2006-07-01"
xmlns:d-mr="http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-mr-2006-07-01"
.... and it goes on for some more declarations. So the "d-mr" missing
namespace is declared. And the "d-ty" in the same sense.
I am also using in my code a manager , kind of like a resolver i think,
which resolves the prefixes of the namespaces. The code is below:
Dim manager As XmlNamespaceManager = New XmlNamespaceManager(reader.NameTable)
manager.AddNamespace("d-mr",
"http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-mr-2006-07-01")
manager.AddNamespace("d-ty",
"http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-mr-2006-07-01")
I then pass the manager to the validator :
'sc is the schemaset
Dim validator As XmlSchemaValidator = New
XmlSchemaValidator(reader.NameTable, sc, manager, settings.ValidationFlags)
The problem is now that even though that there is not a
d-mr:NotaValidVariable in the d-mr namespace, the validator resolves the
prefix, and outputs a valid variable. This fails in all the variables that
use a prefix . Variables that do not use a prefix, return an error message ,
either that are missing ot they have type mismatch, which is the desired
result.
Thank you
George
"Zafar Abbas" wrote:
The problem you are seeing is not for validation of the attribute's
namespace. it is becuase you do not have the prefix d-ty mapped to a
namespace-uri. When you construct the XmlSchemaValidator [1], you need to
pass in a Namespace Resolver which maps it to a namespace.
[1]
http://msdn2.microsoft.com/en-us/lib...validator.aspx
"George" <Ge****@discussions.microsoft.comwrote in message
news:9F**********************************@microsof t.com...
I am currently developing an xbrl validation software that takes an xml
instance file and a lot of schemas(xsd files) and validates it against
the
xsd files. I am using Visual basic in visual studio 2005. I have managed
to
cycle through the xml file , validate most of the variables, however, i
have
some problems with the namespaces of some attributes.
For example, in my xml instance file, it says:
<xbrldi:typedMember dimension="d-ty:NationalMarketDimension">
<d-ty:NationalMarket>base metals</d-ty:NationalMarket>
</xbrldi:typedMember>
In this case, the attribute name is "dimension" and
the attribute value is "d-ty:NationalMarketDimension".
The problem is that "dimension" variable is in one namespace, and
"d-ty:NationalMarketDimension" is in another namespace. i execute the
following code:
validator.ValidateAttribute(reader.name, reader.NamespaceURI,
reader.valuevalue, schemainfo)
It validates the name "dimension" correctly with the correct namespace,
however, the value "d-ty:NationalMarketDimension" should be validated
using
the d-ty namespace, which is another x-sd file.
The error i get is :
Error Message:The 'dimension' attribute is invalid - The value
'd-ty:NationalMarketDimension' is invalid according to its datatype
'http://www.w3.org/2001/XMLSchema:QName' - 'd-ty' is an undeclared
namespace.
Can anyone help ?
Thank you