Click here to Skip to main content
14,634,059 members
Home » Discussions » XML / XSL
   

XML / XSL

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 3:10
cofounderChris Maunder16-Jul-09 3:10 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 3:06
cofounderChris Maunder16-Jul-09 3:06 
QuestionHow to add Key and MergeField dynamically into WordProcessing OpenXML document C# program Pin
Ganapatisb10-Sep-20 22:24
MemberGanapatisb10-Sep-20 22:24 
QuestionComparing two elements in XSLT Pin
Member 148262328-May-20 9:34
MemberMember 148262328-May-20 9:34 
AnswerRe: Comparing two elements in XSLT Pin
Richard Deeming10-May-20 21:58
mveRichard Deeming10-May-20 21:58 
QuestionI don't see WebBrowser?? (webbrowser error) (wpf) Pin
Member 1477397215-Mar-20 21:58
MemberMember 1477397215-Mar-20 21:58 
AnswerRe: I don't see WebBrowser?? (webbrowser error) (wpf) Pin
Richard MacCutchan15-Mar-20 22:56
mveRichard MacCutchan15-Mar-20 22:56 
QuestionSchematron errors with XML Spy update Pin
Member 1459998621-Sep-19 16:33
MemberMember 1459998621-Sep-19 16:33 
AnswerRe: Schematron errors with XML Spy update Pin
Richard Deeming22-Oct-19 0:49
mveRichard Deeming22-Oct-19 0:49 
QuestionXML file read images and display them at random Pin
eatupyourgreens12-Sep-19 9:33
Membereatupyourgreens12-Sep-19 9:33 
AnswerRe: XML file read images and display them at random Pin
Richard MacCutchan12-Sep-19 11:20
mveRichard MacCutchan12-Sep-19 11:20 
GeneralRe: XML file read images and display them at random Pin
eatupyourgreens12-Sep-19 11:27
Membereatupyourgreens12-Sep-19 11:27 
GeneralRe: XML file read images and display them at random Pin
Richard MacCutchan12-Sep-19 11:33
mveRichard MacCutchan12-Sep-19 11:33 
QuestionQuery XML API and display results Pin
hm928-Aug-19 4:37
Memberhm928-Aug-19 4:37 
AnswerRe: Query XML API and display results Pin
Richard MacCutchan28-Aug-19 5:57
mveRichard MacCutchan28-Aug-19 5:57 
QuestionDate conversion failure in xsl file (Chinese characters showing in date field) Pin
AkashBabu25-Feb-19 2:34
MemberAkashBabu25-Feb-19 2:34 
AnswerRe: Date conversion failure in xsl file (Chinese characters showing in date field) Pin
Richard Deeming25-Feb-19 8:51
mveRichard Deeming25-Feb-19 8:51 
QuestionDeserializing of List Array appends instead of overwrite Pin
Wild Thing13-Jul-18 0:53
MemberWild Thing13-Jul-18 0:53 
QuestionHow do I change this code to store new values to data list Pin
DropItSweet9-Jun-18 23:26
MemberDropItSweet9-Jun-18 23:26 
QuestionXML validation with libxml2 and msxml Pin
sandre14-May-18 21:49
Membersandre14-May-18 21:49 
AnswerRe: XML validation with libxml2 and msxml Pin
Jochen Arndt15-May-18 0:53
professionalJochen Arndt15-May-18 0:53 
QuestionXmlElements won't write on a new line. Pin
holdorf23-Oct-17 7:56
Memberholdorf23-Oct-17 7:56 
I am using XmlElements and AppendChild to create an XML tree. Now, the first level from the root writes on a new line but all other XmlElements write on the same line. How do I get each new XmlElement to write on a new line with proper indentation?

My code:

XmlAttribute ApplicantAttribute = doc.CreateAttribute("UserId");
                ApplicantAttribute.Value = NumberGenerator(100000, 999999, 6);
                Applicant.Attributes.Append(ApplicantAttribute);

                XmlNode ssnNameNode = doc.CreateElement("SSN");
                ssnNameNode.AppendChild(doc.CreateTextNode(NumberGenerator(0, 999999999, 9)));
                Applicant.AppendChild(ssnNameNode);

                XmlNode aNameNode = doc.CreateElement("Name");
                aNameNode.AppendChild(doc.CreateTextNode("Place Holdor Name"));
                Applicant.AppendChild(aNameNode);

                XmlNode demDataNode = doc.CreateElement("DemographicData");
                demDataNode.AppendChild(doc.CreateTextNode("DemographicData"));
                aNameNode.AppendChild(demDataNode);

                XmlNode FullName = doc.CreateElement("FullName");
                FullName.AppendChild(doc.CreateTextNode("FullName"));
                demDataNode.AppendChild(FullName);

                XmlNode LegalName = doc.CreateElement("LegalName");
                LegalName.AppendChild(doc.CreateTextNode("LegalName"));
                FullName.AppendChild(LegalName);

                XmlNode Last = doc.CreateElement("Last");
                Last.AppendChild(doc.CreateTextNode("Last"));
                LegalName.AppendChild(Last);

                XmlNode First = doc.CreateElement("First");
                First.AppendChild(doc.CreateTextNode("First"));
                LegalName.AppendChild(First);

                Applicant.AppendChild(demDataNode);

                RequestNode.AppendChild(Applicant);


The problem is that the output writes the following Xml file:

<Applicant UserId="830046">
    <SSN>811163249</SSN>
    <Name>Place Holdor Name</Name>   <DemographicData>DemographicData<FullName>FullName<LegalName>LegalName<Last>Last</Last><First>First</First></LegalName></FullName></DemographicData>
  </Applicant>

AnswerRe: XmlElements won't write on a new line. Pin
Maciej Los10-Feb-18 2:08
mveMaciej Los10-Feb-18 2:08 
QuestionNeed help with API Values in XElement Pin
Bootzilla3322-Sep-17 3:56
MemberBootzilla3322-Sep-17 3:56 
AnswerRe: Need help with API Values in XElement Pin
George Jonsson23-Sep-17 2:15
professionalGeorge Jonsson23-Sep-17 2:15 

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.