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
6
votes
5 answers

Xml node value from an attribute in VB.net

I have a XML like 1 name1 2
Jigar Shah
  • 175
  • 2
  • 3
  • 13
6
votes
1 answer

How to dynamically change attribute of an xml node with c#

I have a c# application that saves user's data to an xml document. I want to be able to dynamically change the attribute of an xml node based on a user entering different criteria into a text box and choosing to save/overwrite the existing file…
user1546315
  • 683
  • 5
  • 16
  • 27
5
votes
1 answer

How to change the attribute value of svg file

In samplexml.svg there is a node I need to replace "image1.png" with another value like "image2.png". Please guide me with sample code how to to that. I could get the attribute value…
user577443
  • 51
  • 1
  • 2
5
votes
2 answers

get xml attribute named xlink:href using xsl

How can I get the value of an attribute called xlink:href of an xml node in xsl template? I have this xml node:
awe
  • 21,938
  • 6
  • 78
  • 91
5
votes
1 answer

Is it possible to serialize a custom struct as an xml attribute?

Is is possible to serialize a custom struct as an xml attribute? Sample code: public class Dummy { private Dummy() { } public Dummy(T item1) { Item1 = item1; Item2 = item1; } public T Item1 { get; set; } …
Johan Larsson
  • 17,112
  • 9
  • 74
  • 88
5
votes
6 answers

Why isn't my document validating as XHTML 1.1 STRICT?

While target="_blank" is deprecated, why is the W3C validator not giving an error about this ? You can paste and check this code int the validator:
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
5
votes
1 answer

Jackson marshal XMLAttribute gets "null" value

I have an issue with JAXB / Jackson marshalling. I have such an annotation @XmlAttribute(name = "private") protected Boolean mPrivate; and I expect that this attribute be absent if the mPrivate variable is null. This works fine if the output is…
ticofab
  • 7,551
  • 13
  • 49
  • 90
5
votes
2 answers

C# Xml why doesn't my attribute appears?

I have a class defined like this: [XmlRoot(ElementName="request")] public class Request { #region Attributes [XmlAttribute(AttributeName = "version")] public string Version { get { return "1.0"; } …
Serge
  • 6,554
  • 5
  • 30
  • 56
5
votes
2 answers
5
votes
6 answers

XSLT on SSRS report

I want to translate an XML file with data like the following: ... The data I am interested in is the attributes…
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
5
votes
1 answer

How can I preserve case of element attributes?

I'm using jQuery to create an XML document on the fly by utilizing the document.createElement function. This works great for creating the structure as I am able to utilize the .appendTo function to dynamically place the correct nodes in the proper…
Brandon
  • 73
  • 4
4
votes
2 answers

RegEx for specified string length range : XSD attribute element

I'm trying to restrict an attribute element of a schema to be between 3 and 20 characters long, but I'm getting an error saying my RegEx is invalid:
Chris V.
  • 1,123
  • 5
  • 22
  • 50
4
votes
3 answers

Is there a way to retain XML Attributes when serializing part of a class?

I am attempting to serialize just part of a class. I've added XML attributes to the class members so that the generated XML tags are correctly named to match a spec regardless of what my properties are named. This works fine when serializing the…
Curtis
  • 5,794
  • 8
  • 50
  • 77
4
votes
1 answer

@XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML

how to pick the value of an attribute 'name' which is a PriceEventName class type in the below case, FYI if i put @XmlAttribute above it this is turn out to an exception "an error @XmlAttribute/@XmlValue need to reference a Java type that maps to…
poa
  • 269
  • 1
  • 4
  • 13
4
votes
2 answers

Read XML child node attributes using SQL query

I have one XML column (Criteria) in table (Qualifications) which contains different XML:
Dhaval Panchal
  • 612
  • 4
  • 12
  • 32
1 2
3
21 22