Questions tagged [xml-nil]

About XML nil attributes

From W3C

XML Schema:Structures introduces a mechanism for signaling that an element should be accepted as "valid" when it has no content despite a content type which does not require or even necessarily allow empty content. An element may be "valid" without content if it has the attribute xsi:nil with the value true. An element so labeled must be empty, but can carry attributes if permitted by the corresponding complex type.

70 questions
1
vote
1 answer

How to convert XML to hash in Rails where empty array and nil values are preserved

When I convert an XML structure to hash with Hash.from_xml(@xml) in Rails, the parser does not distinguish between empty arrays and nil values, whereas the XML depicts nodes that are immediately terminated with \ to be empty arrays, e.g.…
chinshr
  • 55
  • 1
  • 9
1
vote
1 answer

Xml Format Error

I encountered a nullable property issue in my C# webservice project. public class Header { [DataMember] public long Id { get; set; } [DataMember] public long SportId { get; set; } [DataMember] public long TournamentId { get;…
erkan demir
  • 1,386
  • 4
  • 20
  • 38
1
vote
3 answers

What XML do I send for a field thats declared as nillable?

I have an application with a REST style interface that takes XML documents via POST from clients. This application is written in Java and uses XML beans to process the posted message. The XML schema definition for a field in the message looks like…
Rangachari Anand
  • 962
  • 7
  • 10
0
votes
1 answer

Can you add additional properties to .NET serialized NULL values?

In .NET, you can serialize a nullable element using XmlElement( IsNullable = true ), which results in this: . However, I need to be able to add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance after any field that…
Jaden
  • 179
  • 2
  • 2
  • 11
0
votes
1 answer

How to find nil elements through xml xpath via php

I have some elements that are nil. The returned elements are in a timestamp and I want to turn all the nil elements to a current date using getdate(). I'm sorry if im not using the right terminology or asking the right questions, feel free to edit…
ToddN
  • 2,901
  • 14
  • 56
  • 96
0
votes
1 answer

xsi:nil fails validation when parsed within an xs:any

I have a schema containing (for example)... ... and some XML containing this element...
Erad
  • 1
  • 3
0
votes
1 answer

Detecting XML nil in SQL Query

I'm using MS SQL Server 2008. I have a column of type XML that I am storing the result of some serialization. When the value of the object being serialized is nothing/null this result is stored in the database,
Kratz
  • 4,280
  • 3
  • 32
  • 55
0
votes
1 answer

How to remove xsi:nil="true using XMLBeans

While using XMLBeans to generate XML , xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gets inserted. For example : But i need only…
John
  • 125
  • 1
  • 3
  • 12
0
votes
1 answer

How to control XML Serialization behavior on xsi:nill=

I'm working on a Webservice to share data between 2 ERP-systems. First ERP calls the webservice, which serializes the data-object and sends it to the second ERP. A data object looks like this:
think4ward
0
votes
1 answer

XMLWriter () Replace blank strings

I am using XMLWriter to create an XML output of my MySQL Database, and I would like to know how I could prevent this happening by doing this nil So basically replace "" with "nil".
max_
  • 24,076
  • 39
  • 122
  • 211
0
votes
2 answers

XDocument and reading xsi:nil="true" gives "String was not recognized as a valid DateTime"

Happily reading XML with var q2 = from c in xmlDoc.Descendants("Ticket") select new { Responded_Date = (DateTime)c.Element("Responded_Date") } However when the tag is I get "String was…
DingoCC
  • 159
  • 1
  • 2
  • 12
0
votes
2 answers

Generating XML nil='true' from SQL

I'm struggling to modify some SQL generation of XML. The following sample code generates 3 lines of output, the first 2 are correct, however, I need the 3rd to render out to a root element of xsi:nil=true. Many thanks. CREATE TABLE…
Jonnie
  • 101
  • 14
0
votes
1 answer

PHP Zend XML-RPC - Any way to disable the 'nil' in requests?

I'm using Zend XML-RPC Client library to send XML requests to another non-PHP XML RPC server.(it's a java JBoss install, but I don't have control to change it/patch it/hack it). One request I'm making has a element, which is a XML-RPC…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
0
votes
2 answers

xml validity with xsd with xsi:nillable element

My XML file String
Laxmikanth Samudrala
  • 2,203
  • 5
  • 28
  • 45
0
votes
0 answers

ruby xml parsing: `dup': can't dup NilClass (TypeError)

I am parsing xml recods using ruby. XML file has following data strcuture:
add-semi-colons
  • 18,094
  • 55
  • 145
  • 232