Questions tagged [xml-attribute]

xml attributes deliver additional information about xml elements/tags.

xml attributes are name/value pairs delimited by equal sign and where the value is enclosed with quotes:

<element  attribute="value"/>

Usually the same information can be provided with sub-elements:

<element>
  <attribute>value</attribute>
</elemenbt>

Links:

317 questions
548
votes
8 answers

Android : Difference between View.GONE and View.INVISIBLE?

What is the difference between View.INVISIBLE and View.GONE for the View visibility status?
Rob
  • 15,732
  • 22
  • 69
  • 107
92
votes
13 answers

Should I use Elements or Attributes in XML?

I am learning about XML Attributes from W3Schools. The author mentions the following (emphasis mine): XML Elements vs. Attributes Anna Smith
Ibn Saeed
  • 3,171
  • 11
  • 50
  • 59
71
votes
4 answers

How do I comment attributes inside an XML tag?

Is it possible to comment one or several attributes inside an XML tag? Something like /* */ from C. I have tried using , but it was unsuccessful.
Ntropy Nameless
  • 846
  • 1
  • 6
  • 7
68
votes
3 answers

Activity Layout: Fragment class: vs android:name attributes

I've read the documentation about Fragments in the Android Developer Guide and I've seen that sometimes they specify the class to instantiate with the Fragment tag attribute android:name and sometime they use the class: attribute:
Gianni Costanzi
  • 6,054
  • 11
  • 48
  • 74
61
votes
2 answers

How do I include &, <, > etc in XML attribute values

I want to create an XML file which will be used to store the structure of a Java program. I am able to successfully parse the Java program and create the tags as required. The problem arises when I try to include the source code inside my tags,…
Sudh
  • 1,265
  • 2
  • 19
  • 30
58
votes
3 answers

Is an xml attribute without a value, valid?

I want to have an XML attribute without any value, which simply has one meaning when it exists or does not exist. Is that valid?
Andreas
  • 591
  • 1
  • 4
  • 3
48
votes
5 answers

Difference between android:id and android:labelFor?

I wrote a simple layout which has an EditText, but it's showing the following warning message: “No label views point to this text field” While searching I found this and it solved that warning message, but did not get difference between both…
CoDe
  • 11,056
  • 14
  • 90
  • 197
30
votes
1 answer

Extracting Attributes from XML Fields in SQL Server 2008 Table

I have a table with several columns, one of which is a xml column. I do not have a namespace to use in the query. The XML data is always the same structure for all records. Contrived Data create table #temp (id int, name varchar(32), xml_data…
James L.
  • 9,384
  • 5
  • 38
  • 77
27
votes
5 answers

XSLT - How to select XML Attribute by Attribute?

this is the structure of my source xml:
seansilver
22
votes
4 answers

What is the max number of characters allowed in an XML attribute?

Is there a standard for the maximum number of characters allowed in an XML attribute? I tried researching W3C consortium and couldn't find anything on the character limit aside from some notes on escaping special characters.
G33kKahuna
  • 1,730
  • 7
  • 24
  • 39
21
votes
4 answers

What is the best way to parse an XML boolean attribute (in .NET)?

An XML attribute declared as xs:boolean can acceptable be "true", "false", "0" or "1". However, in .NET, Boolean.Parse() will only accept "true" or "false". If it sees a "0" or "1", it throws a "Bad Format" exception. So, given that, what's the…
James Curran
  • 101,701
  • 37
  • 181
  • 258
21
votes
7 answers

How to get the attribute value of an xml node using java

I have an xml which looks like this: { .....} Here I want to retrieve the value of "source type" where type is an attribute. I tried the following, which didn't…
Priya
  • 469
  • 3
  • 6
  • 14
19
votes
5 answers

error: Attribute "***" has already been defined when using two library projects in Android

I'm using android-support-v7-appcompat as a library in my Android project. Now I want to include actionbarsherlock as another library project. When I add the second library, it gives so many errors like…
19
votes
2 answers

XmlAttribute/XmlText cannot be used to encode complex types

I am getting the following error on the below class: Cannot serialize member 'Ingredient' of type DataObjects.Ingredient. XmlAttribute/XmlText cannot be used to encode complex types. Any thoughts as to…
David Poxon
  • 2,435
  • 4
  • 23
  • 44
17
votes
3 answers

With SAX Parser, get an attribute's value

I am parsing XML from the web using Android. The code below shows a sample of the XML. The problem I'm having is I can't get the string value of the item tag. When I use name = attributes.getQName(i); it outputs the name, not the value of the…
carsey88
  • 377
  • 2
  • 6
  • 15
1
2 3
21 22