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
16
votes
3 answers

How do I give an array an attribute during serialization in C#?

I'm trying to generate C# that creates a fragment of XML like this. 11:22:33:44:55:66:77:88 11:22:33:44:55:66:77:89
jcolebrand
  • 15,889
  • 12
  • 75
  • 121
15
votes
7 answers

Get list of XML attribute values in Python

I need to get a list of attribute values from child elements in Python. It's easiest to explain with an example. Given some XML like this:
roomaroo
  • 5,831
  • 4
  • 31
  • 31
14
votes
6 answers

How to do mutually exclusive attributes in XML schema?

I'm trying to make two XML attributes to be mutually exclusive. How can one create an XSD schema to capture this kind of scenario? I would like to have one of these but not
Filip Frącz
  • 5,881
  • 11
  • 45
  • 67
13
votes
1 answer

How to unmarshal XML attributes with colons?

Some SVG/XML files I'm working with have dashes and colons in attribute names - for example: ... I'm trying to figure out how to unmarshal these attributes using golang's…
sa125
  • 28,121
  • 38
  • 111
  • 153
11
votes
5 answers

How to specify the order of XmlAttributes, using XmlSerializer

XmlElement has an "Order" attribute which you can use to specify the precise order of your properties (in relation to each other anyway) when serializing using XmlSerializer. public class bookingList { [XmlElement(Order = 1)] public string…
demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103
10
votes
1 answer

How make Android self components and use it from a jar library?

I'm trying to create an android component that can be easily added to android projects as a jar library. For this, I had to create new xml attributes in "res/values/attr.xml" that I add to my graphic xml element using the path: …
Maxime
  • 101
  • 1
  • 4
8
votes
4 answers

Find through multiple attributes in XML

I'm trying to search multiple attributes in XML :
Murtaza Mandvi
  • 10,708
  • 23
  • 74
  • 109
8
votes
3 answers

access #text property of XMLAttribute in powershell

I have an xml document formated like this: now I'd like to change the value attribute of the index element…
wullxz
  • 17,830
  • 8
  • 32
  • 51
7
votes
1 answer

How to use XmlElementAttribute for List?

I have a class like this: public class Level { [XmlAttribute] public string Guid { get; set; } } public class LevelList : List { } public class Test { public LevelList CalLevelList { get; set; } } Using XmlSerializer, I get the…
newman
  • 6,841
  • 21
  • 79
  • 126
7
votes
3 answers

LINQ to XML ignores line breaks in attributes

According to this question: Are line breaks in XML attribute values allowed? line breaks in XML attributes are perfectly valid (although perhaps not recommended): When…
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148
7
votes
2 answers

How can I make @XmlAttribute in a special order by using JAXB?

I have XML file which needs 3 attributes in an element. How can make the order of street, zip and city attribute as I wanted?
@XmlType(name="Street) @XmlRootElement(name =…
Chris
  • 6,431
  • 10
  • 44
  • 59
6
votes
5 answers

XML schema; multiple from a list of valid attribute values

I'm reasonably new to working with XML schemas, so excuse my incompetence if this is more trivial than I myself believe it must be. I'm trying to create a required attribute that must contain 1 or more white-space-separated string values from a…
Dan Lugg
  • 20,192
  • 19
  • 110
  • 174
6
votes
1 answer

Why is SelectSingleNode returning null?

I'm working with an XML document that contains a structure that looks similar to this: . . . I'm…
Todd Richardson
  • 1,119
  • 1
  • 11
  • 22
6
votes
2 answers

TypedArray not working

I'm learning about custom components and i'm having some trouble with custom xml attributes.My custom component extends LinearLayout and in the constructor(public Custom(Context context, AttributeSet attrs))i'm inflating a xml layout(2 Buttons and 1…
user
  • 86,916
  • 18
  • 197
  • 190
6
votes
2 answers

How can I add xml attributes with different prefixes/namespaces in C#?

I need to be able to create an XML Document that looks like this:
Narnian
  • 3,858
  • 1
  • 26
  • 29
1
2
3
21 22