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
1
vote
2 answers

Create xml with attributes in scala

How i can set attribute value like value for elements in scala.xml This not work :( def getXml(fooValue: String, barValue: String): Node = val fooBar = { fooValue }
crashkin
  • 13
  • 3
1
vote
1 answer

Avoid validating attributes in XSD

How can I have an XSD which does not validate attribute of an element in my XML? Basically my xml has a tag which can have any attributes - For example: Content here I wouldn't know beforehand if the attribute is…
rkrishnan
  • 776
  • 1
  • 9
  • 21
1
vote
2 answers

Set XML as value of an XML node attribute

I'm trying to create an XML document in C#, which in one of attribute will get another XML as value: XmlDocument doc = new XmlDocument(); XmlElement nodElement = doc.CreateElement(string.Empty, "node", string.Empty); …
Ghasem
  • 14,455
  • 21
  • 138
  • 171
1
vote
1 answer

PHP: Soap Client xmlattribute

I have try to use an php soap client. But the SOAP XML needs to contain an XML attribute like "opCode=EQ" this example: .... yy cc
GreenRover
  • 1,486
  • 1
  • 14
  • 33
1
vote
2 answers

Is it possible to replace dots in password (EditText) with custom view?

I want to replace dots in EditText (android:inputType="textPassword") with custom xml or image. I can replace dots with any other symbol using PasswordTransformationMethod method, but this is not what is required in this case. So, is it…
Mark Korzhov
  • 2,109
  • 11
  • 31
  • 63
1
vote
2 answers

Add XmlAttribute to C# Class for serialization

I'm having a bit of a head scratching moment here, as I think I'm doing this correctly! I need to create an xml file as below, (I've left out the namespace declarations)
Eoin Melly
  • 11
  • 2
1
vote
1 answer

Equivalent of System.Xml.XmlAttribute in PCL land?

I'm attempting to convert some existing C# code into a Portable Class Library project, profile 111. Here is the code I'm stuck on: [System.Xml.Serialization.XmlAnyAttributeAttribute()] public System.Xml.XmlAttribute[] OtherAttributes { get …
Brannon
  • 5,324
  • 4
  • 35
  • 83
1
vote
2 answers

Deserialize XmlElement with part name

This is my sample XML: Is it possible to use somehow XmlElement (I'm using XmlSerializer) to deserialize leg0 and leg1 to one object type? My…
Mateusz
  • 116
  • 1
  • 9
1
vote
2 answers

XmlSerializer - Create secondary attributes to base types eg string

Using .net XmlSerializer and the following structure: public class SomeClass { [XmlElement("some-string")] public string SomeString { get; set; } } I need the above to produce :
drbz
  • 13
  • 3
1
vote
0 answers

Property becomes hidden from XML if [XmlAttribute] is set

I am writing a WCF service that is supposed to return a following structure:
shumiker
  • 11
  • 1
1
vote
1 answer

Adding attribute to xml element within JAXB API

I am using JAXB API for mapping a Java object to XML. My Java class is @XmlRootElement(name = "ad") @XmlAccessorType(XmlAccessType.FIELD) class Item { @XmlElement(name = "id", nillable = false) @XmlCDATA private int id; …
user973296
  • 113
  • 1
  • 8
1
vote
1 answer

Adding new element in xml

I have this xml file
user3297557
  • 119
  • 2
  • 3
  • 11
1
vote
2 answers

PHP - using XPATH to reference XML element with 2 attributes

I am using XPATH (with PHP) to retrieve XML data based on the XML attributes. The XML structure is like this: Dell Desktop (d) 499.99
Dean Olsen
  • 131
  • 4
  • 13
1
vote
1 answer

DOM parser to read Xml , retrieve attribute values and storing them

Using DOM parser, I am storing attribute values in HashMap in Java and then later retrieving it as required. Is there any other way of doing this without using maps? Xml example:
2FaceMan
  • 443
  • 2
  • 18
  • 34
1
vote
1 answer

Perl XML:LibXML setAttribute not changing the document

I'm trying to change an XML attribute using Perl. The XML file looks like this: the Perl script contains: my @nodes = $doc->findnodes("//Node/Nodex");; if (@nodes) { my $res =…
mr.G
  • 167
  • 1
  • 1
  • 10