On 07/06/2010 22:36, Houghton,Andrew wrote:

Make sure that you have defined xmlns="http://www.tei-c.org/ns/1.0" on the <xsl:transform> or <xsl:stylesheet> element, otherwise the XPath expression doc('minitei.xml')/TEI//title will not be using the correct namespace for the <TEI> and <title> elements, hence no match and you only get the XML declaration from the <xsl:output> element.

 

Andy.


I think the poster is using XQuery rather than XSLT, but just for the record: in XSLT, defining xmlns="http://www.tei-c.org/ns/1.0" on the <xsl:transform> or <xsl:stylesheet> element does not affect the meaning of unprefixed names in path expressions. Instead you should use xpath-default-namespace="http://www.tei-c.org/ns/1.0".

Michael Kay
Saxonica