Closed NADGIT closed 5 years ago
@NADGIT This is terrific—thank you! As for your comment on XSLT vs XQuery variables, you can set strong datatypes on the global kind of variable, but I think you just don’t type the FLWOR variables. Here is an example showing how to set a datatype on a global variable pointing to the Banksy collection for our SVG 2 Exercise, as a plural sequence of document nodes:
declare variable $banksyColl as document-node()+ := collection('/db/Assignments/banksyForSVG/');
You don’t have to set the datatype for your variables, but as @NADGIT is exemplifying here, it is always a good idea to use strong data typing where you can—and I really should be modeling this on my assignment page!
So... Uh, here it is. The XPath works pretty much the same in XQuery, though, so you could 'translate' this into XQuery if you like
`<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="xs math" xmlns:exslt="http://exslt.org/common" xmlns="http://www.w3.org/2000/svg" version="3.0">
</xsl:stylesheet>`