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
4
votes
1 answer

Retrieving XML attribute values using Python iterparse

I'm trying to find out how to retrieve XML attribute values using the cElementTree iterparse in Python (2.7). My XML is something like this:
RTF
  • 6,214
  • 12
  • 64
  • 132
4
votes
1 answer

optional JAXB xml attribute while marshalling

When I marshal java object using JAXB I am getting below xml element But I want xml as below If column value is empty then I need to get the xml as shown above…
Suresh
  • 253
  • 2
  • 4
  • 13
3
votes
4 answers

Can I create an XSD schema that places an attribute on all complex types?

I would like to create an XSD that defines an attribute which can be placed on elements from other schemas, or elements that are not in any schema. For example, the schema would look something like this:
jon without an h
  • 572
  • 1
  • 4
  • 17
3
votes
4 answers

Read attribute from xml

Can someone help me read attribute ows_AZPersonnummer with asp.net using c# from this xml structure
3
votes
2 answers

XML: attributes or children?

In XSD, SOAP and other XML conventions you'll often see things like: Harry Potter J.K. Rowling Now I'm wondering, what happened to attributes? To me it makes more sense to write this as:
Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301
3
votes
1 answer

Why is an XML attribute without XMLNS prefix not equal to a prefixed attribute with same local name?

When the default namespace and a prefixed namespace resolves to the same namespace URI, why is an attribute with no prefix not equal to a prefixed attribute, when both have the same local name? The "Namespaces in XML" specification just says it's…
hovenko
  • 713
  • 7
  • 15
3
votes
2 answers

How can I transform an element attribute to an element name in XSLT?

I'd link to transform XML with attributes like the 'name' attribute in the following: into elements called what was in the name attribute:
brabster
  • 42,504
  • 27
  • 146
  • 186
3
votes
2 answers

XmlDocument and getting specific Attributes using xPath

I have seen a couple of examples on here where Xpath is used in conjunction with XmlDocument to get a specific attribute from an XmlDocument Node....…
SoftwareSavant
  • 9,467
  • 27
  • 121
  • 195
3
votes
1 answer

Python ElementTree Get attribute with namespace

Im trying to access "def" in XML so in this example I would be getting Evolus.Common:PlainTextV2 as output. I cant seem to figure out how to get an attribute with a namespace. If I was trying to just get id it works perfectly Python for content_ns…
3
votes
1 answer

Writing XML attributes and namespace declarations in a specific order

I am trying to make an XML file with a root element: So I have an element Command a namespace namespaceURI a prefix urn and finally an attribute string with name complete a value true and no…
3
votes
1 answer

Unable to find element by attribute with lxml

I'm using a European Space Agency API to query (result can be viewed here) for satellite image metadata to parse into python objects. Using the requests library I can successfully get the result in XML format and then read the content with lxml. I…
Ali
  • 150
  • 1
  • 6
3
votes
2 answers

Adding Attribute to XML node C#

I am trying to add an attribute to XML node Actual Value Expected after node…
rackhwan
  • 265
  • 5
  • 14
3
votes
1 answer

XMLAttribute is not working

I am Deserializing my xml into C# class.
Abhash786
  • 881
  • 2
  • 24
  • 53
3
votes
2 answers

How to make an XmlReader read the attributes in C#?

I have an XML-Stream that contains the following XML content: B D I can't find a way to get an XmlReader to read to the Key…
LWChris
  • 3,320
  • 1
  • 22
  • 39
3
votes
1 answer

Must ID attributes be unique in XML?

Having an XML document like this: Homer Bart Is it valid to have the same attribute name ID in…
Abdulrahman Bres
  • 2,603
  • 1
  • 20
  • 39