Jonathan duncanjonathan at YAHOO.CA
Tue May 29 20:52:53 UTC 2007

Hi Steve,

Steve Slevinski wrote:
> Hi Jonathan,
> The gloss should be a tag and not an attribute.  It looks like your
> example comes from the SignPuddle 1.0 export, which does not follow
> the DTD.  That's a defect.
> http://www.signbank.org/signpuddle/swml/swml-s.dtd
> Jonathan wrote:
>> I image that the "gloss" tag was meant so that there could be several
>> glosses per sign. Is this right? If it is so then the "symbol" tags
>> should be withing the "gloss" tag or else we won't know which
>> "symbol" tag belongs to which "gloss" tag.  It isn't enough that the
>> "gloss" tag come first.
> Each sign can have multiple glosses and multiple symbols.  The glosses
> and symbols are not directly related.  The symbols make up the sign. 
> And the gloss describes the sign in English words. 
> For example, the sign for the ASL number one has a single symbol, but
> multiple glosses.
> <sign>
>   <gloss>one</gloss>
>   <gloss>1</gloss>
>   <gloss>uno</gloss>
>   <symbol x="1" y="1">01-01-001-01-01-01</symbol>
> </sign>
I had misunderstood the reason for the gloss tag.  Thank you for the
explanation.  It makes sense to me know.
>> My other comment about SBML which I realized was made especially for
>> SignBank which I am sure works just fine.  But SBML uses comma
>> separated values.  Which are fine, I use them all them time.  But I
>> feel that they are out of context in an XML file.  As is I can load
>> the SBML into objects or a dataset but I still have to parse the
>> build and the sequence to get to the information.  But if each comma
>> separated value has it's own tag, it will load just as fast into an
>> object or dataset and I don't have to do any parsing to get at the
>> information.  So for a SignWriting exchange format, I strongly
>> suggest staying away from comma delimited strings.
> Hmm.  I can understand your feeling.  I'm not sure which style I'm
> going to use for STML.  I should probably use the verbose tag style,
> but I've never had a case where I was glad I chose the verbose style
> over the build format for SWML-S. 
Is this because you find it easier working with comma delimited
structures than objects?  I understand your point.  Especially if you
don't have an easy way to load the XML into the object or dataset.

This what I have figured out about XML so far.

The free IDE for Visual Basic, Microsoft Visual Basic 2005 Express
Edition, has a command line program that will analyze an XML file and
determine it's schema.  I was playing around with the SBML format a
while ago and using extensive search and replace,  converted it to an
all tag format.  See attached file sbml.xml

I didn't split up the detail though.  Then I ran it through XML Schema
Definition Tool to create the schema. See attached file sbml.xsd

Then I ran the schema specifying that I wanted it to give me a dataset
in VB.  See attached file sbml.vb
I used the System.Data.DataSet.ReadXml method.

I managed to import the whole ASL dictionary into my program this way.

It can also do classes for objects.
I did one for you.  See attached file sbml-object.vb
Then use the System.Xml.Serialization.XmlSerializer.Deserializer method
to read the XML file.

The code to load the SBML into the object is
        Dim mySbml As sbml
        ' Construct an instance of the XmlSerializer with the type
        ' of object that is being deserialized.
        Dim mySerializer As Xml.Serialization.XmlSerializer = New
        ' To read the file, create a FileStream.
        Dim myFileStream As IO.FileStream = _
        New IO.FileStream("E:\Mis Documentos\Jonathan\Visual Studio
2005\Projects\Handwriting\IMWA\bin\Debug\sbmlnew.xml", IO.FileMode.Open)
        ' Call the Deserialize method and cast to the object type.
        mySbml = CType( _
        mySerializer.Deserialize(myFileStream), sbml)

The results of the object look like the attached file "Loaded SBML
object.png".  Then you can use code to work with the object just as you
would any other object.

It is just as easy to go the other way too.  Object or Dataset to SBML.

With the xsd.exe utility, you can also choose from *CS* (C#, which is
the default), *VB* (Visual Basic), *JS* (JScript), or *VJS* (Visual J#).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbml.xml
Type: text/xml
Size: 612 bytes
Desc: not available
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment.xml>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sbml.xsd
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sbml.vb
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sbml-object.vb
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment-0002.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Type: image/png
Size: 7960 bytes
Desc: not available
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Loaded SBML object.PNG
Type: image/png
Size: 52287 bytes
Desc: not available
URL: <http://listserv.linguistlist.org/pipermail/sw-l/attachments/20070529/b2aa08c4/attachment-0001.png>

More information about the Sw-l mailing list