[Jslib] Some bugs / Unexpected behaviour with RDF

Bryce Solomons bryce.solomons at eyede.com
Mon Aug 15 12:32:05 EDT 2005


I have been working with jslib for the last week and have come accross 
some unexpected behaviour / some tweaks to jslib that could improve it's 
Below is a small rdf text i am using for my test chrome application.
<?xml version="1.0" encoding="UTF-8"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Seq xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns="urn:record#" xmlns:db="urn:db#" about="urn:db:metadata">
  <RDF:li resource="urn:db:result"/>
<RDF:Description xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns="urn:record#" xmlns:db="urn:db#" about="urn:db:result">
  <db:text_status>2 records found</db:text_status>
xmlns="urn:record#" xmlns:db="urn:db#" about="urn:records">
  <RDF:li resource="urn:record:id:11"/>
  <RDF:li resource="urn:record:id:24"/>
<RDF:Description xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  <DataTypeID xmlns="urn:record#">11</DataTypeID>
  <DBFieldName xmlns="urn:record#">test</DBFieldName>
  <ReadableName xmlns="urn:record#">Test Field</ReadableName>
  <FieldType xmlns="urn:record#">text</FieldType>
  <FieldLength xmlns="urn:record#">20</FieldLength>
  <FieldDefault xmlns="urn:record#">0</FieldDefault>
  <MarkupAttrib xmlns="urn:record#">0</MarkupAttrib>
  <Autocomplete xmlns="urn:record#">0</Autocomplete>
  <Option xmlns="urn:record#">0</Option>
  <OptionDB xmlns="urn:record#">0</OptionDB>
<RDF:Description xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  <DataTypeID xmlns="urn:record#">24</DataTypeID>
  <DBFieldName xmlns="urn:record#">sdfds</DBFieldName>
  <ReadableName xmlns="urn:record#">sdgfsdf</ReadableName>
  <FieldType xmlns="urn:record#">sdffgsd</FieldType>
  <FieldLength xmlns="urn:record#">23</FieldLength>
  <FieldDefault xmlns="urn:record#">sdf</FieldDefault>
  <MarkupAttrib xmlns="urn:record#"></MarkupAttrib>
  <Autocomplete xmlns="urn:record#"></Autocomplete>
  <Option xmlns="urn:record#"></Option>
  <OptionDB xmlns="urn:record#"></OptionDB>

My first bug is the inability for the getAllAttributes to return a null 
value field. Record 11 i added 0's and they get returned. Record 24 
drops off the last 4 attributes. Not a biggy but maybe this could be 
My second bug is found in the writing back / updating of values. Now the 
below RDF is a sample showing the basic structure of my graph.

<?xml version="1.0"?>
<RDF:RDF xmlns:SNS="urn:records#"
  <RDF:Description RDF:about="urn:records:id:18"
                   SNS:FieldDefault="sdf" />
   <RDF:Seq RDF:about="urn:records">
    <RDF:li RDF:resource="urn:records:id:18"/>

I have a XUL template setup to read this data fine. Now what happens is 
that the getAttribute function will return false on SNS:{anything} thus 
when calling a setattribute it will always write in a new record. 
getAllAttributes does some splitting (arclabels) of the name and does 
return them but without the SNS:. If i set the attributes name to just 
DataTypeID="18" it all works fine. As it is i am just using the get all 
and set all functionality as i am updating all attributes anyway.
If anyone has some suggestions about these issues please let me know. I 
could just be doing things incorectly as i am rather new to the whole 
chrome rdf / xul area.

Bryce Solomons
Web Technologies Developer

More information about the Jslib mailing list