Oldest elephant trap in the XML world, I'm afraid. You can't ignore namespaces when using XPath expressions. You need something like

declare default element namespace "http://www.tei-c.org/ns/1.0";

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

Michael Kay

Saxonica



On 07/06/2010 22:21, Martin Mueller wrote:

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. 


------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help