Thread overview
kxml help.
May 09, 2013
Zz
May 09, 2013
John Colvin
May 09, 2013
Zz
Jul 08, 2015
Sergey
May 09, 2013
Hi,

I decided to try out kxml and I have the following error.

test.d(10): Error: found '.' when expecting ','
test.d(11): Error: found '.' when expecting ','

when the following is compiled.

module test;

import kxml.xml;
private import std.string;
private import std.stdio;

void main()
{
	auto node = new XmlNode();
	node.addChild(new XmlNode("mynode").setAttribute("x", 50).
		addChild(new XmlNode("Waldo").addCData("Hello!")));
}


---------
it's taken out of an example in the code.

Zz
May 09, 2013
On Thursday, 9 May 2013 at 19:32:44 UTC, Zz wrote:
> Hi,
>
> I decided to try out kxml and I have the following error.
>
> test.d(10): Error: found '.' when expecting ','
> test.d(11): Error: found '.' when expecting ','
>
> when the following is compiled.
>
> module test;
>
> import kxml.xml;
> private import std.string;
> private import std.stdio;
>
> void main()
> {
> 	auto node = new XmlNode();
> 	node.addChild(new XmlNode("mynode").setAttribute("x", 50).
> 		addChild(new XmlNode("Waldo").addCData("Hello!")));
> }
>
>
> ---------
> it's taken out of an example in the code.
>
> Zz

You just need brackets around the new statements:

node.addChild((new XmlNode("mynode")).setAttribute("x", 50).
> 		addChild((new XmlNode("Waldo")).addCData("Hello!")));
May 09, 2013
Thanks

On Thursday, 9 May 2013 at 20:26:28 UTC, John Colvin wrote:
> On Thursday, 9 May 2013 at 19:32:44 UTC, Zz wrote:
>> Hi,
>>
>> I decided to try out kxml and I have the following error.
>>
>> test.d(10): Error: found '.' when expecting ','
>> test.d(11): Error: found '.' when expecting ','
>>
>> when the following is compiled.
>>
>> module test;
>>
>> import kxml.xml;
>> private import std.string;
>> private import std.stdio;
>>
>> void main()
>> {
>> 	auto node = new XmlNode();
>> 	node.addChild(new XmlNode("mynode").setAttribute("x", 50).
>> 		addChild(new XmlNode("Waldo").addCData("Hello!")));
>> }
>>
>>
>> ---------
>> it's taken out of an example in the code.
>>
>> Zz
>
> You just need brackets around the new statements:
>
> node.addChild((new XmlNode("mynode")).setAttribute("x", 50).
>> 		addChild((new XmlNode("Waldo")).addCData("Hello!")));

July 08, 2015
Hello!

I try to use KXML and I need very simple: check an entire XML document for well-formedness. How is it better to do?

Thanks in advance.