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