Пример #1
0
        public void AddPredicateAndLiteralWithType(XmlNode subjectNode, string predicatePrefix, string predicateValue, string literal, ELiteralType literalType)
        {
            XmlNode      node      = _output.CreateNode(XmlNodeType.Element, predicatePrefix, predicateValue, _namespaces[predicatePrefix]);
            XmlAttribute attribute = null;

            switch (literalType)
            {
            case ELiteralType.XsdInteger:
                attribute = _output.CreateAttribute("xsd", "integer", _namespaces["xsd"]);
                break;

            case ELiteralType.XsdBoolean:
                attribute = _output.CreateAttribute("xsd", "boolean", _namespaces["xsd"]);
                break;

            case ELiteralType.XsdDateTime:
                attribute = _output.CreateAttribute("xsd", "dateTime", _namespaces["xsd"]);
                break;
            }
            if (attribute != null)
            {
                attribute.Value = literal;
                node.Attributes.Append(attribute);
            }
            subjectNode.AppendChild(node);
        }
Пример #2
0
 public void AddPredicateAndLiteralWithType(XmlNode subjectNode, string predicatePrefix, string predicateValue, string literal, ELiteralType literalType)
 {
     XmlNode node = _output.CreateNode(XmlNodeType.Element, predicatePrefix, predicateValue, _namespaces[predicatePrefix]);
     XmlAttribute attribute = null;
     switch (literalType)
     {
         case ELiteralType.XsdInteger:
             attribute = _output.CreateAttribute("xsd", "integer", _namespaces["xsd"]);
             break;
         case ELiteralType.XsdBoolean:
             attribute = _output.CreateAttribute("xsd", "boolean", _namespaces["xsd"]);
             break;
         case ELiteralType.XsdDateTime:
             attribute = _output.CreateAttribute("xsd", "dateTime", _namespaces["xsd"]);
             break;
     }
     if(attribute != null)
     {
         attribute.Value = literal;
         node.Attributes.Append(attribute);
     }
     subjectNode.AppendChild(node);
 }