Archives by Tag 'XML'
XML deserialization, XML undefined property becomes an empty list
When deserialize XML into object, the object’s property becomes an empty list even if the property is absence from the XML, the expected behavior is the property is null.
For example, given a class
public class MyFoo
{
public string Id { get; set; }
[XmlArrayItem(“Name”)]
public [...]
XSLT 1.0, Join a list of elements’s value with separator
In order to join a sequence with a customized separator in XSLT 1.0, similar to C# function string.Join( array, separator), I’ve come up with a template which takes the sequence and separator as parameter.
Given a sample XML
<?xml version=”1.0″ encoding=”utf-8″ ?>
<?xml-stylesheet type=”text/xsl” href=”ElementJoin.xslt”?>
<Root>
<Years>
<int>2008</int>
<int>2009</int>
<int>2010</int>
</Years>
<Technologies>
<Java>SUN</Java>
[...]
