Click here to Skip to main content
14,357,800 members
   

XML / XSL

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 4:10
adminChris Maunder16-Jul-09 4:10 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 4:06
adminChris Maunder16-Jul-09 4:06 
QuestionSchematron errors with XML Spy update Pin
Member 1459998621-Sep-19 17:33
memberMember 1459998621-Sep-19 17:33 
AnswerRe: Schematron errors with XML Spy update Pin
Richard Deeming22-Oct-19 1:49
mveRichard Deeming22-Oct-19 1:49 
QuestionXML file read images and display them at random Pin
eatupyourgreens12-Sep-19 10:33
membereatupyourgreens12-Sep-19 10:33 
AnswerRe: XML file read images and display them at random Pin
Richard MacCutchan12-Sep-19 12:20
protectorRichard MacCutchan12-Sep-19 12:20 
GeneralRe: XML file read images and display them at random Pin
eatupyourgreens12-Sep-19 12:27
membereatupyourgreens12-Sep-19 12:27 
GeneralRe: XML file read images and display them at random Pin
Richard MacCutchan12-Sep-19 12:33
protectorRichard MacCutchan12-Sep-19 12:33 
QuestionQuery XML API and display results Pin
hm928-Aug-19 5:37
memberhm928-Aug-19 5:37 
AnswerRe: Query XML API and display results Pin
Richard MacCutchan28-Aug-19 6:57
protectorRichard MacCutchan28-Aug-19 6:57 
QuestionDate conversion failure in xsl file (Chinese characters showing in date field) Pin
AkashBabu25-Feb-19 3:34
memberAkashBabu25-Feb-19 3:34 
AnswerRe: Date conversion failure in xsl file (Chinese characters showing in date field) Pin
Richard Deeming25-Feb-19 9:51
mveRichard Deeming25-Feb-19 9:51 
QuestionDeserializing of List Array appends instead of overwrite Pin
Wild Thing13-Jul-18 1:53
memberWild Thing13-Jul-18 1:53 
QuestionHow do I change this code to store new values to data list Pin
DropItSweet10-Jun-18 0:26
memberDropItSweet10-Jun-18 0:26 
QuestionXML validation with libxml2 and msxml Pin
sandre14-May-18 22:49
membersandre14-May-18 22:49 
AnswerRe: XML validation with libxml2 and msxml Pin
Jochen Arndt15-May-18 1:53
mveJochen Arndt15-May-18 1:53 
QuestionXmlElements won't write on a new line. Pin
holdorf23-Oct-17 8:56
memberholdorf23-Oct-17 8:56 
AnswerRe: XmlElements won't write on a new line. Pin
Maciej Los10-Feb-18 3:08
protectorMaciej Los10-Feb-18 3:08 
QuestionNeed help with API Values in XElement Pin
Bootzilla3322-Sep-17 4:56
memberBootzilla3322-Sep-17 4:56 
AnswerRe: Need help with API Values in XElement Pin
George Jonsson23-Sep-17 3:15
professionalGeorge Jonsson23-Sep-17 3:15 
Your question is not very clear, but I assume you want to create an XElement that when written to a file will look like this
<xsd:element name="EventStatus" type="xsd:string">
    <xsd:annotation>
        <xsd:documentation>Event Status</xsd:documentation>
    </xsd:annotation>
</xsd:element>


This is one way to do it.
XNamespace ns = "should probably be the XSD namespace";

XElement documentation = new XElement(ns + "documentation");
documentation.SetValue("Event Status");

XElement annotation = new XElement(ns + "annotation");
annotation.Add(documentation);

XElement eventStatus = new XElement(ns + "element");
eventStatus.SetAttributeValue(XName.Get("name"), "EventStatus");
eventStatus.SetAttributeValue(XName.Get("type"), "xsd:string");
eventStatus.Add(annotation);

XElement root = new XElement("root", new XAttribute(XNamespace.Xmlns + "xsd", ns));
root.Add(eventStatus);

string s = root.ToString(); // Just a debug test line

QuestionXSL to get only elements which have no childs Pin
MrKBA19-Sep-17 1:26
memberMrKBA19-Sep-17 1:26 
AnswerRe: XSL to get only elements which have no childs Pin
Richard Deeming19-Sep-17 3:15
mveRichard Deeming19-Sep-17 3:15 
GeneralRe: XSL to get only elements which have no childs Pin
MrKBA19-Sep-17 4:02
memberMrKBA19-Sep-17 4:02 
Questionshare me best practices to enhance xslt related functionality in production Pin
Member 1178590912-Jul-17 2:50
memberMember 1178590912-Jul-17 2:50 
AnswerRe: share me best practices to enhance xslt related functionality in production Pin
Richard MacCutchan12-Jul-17 4:58
protectorRichard MacCutchan12-Jul-17 4:58 

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.