Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
JokeRe: Android & .NET Pin
Wayne Gaylard7-Feb-13 23:24
professionalWayne Gaylard7-Feb-13 23:24 
QuestionChech if a graph is connected Pin
brkonja7-Feb-13 10:27
brkonja7-Feb-13 10:27 
AnswerRe: Chech if a graph is connected Pin
Super Lloyd7-Feb-13 15:03
Super Lloyd7-Feb-13 15:03 
QuestionC# debug windows Pin
classy_dog7-Feb-13 9:14
classy_dog7-Feb-13 9:14 
AnswerRe: C# debug windows Pin
Jibesh7-Feb-13 13:34
professionalJibesh7-Feb-13 13:34 
AnswerRe: C# debug windows Pin
Eddy Vluggen8-Feb-13 0:31
professionalEddy Vluggen8-Feb-13 0:31 
QuestionXelement headers and schema definition quandry Pin
DJ 27-Feb-13 4:34
DJ 27-Feb-13 4:34 
AnswerRe: Xelement headers and schema definition quandry Pin
Matt T Heffron7-Feb-13 8:00
professionalMatt T Heffron7-Feb-13 8:00 
You need a root XDocument to contain the XElement Listings. That is where the declaration and schema tags need to be. And I'd guess that you don't need the schema element, but put the namespace attributes on the Listings (you aren't declaring a schema here, and you can't have two root elements in a valid XML file):
C#
XNamespace root = "http://website.RFGCommonSpecListingSchema";
XNamespace xs = "http://www.w3.org/2001/XMLSchema";
XNamespace b = "http://schemas.microsoft.com/BizTalk/2003";
XElement Listings = new XElement(root + "Listings",
      new XAttribute(XNamespace.Xmlns + "b", b.NamespaceName),
      new XAttribute(XNamespace.Xmlns + "xs", xs.NamespaceName),
      new XAttribute("targetNamespace", "http://rfg.realogy.com/Btt/Listingfeed/Import/2011/07.RFGCommonSpecListingSchema"));
XDocument listingDoc = new XDocument(new XDeclaration("1.0", "utf-8", null), Listings);

XElement Listing;
string command = getQuery();
// ...

This gives the following XML:
XML
<?xml version="1.0" encoding="utf-16"?>
<Listings xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://rfg.realogy.com/Btt/Listingfeed/Import/2011/07.RFGCommonSpecListingSchema" xmlns="http://website.RFGCommonSpecListingSchema" />

The Listing element(s) will be contained in the Listings element (that I've shown as empty).
Be sure when you create the contained XElement(s) that you create them in the same namespace as the Listings element. I.e., new XElement(root + "Listing") or new XElement(root + "ProviderName"), etc.
QuestionReading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
devvvy6-Feb-13 22:57
devvvy6-Feb-13 22:57 
AnswerRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
Richard Deeming7-Feb-13 1:21
mveRichard Deeming7-Feb-13 1:21 
GeneralRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
devvvy7-Feb-13 14:22
devvvy7-Feb-13 14:22 
AnswerRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
DaveyM697-Feb-13 2:42
professionalDaveyM697-Feb-13 2:42 
AnswerRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
PIEBALDconsult7-Feb-13 3:50
mvePIEBALDconsult7-Feb-13 3:50 
GeneralRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
devvvy7-Feb-13 22:00
devvvy7-Feb-13 22:00 
GeneralRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pin
PIEBALDconsult8-Feb-13 3:48
mvePIEBALDconsult8-Feb-13 3:48 
Questiondata source for a chart Pin
sina rafati nia6-Feb-13 21:26
sina rafati nia6-Feb-13 21:26 
AnswerRe: data source for a chart Pin
Abhinav S6-Feb-13 23:25
Abhinav S6-Feb-13 23:25 
QuestionXelement headers and schema definition help Pin
DJ 26-Feb-13 12:19
DJ 26-Feb-13 12:19 
AnswerRe: Xelement headers and schema definition help Pin
Jibesh6-Feb-13 12:34
professionalJibesh6-Feb-13 12:34 
AnswerRe: Xelement headers and schema definition help Pin
Richard Deeming7-Feb-13 1:33
mveRichard Deeming7-Feb-13 1:33 
QuestionHow to put videos, with alpha channel, on the image Pin
okutan16-Feb-13 7:02
okutan16-Feb-13 7:02 
QuestionCould not evaluate expression Pin
MichCl6-Feb-13 3:16
MichCl6-Feb-13 3:16 
AnswerRe: Could not evaluate expression Pin
Pete O'Hanlon6-Feb-13 4:00
mvePete O'Hanlon6-Feb-13 4:00 
GeneralRe: Could not evaluate expression Pin
Dave Kreskowiak6-Feb-13 4:11
mveDave Kreskowiak6-Feb-13 4:11 
GeneralRe: Could not evaluate expression Pin
MichCl6-Feb-13 4:12
MichCl6-Feb-13 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.