firepower121
New Member
BackgroundI'm currently part way through my dissertation and am in need of some help with the program I'm writing. A quick insight of what I aim to achieve is a program that can connect to a PostgreSQL database, retrieving the required data, and then using it to create a file that describes how to display the specified data in a GIS suite or WebMapServer (or similar). Now I am quite familiar with C# and have used it for a few years now, however have never really delved in using it to store data in XML or even generally use XML files in my solutions, and therefore haven't had much experience with the XML classes.Now, to quickly point out the SLD (StyledLayerDescriptor) files are just essentially XML documents.ProblemI'm having trouble recreating this using C#. The main problem I've come across is finding out how using the XmlWriter class to recreate the "se:" prefix before every element name without xmlns="..." at the start of each sub-element, but also the long string of namespace declaration at the top, albeit seemingly unused.This is what I am able to produce so far.edit:
I can also produce each sub-element with a prefix and namespace decleration as seen at the top of the document with "StyledLayerDescriptor".I can post up any of my XmlWriter code if needs be, either this is really simple and I'm missing something or quite difficult to recreate because I've been searching for an answer now for a long time. I have read what I think are the relevant chapters of "Beginning XML in C#.Net 2008" and am still struggling to recreate the file.Any help or direction would be much appreciated as its held me up for a while and I'm at a point where I can't really continue programming until I fix now.Also to point out, I feel its much higher priority for me to get the prefix se: before each element although if a parent name is declared se:, in this case "StyledLayerDescriptor" would you need to for its sub-elements - is it unnecessary?CheersEarl
I can also produce each sub-element with a prefix and namespace decleration as seen at the top of the document with "StyledLayerDescriptor".I can post up any of my XmlWriter code if needs be, either this is really simple and I'm missing something or quite difficult to recreate because I've been searching for an answer now for a long time. I have read what I think are the relevant chapters of "Beginning XML in C#.Net 2008" and am still struggling to recreate the file.Any help or direction would be much appreciated as its held me up for a while and I'm at a point where I can't really continue programming until I fix now.Also to point out, I feel its much higher priority for me to get the prefix se: before each element although if a parent name is declared se:, in this case "StyledLayerDescriptor" would you need to for its sub-elements - is it unnecessary?CheersEarl