Thank you for your reply,
at the top of the xml-instance document i have this code
<xbrli:xbrl xmlns:xbrli="ht tp://www.xbrl.org/2003/instance"
xmlns:link="htt p://www.xbrl.org/2003/linkbase"
xmlns:xlink="ht tp://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 XmlNamespaceMan ager = New XmlNamespaceMan ager(reader.Nam eTable)
manager.AddName space("d-mr",
"http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-mr-2006-07-01")
manager.AddName space("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 XmlSchemaValida tor = New
XmlSchemaValida tor(reader.Name Table, sc, manager, settings.Valida tionFlags)
The problem is now that even though that there is not a
d-mr:NotaValidVar iable 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 XmlSchemaValida tor [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****@discuss ions.microsoft. comwrote in message
news:9F******** *************** ***********@mic rosoft.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:typedMe mber dimension="d-ty:NationalMark etDimension">
<d-ty:NationalMark et>base metals</d-ty:NationalMark et>
</xbrldi:typedMem ber>
In this case, the attribute name is "dimension" and
the attribute value is "d-ty:NationalMark etDimension".
The problem is that "dimension" variable is in one namespace, and
"d-ty:NationalMark etDimension" is in another namespace. i execute the
following code:
validator.Valid ateAttribute(re ader.name, reader.Namespac eURI,
reader.valueval ue, schemainfo)
It validates the name "dimension" correctly with the correct namespace,
however, the value "d-ty:NationalMark etDimension" 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:NationalMark etDimension' is invalid according to its datatype
'http://www.w3.org/2001/XMLSchema:QName ' - 'd-ty' is an undeclared
namespace.
Can anyone help ?
Thank you