We just got bit by a bug in our MarkLogic code that was hiding there because we 
don't usually process data in the XHTML namespace. Given a database that 
included an XHTML namespace document with the element <div class="footnote 
explanatory"> ... </div>, applying the following XSLT produces an error:

   <xsl:template match="xhtml:div[@class eq 'note-para']"/>

Reason being, as I realized when I looked into things, that the default 
MarkLogic configuration binds the XHTML 1.1 schema to any XML content in the 
XHTML namespace (via Admin console Configure/Groups/Default/Schemas), and the 
data type of XHTML @class is NMTOKENS, so the above template tries to evaluate

   ('footnote','explanatory') eq 'note-para'

and throws a run-time error because the 'eq' operator compares atomic values 
only.

The code-fix is no problem (use '=', or else [string(@class) eq 'note-para']), 
but now I'm worried that there are other similar places in our code where we're 
not considering the schema-defined data types for XHTML. We could delete the 
default schema binding, but that would have very nasty side effects if there is 
any built-in MarkLogic code that expects typed values for XHTML data.

Any other options besides hunting through zillions of lines of code for similar 
cases?

-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: [email protected]   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to