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

Select XML node value by attribute value with multiple levels

I'm looking to get to value further in the XML code than I've seen examples for and with more attributes to consider. The XML code is:
BenG
  • 14,826
  • 5
  • 45
  • 60
2
votes
0 answers

Need xsd for validation of xml based on attribute value

What will be the xsd pattern for below xml having condition:
2
votes
2 answers

XML find all attribute values of a tag of a child

I want to get the text value of every child that has one and every attribute value of every child that has one. I can get the text values but I am having trouble getting the attribute values one by one and assigning each to a variable. I have the…
Green Green
  • 43
  • 1
  • 8
2
votes
1 answer

Why does my C# Xml code only work when I enumerate variable enumerable

I am working on code that formats an XML file so that subfolder nodes are actually nested within their parent node. The source XML has every folder as a separate childnode in the root instead of the proper tree as you would expect it to be with…
ThomasW
  • 33
  • 4
2
votes
1 answer

adding attributes to an xml document

I have an XML schema and an instance document I get from a customer. For example the document can be:    12 And it is valid according to the schema. I would like to annotate this with my attributes:    …
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
2
votes
0 answers

XML parsing with attributes

I want know the xml parsing if the data have attributes at the middle of the tag.. that means,
Anand
  • 31
  • 1
  • 3
2
votes
1 answer

Sublime Text 3 XML Indent Arrange attributes

In sublime3 for XML formatting, i used xml indent plugin for auto indent, i use the shortcut ctrl+K ctrl+F. Here my question is the XML auto indent plugin also arrange the attributes in alphabetical order i want arrange only indent not attributes…
2
votes
1 answer

How to preserve whitespace within an element's opening tag in XSLT

In order to avoid committing sensitive information to an SCM repository, I wrote an XSL stylesheet that removes connection string passwords from ASP.NET Web.config files. It achieves my goal of removing passwords, but it also affects the whitespace…
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
2
votes
2 answers

Loop for extracting attributes of elements XML

I need to extract all attributes from a long list of various elements. Therefore, I'm seeking to build a loop going through all of my elements and return their attributes. Through several posts I have been able to write the code below. However, I…
D. Daugs
  • 35
  • 6
2
votes
1 answer

Add custom attribute to testng-results.xml method tags

I get a testng-results.xml file in my test-output directory for my appium project. Inside i get my test results, for example:
Rafthecalf
  • 461
  • 6
  • 20
2
votes
1 answer
2
votes
1 answer

Convert SQL table to XML with 2 node for each row

My MS SQL table has following data ID CONTENT FLAG TEXT ---------------------------------- 1 content1 T text1 2 content2 F text2 3 content3 T text2 and i want to…
2
votes
0 answers

IXmlSerializable and XmlAttribute - How can I make it work like DateTime does?

I have a class that has a fairly simple string representation. Serializing and deserializing to and from this string is not difficult. What I would like to be able to do is use an XmlAttribute like so: public class MyClass { …
Charlie Salts
  • 13,109
  • 7
  • 49
  • 78
2
votes
1 answer

Namespace autofill for custom attributes

I have a project "CustomViews" that I'd like to use as a library in another project "Library Dependent". One of my views, ToolbarITI has a few custom attributes defined in a file which I handle in my ToolbarITI class: attrs.xml
2
votes
1 answer

What is the XML namespace for 'xml:whatever'?

I am trying to use JAXB to extract an attribute 'xml:lang' from the following:
Westy
  • 707
  • 2
  • 10
  • 23