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
Marco
NA
59
0
descent recursive parser
Sep 22 2009 12:44 PM
Hello,
I must implement a such parser (based on a LL(1) grammar). I did this
try {
// Create the reader.
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreWhitespace = true;
XmlReader reader = XmlReader.Create(new XmlTextReader(filename), settings);
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.Element:
Hashtable attributes = new Hashtable();
string strURI = reader.NamespaceURI;
string strName = reader.Name;
Console.Write(strURI + " " + "<" + strName );
if (reader.HasAttributes) {
for (int i = 0; i < reader.AttributeCount; i++) {
reader.MoveToAttribute(i);
attributes.Add(reader.Name, reader.Value);
Console.Write(" " + reader.Name + "=" + "\"" + reader.Value + "\"");
}
Console.WriteLine(">");
}
else {
Console.WriteLine(">");
}
break;
case XmlNodeType.EndElement:
string strNameEND = reader.Name;
Console.WriteLine("</" + strNameEND + ">");
break;
// Todo
//case XmlNodeType.Text:
// Todo
default:
break;
}
}
Can I say that using SAx I'm doing a recursive descent parser or not?
thanks
Reply
Answers (
3
)
trying to automate a crystyal report with export.
what is the problem event are not adding in eventviewer