Sorry … I’did this a little dirty

I declared :

xmlns:dyn=”http://saxon.sf.net/

 

better

xmlns:saxon=”http://saxon.sf.net/

 

to have saxon:evaluate instead of dyn:evaluate.

 

 

Von: Michael Kay [mailto:mike@saxonica.com]
Gesendet: Freitag, 6. Juni 2014 11:45
An: Mailing list for the SAXON XSLT and XQuery processor
Betreff: Re: [saxon] how to importing / including namespaces from included XSL files?

 

Saxon doesn't support dyn:evaluate(), so please rephrase the question to indicate the code you are using with Saxon, and the Saxon version you are using.

 

The rules for dyn:evaluate state that the namespace context is taken from the stylesheet, not from the source document, and saxon:evaluate is similar. The new xsl:evaluate instruction in XSLT 3.0 (implemented in Saxon-PE 9.5) allows you to say where the namespace context is coming from, including the option of taking it from an element in the source document. XPath 3.0 also allows you to write XPath expressions that are independent of the namespace context by using the syntax Q{uri}local in place of prefix:uri.

 

 

Michael Kay

Saxonica

mike@saxonica.com

+44 (0118) 946 5893

 

 

 

On 6 Jun 2014, at 10:18, markus.sticker.epos@zf.com wrote:



Sorry, at first I used xsltproc now I tried Saxon 9.5 (no exslt) and Saxon 6.5.5

 

Von: markus.sticker.epos@zf.com [mailto:markus.sticker.epos@zf.com]
Gesendet: Freitag, 6. Juni 2014 10:59
An: saxon-help@lists.sourceforge.net
Betreff: [saxon] how to importing / including namespaces from included XSL files?

 

Hello,

OK. I'm sorry for my writing but its very strange what I'm doing to get a xPath processed. I'm using just the xsltproc, so only XSLT 1.0 and EXSLT are my tools.

I use one input xml file to get the further xml files which I have to also process. This causes that I do not know the prefixes and the namespace in the xsl I'm applying.

Futher I have to use "xPathes" (which are stored as attributes) out of my input xml file. So I have to use EXSLT to evaluate (dyn:evaluate function) xpathes on documents which are loaded to variables:

<xsl:variable name="importedDocument" select="document('importDoc.xml')" />

 

form the importDoc:

<?xml version='1.0'?>

  <bm:root xmlns:bm="http://my.bookmarks/ns/1.0" >

    ....

 

So after that I want to use a xpath ... something like that in my xslt:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"   version="1.0"

    xmlns:rs="http://ns.zf.com/xmlmerger/ruleset"

    xmlns:dyn="http://exslt.org/dynamic"

    xmlns:exsl="http://exslt.org/common"

    extension-element-prefixes="dyn rs exsl" >

 

    <xsl:include href="preparedXSL.xsl" />

 

   ....

 

     <xsl:variable name="xpath" select="bm:root/bm:bookmarks[4]/@xpath" />

     <xsl:for-each select="exsl:node-set($importedDocument)">

        <xsl:if test="dyn:evaluate($xpath)" >

          <xsl:value-of select="generate-id(dyn:evaluate($xpath))" />

        </xsl:if>

     </xsl:for-each>

 

But finally I got this message from

dyn:evaluate() : unable to evaluate expression 'bm:root/bm:bookmarks[4]/@xpath'

 

So I need something like "autoregister namespaces" ???
Or is it possible to use catalog files to fix that ???
Or maybe I can use some kinds of imports or includes ???

Best Regards

Markus

 

 

Mit freundlichen Grüßen/Kind regards

Markus Sticker
Forschung und Entwicklung ZF Konzern/Research and Development ZF Group
Infrastruktur/Infrastructure (DTEP4)

ZF Friedrichshafen AG
88038 Friedrichshafen, Deutschland/Germany
Telefon/Phone  +49 7541 77-7644, Telefax/Fax  +49 7541 77-907644

Markus.Sticker.Epos@zf.com


Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Prof. Dr. Giorgio Behr
Vorstand/Board of Management: Dr. Stefan Sommer (Vorsitzender/CEO), Dr. Konstantin Sauer, Jürgen Holeksa, Michael Hankel, Wilhelm Rehm, Rolf Lutz

Sitz/Headquarters: Friedrichshafen
Handelsregistereintrag Amtsgericht Ulm HRB 630206/Trade register of the municipal court of Ulm HRB 630206

 

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help