TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vijay Jadhav
NA
15
0
ASP.NET : Get Attribute Value from XML
May 26 2009 5:43 AM
Hi Experts,
My Xml is :
<?xml version="1.0" encoding="utf-8"?>
<Sis xsi:noNamespaceSchemaLocation="Sis.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Student>
<StudentID>1</StudentID>
<AcademicDetails>2008-2009</AcademicDetails>
<PersonalDetails>
<FirstName>Vijay</FirstName>
<MiddleName>Laxmanrao</MiddleName>
<LastName>Jadhav</LastName>
</PersonalDetails>
</Student>
</Sis>
I need to extract the value of xsi:noNamespaceSchemaLocation (ie. Sis.xsd).
How to get it ?
I have try below snippet, but it will show sXSDFile always null. Why ?
public static bool ValidateXml(Stream oXmlStream)
{
string sXsdPath = "";
string sXSDFile = "";
try
{
XmlTextReader xmlTextReader = new XmlTextReader(oXmlStream);
sXSDFile = xmlTextReader.GetAttribute("xsi:noNamespaceSchemaLocation");
}
catch (Exception ex)
{
_isValied = false;
}
return _isValied;
}
Sample code would be greatly appreciated.
Thanks.
Reply
Answers (
2
)
Saving Image In To SQL
Need a Query