What is xsd line in Scribble protocol file?

58 Views Asked by At

I have this simple Hello world code from here, and can't find what does line xsd mean, and how to use it. Where is this file located and is it necessary?

module scribble.example.Basic;

type <xsd> "{http://scribble.org/examples}Greetings" from "HelloWorld.xsd" as Greetings;

global protocol HelloWorld (role Me, role World) {
    hello(Greetings) from Me to World;
    hello(Greetings) from World to Me;
}
1

There are 1 best solutions below

1
muehsi On BEST ANSWER

XSD is XML schema definition. It defines how your XML documents looks like. Also see page on w3schools. The file is located wherever you want.

From Scribble Readme:

The part between < > identifies the nature of the type, in this case it is an XSD (XML Schema Definition). The next part, which is in double quotes, identifies the type in a format appropriate for the schema. The from value (also in double quotes) represents the location of the schema definition. Finally the as value is an alias which the protocol will use to reference this type.

Since you want do define a protocol, this is necessary. Otherwise, using scribble does not make sense at all (in my opinion).