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
    http://www.w3.org/TR/xslt#section-Result-Tree-Fragments
    -------------------------------------------------
    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
implementation.
  There are workarounds like the exslt:node-set extension function, 
    http://www.exslt.org/exsl/functions/node-set/

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


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