Click here to Skip to main content
       

C#

 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable PinmemberASPnoob8-Feb-13 11:06 
QuestionAndroid & .NET Pinmemberthebakkal7-Feb-13 14:39 
AnswerRe: Android & .NET PinmentorKeith Barrow7-Feb-13 23:21 
QuestionAndroid & .NET Pinmemberthebakkal7-Feb-13 14:37 
AnswerRe: Android & .NET Pinmemberjibesh7-Feb-13 14:47 
AnswerRe: Android & .NET PinmemberBernhard Hiller7-Feb-13 22:47 
AnswerRe: Android & .NET PinprotectorPete O'Hanlon7-Feb-13 22:59 
JokeRe: Android & .NET PinmentorWayne Gaylard7-Feb-13 23:24 
QuestionChech if a graph is connected Pinmemberbrkonja7-Feb-13 10:27 
AnswerRe: Chech if a graph is connected PinmemberSuper Lloyd7-Feb-13 15:03 
QuestionC# debug windows Pinmemberclassy_dog7-Feb-13 9:14 
AnswerRe: C# debug windows Pinmemberjibesh7-Feb-13 13:34 
AnswerRe: C# debug windows PinmvpEddy Vluggen8-Feb-13 0:31 
QuestionXelement headers and schema definition quandry PinmemberDJ 27-Feb-13 4:34 
Source code:
            XElement Listings = new XElement("Listings");
            XNamespace root = "http://website.RFGCommonSpecListingSchema";
            XNamespace xs = "http://www.w3.org/2001/XMLSchema";
            XNamespace b = "http://schemas.microsoft.com/BizTalk/2003";
 
            Listings.Add(new XDeclaration("1.0", "utf-8", null),
               new XElement(xs + "schema",
                  new XAttribute("xmlns", root.NamespaceName),
                  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"),
                  new XAttribute("elementFormDefault", "qualified"),
                  new XAttribute("attributeFormDefault", "unqualified")));
            XElement Listing;
            string command = getQuery();
 
            using (SqlConnection sqlCon = new SqlConnection(connMain))
            {
                sqlCon.Open();
                using (SqlCommand cmd = new SqlCommand(command, sqlCon))
                {
                    
                    using (SqlDataReader Row = cmd.ExecuteReader())
                    {
                        while (Row.Read())
                        {
                            // clearing out the data from pevious MLS
                            featureIN.Clear();
 
                           
#region XML build
                            //starting XML build

                            //Listings.Add(new XDeclaration("1.0", "utf-16", "true"));

                            Listings.Add(Listing = new XElement("Listing"));
                            Listings.Add(
                                new XElement("ListingKey", Row[3].ToString()),
                                new XElement("ListingIdentifier", Row[3].ToString()),
                                new XElement("Type", Row[4].ToString()),
                                new XElement("ProviderName", "CWS"));
 
result:
 
- <Listings>
  <?xml version="1.0" encoding="utf-8"?>
  <xs:schema xmlns="http://website.RFGCommonSpecListingSchema" 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" elementFormDefault="qualified" attributeFormDefault="unqualified" />
  <Listing />
  <ListingKey>1311618</ListingKey>
  <ListingIdentifier>1311618</ListingIdentifier>
  <Type>Residential Sale</Type>
  <ProviderName>CWS</ProviderName>
  <Listing />
  <ListingKey>1715675</ListingKey>
  <ListingIdentifier>1715675</ListingIdentifier>
  <Type>Residential Sale</Type>
  <ProviderName>CWS</ProviderName>
  <Listing />
 
I need the header tags above the 'Listings' tag like this:
 
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://rfg.realogy.com/Btt/Listingfeed/Import/2011/07.RFGCommonSpecListingSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://rfg.realogy.com/Btt/Listingfeed/Import/2011/07.RFGCommonSpecListingSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="Listings">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Listing" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
 

Anyone have a code that would work? Where am I going wrong with this?
AnswerRe: Xelement headers and schema definition quandry PinmemberMatt T Heffron7-Feb-13 8:00 
QuestionReading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pinmemberdevvvy6-Feb-13 22:57 
AnswerRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? PinmemberRichard Deeming7-Feb-13 1:21 
GeneralRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pinmemberdevvvy7-Feb-13 14:22 
AnswerRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? PinmentorDaveyM697-Feb-13 2:42 
AnswerRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? PinmemberPIEBALDconsult7-Feb-13 3:50 
GeneralRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? Pinmemberdevvvy7-Feb-13 22:00 
GeneralRe: Reading Excel (xls+Xlsx) without Excel Interop library or OleDB/Jet? PinmemberPIEBALDconsult8-Feb-13 3:48 
Questiondata source for a chart Pinmembersina rafati nia6-Feb-13 21:26 
AnswerRe: data source for a chart PinmvpAbhinav S6-Feb-13 23:25 
QuestionXelement headers and schema definition help PinmemberDJ 26-Feb-13 12:19 
AnswerRe: Xelement headers and schema definition help Pinmemberjibesh6-Feb-13 12:34 
AnswerRe: Xelement headers and schema definition help PinmemberRichard Deeming7-Feb-13 1:33 
QuestionHow to put videos, with alpha channel, on the image Pinmemberokutan16-Feb-13 7:02 
QuestionCould not evaluate expression PinmemberMichCl6-Feb-13 3:16 
AnswerRe: Could not evaluate expression PinprotectorPete O'Hanlon6-Feb-13 4:00 
GeneralRe: Could not evaluate expression PinmvpDave Kreskowiak6-Feb-13 4:11 
GeneralRe: Could not evaluate expression PinmemberMichCl6-Feb-13 4:12 
GeneralRe: Could not evaluate expression PinprotectorPete O'Hanlon6-Feb-13 4:18 
GeneralRe: Could not evaluate expression PinmemberMichCl6-Feb-13 4:41 
AnswerRe: Could not evaluate expression PinmvpDave Kreskowiak6-Feb-13 4:10 
GeneralRe: Could not evaluate expression PinmemberMichCl6-Feb-13 4:20 
GeneralRe: Could not evaluate expression PinmvpEddy Vluggen6-Feb-13 5:02 
GeneralRe: Could not evaluate expression PinmemberMichCl6-Feb-13 5:30 
GeneralRe: Could not evaluate expression PinmvpDave Kreskowiak6-Feb-13 5:40 
GeneralRe: Could not evaluate expression PinmemberMichCl6-Feb-13 7:30 
GeneralRe: Could not evaluate expression PinprotectorPete O'Hanlon6-Feb-13 5:56 
GeneralRe: Could not evaluate expression PinmemberMichCl6-Feb-13 7:52 
GeneralRe: Could not evaluate expression PinmvpDave Kreskowiak6-Feb-13 12:49 
GeneralRe: Could not evaluate expression PinmemberMichCl7-Feb-13 2:34 
GeneralRe: Could not evaluate expression PinprotectorPete O'Hanlon7-Feb-13 2:48 
GeneralRe: Could not evaluate expression PinmvpDave Kreskowiak7-Feb-13 7:35 
GeneralRe: Could not evaluate expression PinmemberMichCl7-Feb-13 2:32 
GeneralRe: Could not evaluate expression PinprotectorPete O'Hanlon7-Feb-13 2:34 
GeneralRe: Could not evaluate expression PinmemberMichCl7-Feb-13 2:37 
GeneralRe: Could not evaluate expression PinmemberMichCl1-May-13 2:19 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 31 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid