317 questions
1
vote
0
answers
78
views
XmlSerializer does not deserialize XmlAttributes with a Namespace-Prefix. Bug? [duplicate]
I am trying to deserialize a given piece of XML that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<tst:myRootElement xmlns:tst="myGivenNamespace">
...
1
vote
1
answer
117
views
C# - How can I (de)serialize internal classes (from)to XML with attributes?
I want to (de)serialize internal classes.
internal class Data
{
public string? Name { get; set; }
public string? Type { get; set; }
public List<DataWithAttribute> DataList { get; set;...
0
votes
1
answer
598
views
How to add a namespace to an XML attribute using XmlSlurper (Apache Groovy)?
I'm iterating through the child elements of a flattish XML, and adding a certain attribute for elements that are empty.
import groovy.xml.XmlUtil
import groovy.xml.MarkupBuilder
import groovy.xml....
0
votes
1
answer
99
views
How to update an attribute value in same date format
I want to change the publicationDateTime="2023-07-31T07:02:59+00:00" attribute.
My xml is
<?xml version="1.0" encoding="UTF-8" standalone="no"?><...
1
vote
0
answers
175
views
XML file creation with Python: How to display the attributes of an element in multiple lines
I am working with python on the creation of two types of files: EVFM and SMURF, which both follow the xml structure.
One example of such files is the following:
EVFM
My approach is to use the ...
0
votes
0
answers
30
views
XML Array Element not assigning Attributes when deserialising (C#)
I have a pre-existing XML structure which I want deserialised into C#.
The structure of the file is:
<SLOT_DEFINITION>
<SLOT name="head" >
<MESH model="head01....
0
votes
1
answer
346
views
Remove XML element attribute with namespace
I want to remove an attribute of a specific element, which includes a namespace.
In the following element: <CountryCode xsi:nil="true"></CountryCode> I want to remove xsi:nil=&...
1
vote
0
answers
89
views
Can't use anyAttribute using gSOAP generated c++ code
I have an XSD schema file using anyAttributes for allowing custom extensions for different users. Unfortunately, I am getting problems with the C++ code generated by gSOAP. It works fine for ...
1
vote
1
answer
229
views
XML Serialization Namespace both Child and Parent Elements
Good day all,
I have trouble adding namespaces correctly to my XML. Both the parent and child elements have the own namespaces. When restructure the code I have gotten mixed results. My sample code ...
1
vote
1
answer
99
views
How to add a XML element for an existing text in a XML file with python
I have a problem with some values not being declared as XML elements in my XML files. But for further processing, I need them to be an element. Example:
<A>
<B id="254">
...
0
votes
2
answers
740
views
How to add multiple XML element to an existing text in a XML file with python
I have a problem with some values not being declared as XML elements in my XML files. But for further processing, I need them to be an element. Example:
<A>
<B id="254">
<...
0
votes
1
answer
957
views
How to add an XML element to an existing text in a XML file with python
I have a problem with some values not being declared as XML elements in my XML files. But for further processing, I need them to be an element.
Example:
<A>
<B id="254">
...
0
votes
1
answer
88
views
Adding attributes with ascending integer values to XML elements only if they have children
I want to add the add attribute 'id="number"' to an existing file.
id attributes should only be added if the element has at least one child.
So right now my XML file looks like this:
<...
0
votes
1
answer
103
views
Adding attributes with ascending integer values to XML elements
I want to add the add attribute 'id="number"' to an existing file. But the number should be ascending in the way they are added.
So right now my XML file looks like this:
<Invoice>
...
1
vote
1
answer
131
views
Can two xsi:type attributes exist in the same element?
Within XML there exits elements and attributes. There is a special attribute called xsi:type. Can an element have two xsi:type declarations? Example using Dublin Core.
Element Example
<dc:date>...
1
vote
3
answers
459
views
one2many field view - attribute
I have the following wizard structure [ field name and data type ]
Type :- Selection :- Type 1 and Type 2
Route :- One2many
When Users select Type 1, I want to allow them to add records in the Route ...
0
votes
2
answers
123
views
Retrieve XML values by attribute
public string[] UnpackXML(string xml_string)
{
string response = xml_string;
string[] return_values = new string[6];
XmlDocument xml = new XmlDocument();
xml.LoadXml(response);
...
0
votes
1
answer
153
views
how to parse XML with namespace and attribute in Python?
hi I am trying to parse xml with namespace and attribute.
I am almost close by using root.findall() and .get()
However still struggling to get the accurate values from xml file.
How to get the xml ...
0
votes
1
answer
58
views
PHP - I would like to return values of attributes from xml file and retrieve their value from a predefined array
If I println($values) I will get the results of the correct attributes for each file fully written as shown in array as key on left but I would like to run the results against the array (valuesCodes) ...
0
votes
1
answer
1k
views
PowerShell - Export to Excel - How to Add Column for File Name
My code currently goes through a list of folders/subdirectories looking for '.csproj' files. The properties "Include" and "Version" are taken from the found .csproj file(s) and are ...
1
vote
2
answers
116
views
Powershell - Can't Collect and Compile XML attributes into an Excel File
I'm aiming to accomplish the following with a PowerShell script. Most sub folders in "C:\Example-Path\src" contain a single .csproj file that includes a "Property Include" and &...
0
votes
0
answers
128
views
How to write xml file without encoding utf-8 to HTML entity in PHP DOMDocument?
I'm creating hacking lab(XML injection) and i want to save the text as it is
for example:
input text: tryingtoattack"
but DOMDocument encoding the quotes(or any spacial char) like this
output ...
0
votes
1
answer
62
views
How to serialize XML with collections of nodes using Xml Attributes
I'm trying to serialize Xml using the XmlSerializer and by using its attributes.
My problem is that I'm not getting the data of the EVENT items.
I'm not fully aware of how to treat the combination ...
0
votes
0
answers
238
views
access xml node attributes inside a foreach loop
I have an XML string obtained as response of SoapClient request (I have also tried with cURL)
I then use:
$xml = simplexml_load_string($result);
I am able to obtain the attributes of a node inside $...
-1
votes
1
answer
120
views
How to retrieve the attribute values from the tags in XML File
Edit: Updated the XML file
Requirement:
Need to read attribute name value from all the tag.
Sample XML FIle:
<ObjectConfig>
<ObjectAttribute name="A">
<ListenerRule&...
1
vote
1
answer
300
views
Converting Excelsheet into XML file with XML elements having attributes
I am new to VBA and to use VBA on excel and write a macro to export an xml file per row (see the example in the print screen): Excel Example
The Account should be an XML element and the transactionID ...
1
vote
1
answer
1k
views
How to Deserialize XML to C# Object using XML attributes
Worked with Json until now.
Now I get an XML as data source and I would like to Deserialize it into C# objects using the XML attributes.
The problem, as I see it is that I would like to serialize the ...
0
votes
1
answer
316
views
How to insert multiple attributes to an element node with Xquery?
How is each individual writer given a distinct attribute, so that one of the examples below would have multiple write attribute nodes?
desired output:
<writers writer="n"></writers&...
0
votes
2
answers
966
views
How to use Xpath and Xquery to extract text() from an attribute?
Trying to query e-mail addresses using xpath and xquery but am not getting any results when
simple query:
xquery version "3.1";
for $contact in db:open("sample")
return $contact
...
0
votes
1
answer
304
views
How do I get multiple value of single xml element while deserializing xml to c# object?
I am getting xml data from xml file to c# object which looks like below:
Xml:
<OrderItem>
<OrderItemCode>1234</OrderItemCode>
<ASIN>dfsdfcs</ASIN>
...
1
vote
2
answers
3k
views
Maximum attribute size limit (65536) exceeds. Mulesoft
I am sending an XML payload to a webservice and capturing the response payload in dataweave transformer. For some payload data, I am getting the expected response, but for some of them, I am getting ...
2
votes
2
answers
1k
views
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 ...
1
vote
1
answer
77
views
Send XML attributes along with Elements via ajax to C# controller method and parse to save
Normally XML elements to get edited on web page are sent over as the input name
Example :
Then In C# controller method:
List<string> keys = Request.Form.Keys.Cast<string>().Where(item =>...
0
votes
1
answer
531
views
Serialize class properties with their types automatically
My boss have a strange request, he wants me to add a new function to serialize and deserialize all our products classes and add in the XML file all their property's types automatically.
I can't modify ...
2
votes
1
answer
388
views
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 ...
5
votes
1
answer
5k
views
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 ...
1
vote
0
answers
53
views
XMLELEMENT group of attributes
we are able to generate the XML structure shown below, where the data is linear with no grouping with respect to the models.
<transaction>
<header>
<trantype>siv</...
0
votes
3
answers
1k
views
PowerShell - xpath for Case Insensitive XML attribute name
I have a XML where the attribute names can be combinations of lower-case and upper-case letters.
In the below example, 'datasource' attribute can have any number of lowercase and uppercase letters.
I ...
0
votes
2
answers
7k
views
Jackson XML with different element name and attributes under root tag
I'm new to Jackson XML and I have a requirement of constructing a Jackson XML with different element name and attributes but under same root element.
My Expected xml output
<item name="Whatever"&...
0
votes
2
answers
1k
views
Alternate option for onClick() for Radio Button in Android Studio
I have been trying to make a quizzing app using RadioGroups for each question having 4 options. I have made the app to calculate the score of the user by maintaining a pointer for both the correct and ...
1
vote
1
answer
935
views
Attribute "x" bound to namespace "xx" was already specified for element "xxx"
I have some test code snippet:
import groovy.xml.XmlUtil
import groovy.xml.StreamingMarkupBuilder
class Greet {
def name
Greet(who) { name = who[0].toUpperCase() +
who[1..-1] }
def salute() {
...
1
vote
2
answers
1k
views
How to parse XML with several Attributes and an options list
I have an XML file that looks something similar to this:
<root>
<data label="product data" min="0" max="10">
<option>
<id>1</id>
<...
-3
votes
3
answers
2k
views
Serialize XmlAttribute which is an empty string [closed]
I got a class which represents a soccerplayer:
public class PlayerExtended
{
[XmlAttribute("id")] public string Id { get; set; }
[XmlAttribute("shortName")] public string ShortName { get; set;...
1
vote
1
answer
710
views
What is the XPath to get value if attribute is equal only to one of two possible values
Having the XML
<node attribute="value1">text</node>
what would be the XPath to extract the text if attribute is value1 or value2? For any other attribute value I'm expecting no match.
...
0
votes
1
answer
369
views
fasterxml serialization of an attribute
I'm using fasterxml 2.9.4 per the below and trying to serialise the CurrencyAndAmount class inside a parent class as:
<ParentClass Currency="USD">100000</ParentClass>
But instead I am ...
5
votes
2
answers
3k
views
Writing XML attributes and namespace declarations in a specific order
I am trying to make an XML file with a root element:
<urn:Command complete="true" xmlns:urn="namespaceURI">
So I have an element Command
a namespace namespaceURI
a prefix urn
and finally an ...
0
votes
2
answers
2k
views
How to correctly access xml attributes using pugixml?
I'm new to xml, and using the pugixml documentation I haven't been able to read a node attribute to the console. The core of the issue is that I don't understand how the node accessing structure works ...
0
votes
2
answers
95
views
XML-Code Change Value of Node - How is the displayed Code correct?
I Need to Code an XML-File in C# using XMLDocument. I extract the desired XML-File and only Need to insert some Elements i Need to add.
The EXPECTED Output should look like this:
<service>
&...
0
votes
0
answers
71
views
Add XML attribute or element to a collection element using serialization
How should my class look like to serialize to/from a XML like this
<root>
<MyCollection ColDetails="val1">
<Col_Obj>
<Prop1>xxxx</Prop1>
<...
1
vote
0
answers
96
views
Is there a way to force exact URL in XmlTypeAttribute.TypeName?
I need to implement calls to some service that provider refuses and/or is unable to give WSDL for...
I have trouble with Serializing to XML.
URL in XmlTypeAttribute.TypeName gets encoded.
Since I ...