111,097
社区成员




<fulltext-file>
<jats:object-id pub-id-type="roid">RO201909193412970ZX.pdf</jats:object-id>
<jats:object-id pub-id-type="uri"><![CDATA[https://ttu-ir.tdl.org/handle/2346/84945]]></jats:object-id>
<jats:object-id pub-id-type="download_uri"><![CDATA[https://ttu-ir.tdl.org/bitstream/handle/2346/84945/1/ICES-2019-178.pdf?sequence=1&isAllowed=y]]></jats:object-id>
</fulltext-file>
public class CData : IXmlSerializable
{
private string m_Value;
public CData()
{
}
public CData(string p_Value)
{
m_Value = p_Value;
}
public string Value
{
get
{
return m_Value;
}
}
public void ReadXml(XmlReader reader)
{
m_Value = reader.ReadElementContentAsString();
}
public void WriteXml(XmlWriter writer)
{
writer.WriteCData(m_Value);
}
public XmlSchema GetSchema()
{
return (null);
}
public override string ToString()
{
return m_Value;
}
public static implicit operator string(CData element)
{
return (element == null) ? null : element.m_Value;
}
public static implicit operator CData(string text)
{
return new CData(text);
}
}
public class FullText
{
[XmlElement("object-id", Namespace = "http://jats.nlm.nih.gov/archiving/1.1/xsd")]
public CData object_id { get; set; }
}
res.record.fulltext_file.object_id = "abc123";
<fulltext-file>
<jats:object-id><![CDATA[abc123]]></jats:object-id>
</fulltext-file>
<fulltext-file>
<jats:object-id pub-id-type="roid">RO201909193412970ZX.pdf</jats:object-id>
<jats:object-id pub-id-type="uri"><![CDATA[https://ttu-ir.tdl.org/handle/2346/84945]]></jats:object-id>
<jats:object-id pub-id-type="download_uri"><![CDATA[https://ttu-ir.tdl.org/bitstream/handle/2346/84945/1/ICES-2019-178.pdf?sequence=1&isAllowed=y]]></jats:object-id>
</fulltext-file>
public class object_ID
{
[XmlElement("pub-id-type")]
public string pub_id_type { get; set; }
[XmlText]
public CData value { get; set; }
public object_ID() { }
public object_ID(string type, string value)
{
this.pub_id_type = type;
this.value = value;
}
}
最终在序列化的时候 value出会提示CData类型的value序列化失败