Re: [xslt] Question concerning paths

On Thu, Nov 22, 2007 at 03:49:39PM +0100, Marc Heinz wrote:
> xsltProcessOneNode: applying template '/' for /
> xsltApplySequenceConstructor: copy node Presentation
> call-template: name getAuthor
> applying xsl:template 'getAuthor'
> xsltValueOf: select $metaDoc/office:document-meta/office:meta/dc:creator
> Lookup variable 'metaDoc'
> found variable 'metaDoc'
> XPath error : Invalid type
> [...]
> Obviously the real problem is caused by the "Invalid Type Error".
> Could it be a concatenation problem in the following statement:
> select="$metaDoc/office:document-meta/office:meta/dc:creator"
> If so, why should I do?

  Your stylesheet is incorrect, it's not compliant to XSLT-1.0
    Variables introduce an additional data-type into the expression language. This additional data type is called result tree fragment....
    An operation is permitted on a result tree fragment only if that operation would be permitted on a string...

  you just can't apply '/office:document-meta/office:meta/dc:creator' to
a string value, so you can't apply it to a variable value.

The stylesheet you are using was developped against a non-conformant XSLT-1.0
  There are workarounds like the exslt:node-set extension function,


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]