Example XML using element nodes:  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;users&gt;   &lt;user&gt;     &lt;name&gt;David Smith&lt;/name&gt;     &lt;phone&gt;0441 234443&lt;/phone&gt;     &lt;email&gt;dave.s33@domain.com&lt;/email&gt;     &lt;addresses&gt;       &lt;address&gt;         &lt;street&gt;1 Some Street&lt;/street&gt;         &lt;town&gt;Toy Town&lt;/town&gt;         &lt;country&gt;UK&lt;/country&gt;       &lt;/address&gt;       &lt;address&gt;         &lt;street&gt;5 New Street&lt;/street&gt;         &lt;town&gt;Lego City&lt;/town&gt;         &lt;country&gt;US&lt;/country&gt;       &lt;/address&gt;     &lt;/addresses&gt;   &lt;/user&gt; &lt;/users&gt;   Example XML using attributes:  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;users&gt;   &lt;user name="David Smith" phone="0441 234443" email="dave.s33@domain.com"&gt;     &lt;addresses&gt;       &lt;address street="1 Some Street" town="Toy Town" country="UK" /&gt;       &lt;address street="5 New Street" town="Lego City" country="US" /&gt;     &lt;/addresses&gt;   &lt;/user&gt; &lt;/users&gt;   I'm needing to build an XML file based on data from a relational database and can't work out whether I should use attributes or elements.  What is best practice when building XML files and why?
2110
At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the structure of the XML file.   The sample I came up with is essentially something like:  &lt;INVENTORY&gt;    &lt;ITEM serialNumber="something" location="something" barcode="something"&gt;       &lt;TYPE modelNumber="something" vendor="something"/&gt;     &lt;/ITEM&gt; &lt;/INVENTORY&gt;   The other team said that this was not industry standard and that attributes should only be used for meta data. They suggested:  &lt;INVENTORY&gt;    &lt;ITEM&gt;       &lt;SERIALNUMBER&gt;something&lt;/SERIALNUMBER&gt;       &lt;LOCATION&gt;something&lt;/LOCATION&gt;       &lt;BARCODE&gt;something&lt;/BARCODE&gt;       &lt;TYPE&gt;          &lt;MODELNUMBER&gt;something&lt;/MODELNUMBER&gt;          &lt;VENDOR&gt;something&lt;/VENDOR&gt;       &lt;/TYPE&gt;    &lt;/ITEM&gt; &lt;/INVENTORY&gt;   The reason I suggested the first is that the size of the file created is much smaller. There will be roughly 80000 items that will be in the file during transfer. Their suggestion in reality turns out to be three times larger than the one I suggested. I searched for the mysterious "Industry Standard" that was mentioned, but the closest I could find was that XML attributes should only be used for meta data, but said the debate was about what was actually meta data.  After the long winded explanation (sorry) how do you determine what is meta data, and when designing the structure of an XML document how should you decide when to use an attribute or an element?
31495
How can someone validate that a specific element exists in an XML file? Say I have an ever changing XML file and I need to verify every element exists before reading/parsing it.
71398
I am using XmlSerializer to write and read an object to xml in C#.  I currently use the attributes XmlElement and XmlIgnore to manipulate the serialization of the object.  If my xml file is missing an xml element that I require, my object still deserializes (xml -> object) just fine.   How do I indicate (preferably via Attributes) that a certain field is "required"?  Here is a sample method of what I am using currently:  [XmlElement(ElementName="numberOfWidgets")] public int NumberThatIsRequired {     set ...;     get ...; }   My ideal solution would be to add something like an XmlRequired attribute.     Also, is there a good reference for what Attributes are available to manipulate the behavior of XmlSerializer?
68176
I've been working on database-driven web applications for a few years now and recently took on a project involving a CMS that is XML-capable. This has led me to think about the usage of XML/XSLT in general and in what situations it would be more useful than the approach I've always used, which is storing all of my data in a (My)SQL database and then using PHP/Python/etc. to work with it on the web as needed.  There's obviously something I'm not "getting" here.. could anyone give me examples of applications where storing the data in XML files instead of in a database would be preferable?
2
I have been following  tutorial until I started adding nodes. The problem is that he has completely different nodes than I have. Even nodes that are created at start are different (I have Material and Output and he has Render Layers and Composite). Have I missed something or should I use different nodes than he?
16625
The code looks like this:   StringBuilder builder = new StringBuilder(); XmlWriterSettings settings = new XmlWriterSettings(); settings.OmitXmlDeclaration = true; using (XmlWriter xmlWriter = XmlWriter.Create(builder, settings)) {     XmlSerializer s = new XmlSerializer(objectToSerialize.GetType());     s.Serialize(xmlWriter, objectToSerialize); }   The resulting serialized document includes namespaces, like so:   &lt;message xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"      xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"      xmlns="urn:something"&gt;  ... &lt;/message&gt;   To remove the xsi and xsd namespaces, I can follow the answer from .  I want my message tag as &lt;message&gt; (without any namespace attributes).  How can I do this?
12188
I'm making an app with a custom list in multiple languages.  Is there an easy way so that I only have to create the site columns, content type and list once? So I don't have to create them for each language?  My app will be in English, French and Dutch.  My lists elements.xml looks like this  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;     &lt;!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List project item, an error will occur when the project is run. --&gt;     &lt;ListTemplate         Name="List1"         Type="10000"         BaseType="0"         OnQuickLaunch="TRUE"         SecurityBits="11"         Sequence="410"         DisplayName="List1"         Description="My List Definition"         Image="/_layouts/15/images/itgen.png"/&gt;   &lt;Field       Name="Adres"       ID="{2a32d9eb-ad3b-4dbb-abba-66dd01ca7c6e}"       DisplayName="$Resources:Adres"       Type="Text"       Required="TRUE" /&gt;   &lt;Field       Name="Naampje"       ID="{ac47be45-2f43-4d16-9a06-162c85945ec9}"       DisplayName="$Resources:Naampje"       Type="Text"       Required="FALSE" /&gt;   &lt;Field     Name="Nickname"     ID="{6B0A2CD7-A7F9-41ca-B932-F3BEBB603793}"     DisplayName="$Resources:Bijnaam"     Type="Text"     Required="FALSE" /&gt;  &lt;/Elements&gt;   Well if i change my language in Sharepoint (Office 365) it's not changing the titles from dutch to the other languages i have added.
43180
I'm trying to make a component in my community be able to pull in the record Id.  I followed the information in this question:   And this documentation:   My config file looks like this:  &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"&gt;     &lt;apiVersion&gt;45.0&lt;/apiVersion&gt;     &lt;isExposed&gt;true&lt;/isExposed&gt;     &lt;masterLabel&gt;ContractorSearch&lt;/masterLabel&gt;     &lt;description&gt;Searches for contractors for a given set of criteria&lt;/description&gt;     &lt;targets&gt;         &lt;target&gt;lightning__RecordPage&lt;/target&gt;         &lt;target&gt;lightningCommunity__Page&lt;/target&gt;         &lt;target&gt;lightningCommunity__Default&lt;/target&gt;     &lt;/targets&gt;     &lt;targetConfigs&gt;         &lt;targetConfig targets="lightning__RecordPage"&gt;             &lt;objects&gt;                 &lt;object&gt;Requisition__c&lt;/object&gt;             &lt;/objects&gt;         &lt;/targetConfig&gt;         &lt;targetConfig targets="lightningCommunity__Default"&gt;             &lt;property name="recordId" default="{!recordId}" type="String"                  label="Record ID" description="Should not be changed from default value."/&gt;         &lt;/targetConfig&gt;     &lt;/targetConfigs&gt; &lt;/LightningComponentBundle&gt;   Any ideas?
104904
I really should be able to get this, but I'm just to the point where I think it'd be easier to ask.  In the C# function:  public static T GetValue&lt;T&gt;(String value) where T:new() {    //Magic happens here }   What's a good implementation for the magic? The idea behind this is that I have xml to parse and the desired values are often primitives (bool, int, string, etc.) and this is the perfect place to use generics... but a simple solution is eluding me at the moment.  btw, here's a sample of the xml I'd need to parse  &lt;Items&gt;     &lt;item&gt;         &lt;ItemType&gt;PIANO&lt;/ItemType&gt;         &lt;Name&gt;A Yamaha piano&lt;/Name&gt;         &lt;properties&gt;             &lt;allowUpdates&gt;false&lt;/allowUpdates&gt;             &lt;allowCopy&gt;true&lt;/allowCopy&gt;         &lt;/properties&gt;        &lt;/item&gt;     &lt;item&gt;         &lt;ItemType&gt;PIANO_BENCH&lt;/ItemType&gt;         &lt;Name&gt;A black piano bench&lt;/Name&gt;         &lt;properties&gt;             &lt;allowUpdates&gt;true&lt;/allowUpdates&gt;             &lt;allowCopy&gt;false&lt;/allowCopy&gt;             &lt;url&gt;www.yamaha.com&lt;/url&gt;         &lt;/properties&gt;     &lt;/item&gt;     &lt;item&gt;         &lt;ItemType&gt;DESK_LAMP&lt;/ItemType&gt;         &lt;Name&gt;A Verilux desk lamp&lt;/Name&gt;         &lt;properties&gt;             &lt;allowUpdates&gt;true&lt;/allowUpdates&gt;             &lt;allowCopy&gt;true&lt;/allowCopy&gt;             &lt;quantity&gt;2&lt;/quantity&gt;         &lt;/properties&gt;     &lt;/item&gt; &lt;/Items&gt;
119203
Using AMPScript to parse an XML feed. Client is switching to JSON. Is there something similar to  for JSON in AMPScript? I am confined to using the members login area and not an external API application.
36382
I need to create an XML schema that validates a tree structure of an XML document. I don't know exactly the occurrences or depth level of the tree.  XML example:  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;node&gt;   &lt;attribute/&gt;   &lt;node&gt;     &lt;attribute/&gt;     &lt;node/&gt;         &lt;/node&gt; &lt;/node&gt;    Which is the best way to validate it?  Recursion?
119637
We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that?  Edit  There are apparently no free tools for this, and I agree that OxygenXML is one of the best tools for this.
8990
I would like to ask for some simple examples showing the uses of &lt;div&gt; and &lt;span&gt;.   I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other.
2220
When looking at most sites (including SO), most of them use:  &lt;input type="button" /&gt;   instead of:  &lt;button&gt;&lt;/button&gt;    What are the main differences between the two, if any? Are there valid reasons to use one instead of the other? Are there valid reasons to use combine them? Does using &lt;button&gt; come with compatibility issues, seeing it is not very widely used?
83249
Very similar to , except for Java.  What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&amp;", "&lt;", etc.
37542
What languages or platforms influenced the .NET 1.0 Team to build-in the concept of Attributes from the very start? Was this an Aspect-Oriented thing? Serialization? or something else? I was still in VB6-land at this time, and never used any of the pre-1.0 .NET versions.
122018
I am trying to add a list into an another nested list before adding values of a list to nested list it is getting the correct value but after adding i am getting (already output) in debug log when i checked.    public List&lt;String&gt; fieldName {get;set;}  public List&lt;List&lt;String&gt;&gt; fileValuesXML; // To get the field values of xml  for(Dom.XMLNode child : SalesforceObjecet.getChildElements()) {                        objecetName = child.getText();             system.debug('Object Name in XML field  ' + objecetName );              for(Dom.XMLNode subchild : child.getChildElements())              {                 system.debug('Sub child ' + subchild.getText() );                 for(Dom.XMLNode subchildfield : subchild.getChildElements())                 {                     system.debug('Sub child Field ' + subchildfield );                     fName  = subchildfield.getText();                     fieldName.add(fName);                     //fileValuesXML.add(fieldName);                     //system.debug('Filed Name in XML field  ' + fieldName);                 }                  system.debug('Filed Name before affing to filevalueXML  ' + fieldName);                                     fileValuesXML.add(fieldName);                 fieldName.clear();                 system.debug('Filed Name after affing to filevalueXML  ' + fileValuesXML);             }    }    I am getting values in debug log as:     Filed Name before affing to filevalueXML  (AccountSource, field3)   Filed Name after affing to filevalueXML  ((), (already output),   (already output))