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.

 

From: Martin Mueller [mailto:martin.mueller@mac.com]
Sent: Monday, June 07, 2010 05:22 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: [saxon] baffled by SAXON in oXygen

 

 

I'm completely baffled by the following.

 

Saxon HE 9.2.0.6 embedded in oXygen works as expected when the xquery fragment

 

 

doc('headersample.xml')/HEADER//TITLE

 

is applied to the document headersample.xml

 

<HEADER><FILEDESC>
<TITLESTMT>
<TITLE TYPE="245">Gods vvarning to his people of England. By the great ouer-flowing of the vvaters or floudes lately hapned in South-wales and many other places. Wherein is described the great losses, and wonderfull damages, that hapned thereby: by the drowning of many townes and villages, to the vtter vndooing of many thousandes of people.</TITLE>
<AUTHOR>Jones, William, of Usk.</AUTHOR>
</TITLESTMT>
<EXTENT>8 600dpi TIFF G4 page images</EXTENT>
<PUBLICATIONSTMT>
<PUBLISHER>University of Michigan, Digital Library Production Service</PUBLISHER><PUBPLACE>Ann Arbor, Michigan</PUBPLACE>
<DATE>2001</DATE>
<IDNO TYPE="marc">99837006</IDNO>
<IDNO TYPE="stc">STC (2nd ed.) 10011.</IDNO>
<IDNO TYPE="vid">1310</IDNO>
<IDNO TYPE="DLPS">A00015</IDNO>
</PUBLICATIONSTMT>
</HEADER>

 

Now I take this document (or most of it) and turn it into a TEI P5 document:

 

<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_bare.rng" type="xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
 
<teiHeader>
   
<fileDesc>
     
<titleStmt>
         
<title>Gods vvarning to his people of England. By the great ouer-flowing of the vvaters or floudes lately hapned in South-wales and many other places. Wherein is described the great losses, and wonderfull damages, that hapned thereby: by the drowning of many townes and villages, to the vtter vndooing of many thousandes of people.</title>
         
<author>Jones, William, of Usk.</author>
     
</titleStmt>
     
<publicationStmt>
       
<p>Publication Information</p>
     
</publicationStmt>
     
<sourceDesc>
       
<p>Information about the source</p>
     
</sourceDesc>
   
</fileDesc>
 
</teiHeader>
 
<text>
   
<body>
     
<p>Some text here</p>
   
</body>
 
</text>
</TEI>

 

 

The command 

 

doc('minitei.xml')

 

produces the expected result and reproduces the entire document. But the command

 

doc('minitei.xml')/TEI//title

 

produces as its output only the xml declaration

 

<?xml version="1.0" encoding="UTF-8"?>

 

and the error message:

 

F [Xerces] Premature end of file.

 

It is clear from the former command that the doc function identifies the file properly. But I cannot figure out why the path expression fails.