2) I do get a runtime error when I try to fill the DataSet object by reading in the XML:
{System.Data.DuplicateNameException: A column named 'NAVBARSUBCATS' already belongs to this DataTable: cannot set a nested table name to the same name.
{System.Data.DuplicateNameException: A column named 'NAVBARSUBCATS' already belongs to this DataTable: cannot set a nested table name to the same name. at System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table) at System.Data.DataRelation.set_Nested(Boolean value) at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef) at System.Data.XSDSchema.HandleTable(XmlSchemaElement node) at System.Data.XSDSchema.HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, Boolean isBase) at System.Data.XSDSchema.HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, Boolean isNillable) at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef) at System.Data.XSDSchema.HandleTable(XmlSchemaElement node) at System.Data.XSDSchema.HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, Boolean isBase) at System.Data.XSDSchema.HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, Boolean isNillable) at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef) at System.Data.XSDSchema.HandleTable(XmlSchemaElement node) at System.Data.XSDSchema.HandleDataSet(XmlSchemaElement node, Boolean isNewDataSet) at System.Data.XSDSchema.LoadSchema(XmlSchemaSet schemaSet, DataSet ds) at System.Data.DataSet.InferSchema(XmlDocument xdoc, String[] excludedNamespaces, XmlReadMode mode) at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving) at System.Data.DataSet.ReadXml(TextReader reader) at Campus_Webstore.NSubCatList.BuildCatalog() in C:\KnowltonCWS\CWS\Website\Campus Webstore\UserControls\NSubCatList.ascx.cs:line 131}
3) The use and reuse of <NAVBARSUBCATS> everywhere is on purpose. Can I either get the DataSet to IGNORE or ALLOW the apparent duplicate table names....or is there a more suitable data structure to store the xml in?
2) I see after reformatting that it doesn't have the proper end tag, and I get an error that confirms that:
Expecting end tag </NAVBARSUBCATS>
3) What version of .NET do you have, because there are a lot better ways in 3.5/4 to work with XML, versus using a DataSet, such as LINQ-to-XML, DataContractSerializer, ...
4) XHTML suggests something that I agree with--lowercase
5) You have a format that is confusing, right from the git' go. It is not a good practice to have the same element name for elements lower in the hierarchy.
3) Visual Studio 2010. But I don't get LINQ. To me, LINQ is as difficult to understand as anything preceding it.
4) I'll make the change!
5) I didn't know this was not allowed. I'm open to changing it as long as I can get the results.
6) No problem here, as long as I can get the results I'm desiring!
I like #7 a lot. Let me spend some time with it and see if it will do the trick. As I said, I am attempting to use XML to represent a menu / submenu / sub submenu type structure. Eventually this will be a left hand side navigation bar on a web page.
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
I am not sure what you are showing me, but the text has '-' preceding the node elements. I imagine that this is a paste from Internet Explorer, but I need to check, since they are invalid characters. Usually, when you get any errors with XML, it tells you what line and character position. I would need to know that, in order to help you.
Here are my thoughts:
1) I prefer a formatted layout to visualize XML. It was easy for me to reformat using Visual Studio.NET IDE:
Open in new window
2) I see after reformatting that it doesn't have the proper end tag, and I get an error that confirms that:
Expecting end tag </NAVBARSUBCATS>
3) What version of .NET do you have, because there are a lot better ways in 3.5/4 to work with XML, versus using a DataSet, such as LINQ-to-XML, DataContractSerializer, ...
4) XHTML suggests something that I agree with--lowercase
5) You have a format that is confusing, right from the git' go. It is not a good practice to have the same element name for elements lower in the hierarchy.
<CATALOGS>
<CATALOG catid="" desc="CLOTHING" contentPath="somefolder/so
<NAVBARSUBCATS>
<CATALOG>
6) Use attributes, and self-closing tags to reduce the amount of text.
7) I could imagine something like this:
Open in new window