I am a beginner in XML language.  I am learning XML in Android studio at school.  Example,   &lt;Person&gt;  &lt;sex ="female"&gt;&lt;/sex&gt;  &lt;firstname = "Hani"&gt;&lt;/firstname&gt;  &lt;lastname = "Jeong"&gt;&lt;/lastname&gt; &lt;/Person&gt;   in this case, all the values are hidden from users, right?  What I am really confused about is that I understood that attributes must always have values.   Which common situations do you hide the values or show the values to users?
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?
37467
Has anyone have the idea of passing the values as hidden in url  for example I need to pass the values of First Name,Last name,email,address &amp; so on  \apex\page2?fn=test&amp;ln=test&amp;email=vemula.aruna@clickandpledge.biz&amp;bill=adres,adres2,city,508209,840,Alabama,&amp;tdate=12/11/12   If I pass them like that I'm getting a very large URl.Any remedy for this
117699
How to represent space and tab in XML tag. Is there any special characters for them to represent.
92236
I have an xml file which I would like to create a form/table around to add, edit and delete records using PHP.  Currently I use simpleXML to load the XML file, and display its content on various pages.  Is there any way I can create a table that shows all results, and allows me to either edit or delete that particular row of the table which represents a full record within the XML file.    When clicking edit I would like the details from the record to appear in a form which the user can change and then save out, updating the XML file and the corresponding web page.  I need this done in PHP, preferably using SimpleXML, though open to suggestions of other ways to do this with PHP.  Cheers
77567
I've read in the  and the  the mention of inner classes. What is their purpose?  I see in the Apex Workbook that they used private variables and setter/getter methods in the inner class, but why didn't they just do that in the outer class with a constructer, getter, and setter?
23574
. (See comments to the question: the OP tried to include a couple of long XML files, but that wasn't possible.)  What's the recommended approach to including code/data, when there's just too much of it to embed in the question?  I could think of a few approaches myself:   Paste the data to a pastebin and link (and wait for the links to die) Encode the (compressed) data in an image and include that (kludgy!) Implement an attachment feature in Stack&nbsp;Overflow (which will probably be abused)
55036
I saw this reply from Jon on :     If you want a single collection to   contain multiple unrelated types of   values, however, you will have to use   List&lt;object&gt;   I'm not comparing ArrayList vs List&lt;&gt;, but ArrayList vs List&lt;object&gt;, as both will be exposing elements of type object. What would be the benefit of using either one in this case?  EDIT: It's no concern for type safety here, since both class is exposing object as its item. One still needs to cast from object to the desired type. I'm more interested in anything other than type safety.  EDIT: Thanks Marc Gravell and Sean for the answer. Sorry, I can only pick 1 as answer, so I'll up vote both.
85136
All right, say I have this:  &lt;select id='list'&gt;     &lt;option value='1'&gt;Option A&lt;/option&gt;     &lt;option value='2'&gt;Option B&lt;/option&gt;     &lt;option value='3'&gt;Option C&lt;/option&gt; &lt;/select&gt;   What would the selector look like if I wanted to get "Option B" when I have the value '2'?  Please note that this is not asking how to get the selected text value, but just any one of them, whether selected or not, depending on the value attribute. I tried:  $("#list[value='2']").text();   But it is not working.
6507
This is something that I always find a bit hard to explain to others:  Why do XML namespaces exist?  When should we use them and when should we not? What are the common pitfalls when working with namespaces in XML?   Also, how do they relate to XML schemas? Should XSD schemas always be associated with a namespace?
35156
I have an XDocument object. I want to query for elements with a particular name at any depth using LINQ. When I use Descendants(&quot;element_name&quot;), I only get elements that are direct children of the current level. I'm looking for the equivalent of &quot;//element_name&quot; in XPath...should I just use XPath, or is there a way to do it using LINQ methods?
78392
Which would be the correct format for this XML data, are they equivalent or are there trade offs between the two?  1.  &lt;sitemap&gt;   &lt;category name="Animals"&gt;     &lt;section title="Dogs"&gt;       &lt;page url="/pics/greatdane.jpg" title="Great Dane"/&gt;     &lt;/section&gt;   &lt;/category&gt; &lt;/sitemap&gt;   2.  &lt;sitemap&gt;   &lt;page&gt;     &lt;category&gt;Animals&lt;/category&gt;     &lt;section&gt;Dogs&lt;/section&gt;     &lt;title&gt;Great Dane&lt;/title&gt;     &lt;url&gt;/pics/greatdane.jpg&lt;/url&gt;       &lt;/page&gt; &lt;/sitemap&gt;   I've implemented the first example with my style sheet and it seems to work fine, but I'm unsure what the correct form should be.
26350
I've often seen questions getting questioned and people coming up with anwsers that are totaly irrelevant.  For example, in  I was looking for a library that adds attributes in a certain order to XML documents. Someone on Stack Overflow was asking about this, and all he got was people telling him that this is not XML standard and he shouldn't do that. I needed ordering attributes too because of readability, but all I found were useless answers. I had to ask the question again and provide reason in order to get useful answers.  Providing a reason for a question might be a good thing, but is it really so hard to answer questions, even if who asked did not explain all the details about his reason for asking?
76549
For example  Drupal\Core\Entity\Entity::id() returns $this-&gt;id(or NULL) Drupal\Core\Entity\ContentEntityBase::id() returns $this-&gt;id-&gt;value Drupal\Core\Entity\ContentEntityBase::uuid() returns $this-&gt;get('uuid')-&gt;value Drupal\node\Entity\Node::id() returns $this-&gt;get('nid')-&gt;value  Also in some methods there are setValue() and getValue() utilised but sometimes there are just $this-&gt;field-&gt;value. So what is the reason for this inconsistent behavior? From my understanding all the &quot;fields&quot; are TypedData fields hence the setValue() and getValue() methods should be used instead of directly access $this-&gt;field-&gt;value. Besides it's strange because $value is private.
5364
Is it possible to use PHP's SimpleXML functions to create an XML object from scratch?  Looking through the function list, there's ways to import an existing XML string into an object that you can then manipulate, but if I just want to generate an XML object programmatically from scratch, what's the best way to do that?  I figured out that you can use simplexml_load_string() and pass in the root string that you want, and then you've got an object you can manipulate by adding children... although this seems like kind of a hack, since I have to actually hardcode some XML into the string before it can be loaded.  I've done it using the , although it's a little confusing because I'm not sure what the DOM has to do with creating a pure XML document... so maybe it's just badly named :-)
57529
There are a variety of characters that are not legally encodeable in XML 1.0, e.g. U+0007 ('bell') and U+001B ('escape'). Most of the interesting ones are non-whitespace 'control' characters.    It's clear from (e.g.)  and others that it's  -- but can anyone illuminate me as to why the XML spec forbids these characters?   It seems like it could have been required that they be encoded in escapes, e.g. as &amp;#x0007; and &amp;#x001B; respectively, but perhaps there's a practical reason that the characters were forbidden rather than required to be escaped?  Answerers have suggested that there is some motivation towards avoiding transmission control characters, but Unicode includes many other control-like characters (consider U+200C "zero width non joiner"). I recognize there may be no good reason for this behavior, but I would still like to understand it better.  It's particularly frustrating because when those character values appear in other encodings data formats, I end up "double-escaping" new XML documents that need to encode this.
59713
Given that there is no logically default animal from the list of animals below, what should be the "Default Value" below, according to best practice?  &lt;label for="animal"&gt;Animal (required):&lt;/label&gt; &lt;select name="animal"&gt;   &lt;option value=""&gt;Default Value&lt;/option&gt;   &lt;option value="0"&gt;Cat&lt;/option&gt;   &lt;option value="1"&gt;Dog&lt;/option&gt;   &lt;option value="2"&gt;Horse&lt;/option&gt;   &lt;option value="3"&gt;Pig&lt;/option&gt;   &lt;option value="4"&gt;Sheep&lt;/option&gt; &lt;/select&gt;   A blank value, &lt;option value=""&gt;&lt;/option&gt;?  Something visually irritating, &lt;option value=""&gt;***CHOOSE ANIMAL***&lt;/option&gt;?  Something which blends in but provides instruction, &lt;option value=""&gt;Select an Animal&lt;/option&gt;?  Something else entirely?
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.