> <Group ID="100">
> <Name>Dotnet XML</Name>
> <Member ID="BA1908">Guru Bhai</Member>
> </Group>
>
> When I validate this xml against a schema using XmlValidatingReader and
> when I get a error in the ID attribute of the Node Group, How can I get
> the Node or _FullName of that attribute.
XmlValidatingReader doesn't expose nodes. And you can get name of the
node it's positioned it via Name property.
> I cannot access _FullName which gives me the node name which is
> "Group", I get this error
Sure. It's private field.
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
for eg.
if this was my XML file
<Books id="ab1"></Books>
and my schema validated this saying the ID is wrong which is a
attribute of BOOKS....... so when I get the error using
XmlValidatingReader, somehow I would like to know that the parent node
is BOOKS, which is stored in _FullName.
Thanks,
Shailendra Batham
This is part of my XML File.
<Group ID="100">
<Name>Dotnet XML</Name>
<Member ID="BA1908">Guru Bhai</Member>
</Group>
When I validate this xml against a schema using XmlValidatingReader and
when I get a error in the ID attribute of the Node Group, How can I get
the Node or _FullName of that attribute.
I cannot access _FullName which gives me the node name which is
"Group", I get this error
'System.Xml.XmlValidatingReader._FullName' is inaccessible due to its
protection level
Is there a way I can get the Node Name to which the attribute belongs
to.
Thanks,
Shailendra Batham
You can also call MoveToElement() when you encounter an error on an
attribute node and then get valReader.Name, but in this case you will have
maintain the postition of the attribute you are processing so that after
getting the element name, you have to reposition yourself on the same
attribute.
Thanks,
Priya
string parentElementName = val
"batham" <bat...@gmail.com> wrote in message
news:1103140937.0...@c13g2000cwb.googlegroups.com...