I'm not sure I'm getting your messages in the right order, so I'm not sure where you currently stand with this problem.

I can't execute this stylesheet as supplied, because it imports a module I don't have access to. In fact, the xsl:import will never work with Saxon because it uses a Windows file name in the href attribute when it should use a URI.

If I remove the xsl:import, though, the stylesheet executes under Saxon 6.5.5, and it appears to produce the correct output.

With Saxon 9.2.1.2, it complains about the unsupported extension function set:distinct; if I replace this directly with a call on the standard XSLT 2.0 function distinct-values(), it executes correctly and produces the same output as the 6.5.5 version.

So, I'm not quite sure what your problem is, but I don't seem to be able to reproduce it.

There's a separate question about why you are writing the code the way you are. Your use of disable-output-escaping to construct a start tag "by hand" suggests that you are groping in the dark trying to solve some fairly simple XSLT coding problem. A good place for xslt coding help is the xsl-list at mulberrytech.com.

Michael Kay
Saxonica

On 29/09/2010 2:29 PM, Burkert, Michael wrote:

OK

You are right.

With Saxon6.5.5 there is no error.

 

Today I exchange saxon9 with saxon9.2.

Both with the problem. I test it again.

 

 

 

 

 

Xml-Code is:

 

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

<Welt>

                <Kontinente>

                               <Kontinent name="europa">Europa

                                               <Laender>

                                                               <Land name="deutschland">Deutschland

                                                                              <Staedte>

                                                                                              <Stadt name="stuttgart" plz="70000">Stuttgart

                                                                                              </Stadt>

                                                                                              <Stadt name="muenchen">Muenchen

                                                                                              </Stadt>

                                                                                              <Stadt name="berlin">Berlin

                                                                                              </Stadt>

                                                                              </Staedte>

                                                               </Land>

                                               </Laender>

                               </Kontinent>

                </Kontinente>

</Welt>

 

 

 

Xslt (reduced to relevant )

Unfortunately, there are fixed file positions.

 

 

<?xml version="1.0"?>

<xslt:stylesheet version="1.0"

                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

    xmlns:owl="http://www.w3.org/2002/07/owl#"

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

    xmlns:str="http://exslt.org/strings"

    xmlns:st="http://xsltsl.org/string"

    xmlns:set="http://exslt.org/sets"

    xmlns:xslt="http://www.w3.org/1999/XSL/Transform">

              

           

               

    <xslt:import href="F:/web/xampp/htdocs/anw/xml2owl-0.1.1/libs/xsltsl-1.2.1/stdlib.xsl" />

 

                <xslt:output

                               xmlns:xslt="http://www.w3.org/1999/XSL/Transform"

                               xmlns:xs="http://www.w3.org/2001/XMLSchema"

                               xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                               xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

                               xmlns:owl="http://www.w3.org/2002/07/owl#"

                               method="text" indent="yes"/>   

 

                <xslt:param name="ontologyLabel">This is a automatically by xml2owl generated ontology.</xslt:param>

                <xslt:param name="ontologyComment">Automatically created: Mon Sep 27 16:03:04 2010</xslt:param>

                <xslt:param name="modelPrefix" select="'model'"/>

                <xslt:param name="importURIsForInstances"/>

                                                                                             

                <xslt:variable

                               xmlns:xslt="http://www.w3.org/1999/XSL/Transform"

                               xmlns:xs="http://www.w3.org/2001/XMLSchema"

                               xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                               xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

                               xmlns:owl="http://www.w3.org/2002/07/owl#"

                               name="dtpPrefix">dtp</xslt:variable>

                <xslt:variable name="opPrefix">has</xslt:variable>

                <xslt:variable name="deb">0</xslt:variable>

                <xslt:variable name="instancesName">instances.owl</xslt:variable>

                <xslt:variable name="modelName">model.owl</xslt:variable>

                <xslt:variable name="namespace_uri">http://localhost/anw/xml2owl-0.1.1/tmp/4ca0a3f82ce7e</xslt:variable>

                <xslt:variable name="tmp_model_uri">http://localhost/anw/xml2owl-0.1.1/tmp/4ca0a3f82ce7e/model.owl</xslt:variable>

 

                <xslt:variable name="model_uri">

                               <xslt:choose>

                                               <xslt:when test="$tmp_model_uri = $importURIsForInstances">

                                                               <xslt:value-of select="$tmp_model_uri"/>

                                               </xslt:when>

                                               <xslt:otherwise>

                                                               <xslt:value-of select="$importURIsForInstances"/>

                                               </xslt:otherwise>

                               </xslt:choose>

                </xslt:variable>

                                                              

                <xslt:variable name="instances_uri">http://localhost/anw/xml2owl-0.1.1/tmp/4ca0a3f82ce7e/instances.owl</xslt:variable>

                                                                             

                <xslt:variable name="camelCase">false</xslt:variable>

                <xslt:variable name="targetPath">F:\web\xampp\htdocs\anw\xml2owl-0.1.1/tmp/4ca0a3f82ce7e</xslt:variable>

                <xslt:variable name="classesParam">Welt|Kontinente|Kontinent|Laender|Land|Staedte|Stadt|#Welt|#Kontinente|#Kontinent|#Laender|#Land|#Staedte|</xslt:variable>

                <xslt:variable name="opParam">Kontinente|Kontinent|Laender|Land|Staedte|Stadt|</xslt:variable>

                <xslt:variable name="dtpParam">name|plz|Content|</xslt:variable>

                <xslt:variable name="dtpContentDomain">Stadt|</xslt:variable>

 

<xslt:template

                xmlns:xslt="http://www.w3.org/1999/XSL/Transform"

                xmlns:xs="http://www.w3.org/2001/XMLSchema"

                xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

                xmlns:owl="http://www.w3.org/2002/07/owl#"

                match="/">

AAA-1

  <xslt:if test="$deb &gt; 1">

    <xslt:message>$classesParam: <xslt:value-of select="$classesParam"/></xslt:message>

    <xslt:message>$opParam: <xslt:value-of select="$opParam"/></xslt:message>

    <xslt:message>$dtpParam: <xslt:value-of select="$dtpParam"/></xslt:message>

    <xslt:message>$dtpContentDomain: <xslt:value-of select="$dtpContentDomain"/></xslt:message>

  </xslt:if>

  <xslt:call-template name="createInstances"/>

AAA-2

</xslt:template>

 

<xslt:template

                xmlns:xslt="http://www.w3.org/1999/XSL/Transform"

                xmlns:xs="http://www.w3.org/2001/XMLSchema"

                xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

                xmlns:owl="http://www.w3.org/2002/07/owl#"

                name="createInstances">

BBB-1

 

                               <xslt:text disable-output-escaping="yes">&lt;rdf:RDF

                        xmlns:owl="http://www.w3.org/2002/07/owl#"

                        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

                        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                               </xslt:text>

 

                        <xslt:for-each select="set:distinct(//namespace::*)">fff

                        </xslt:for-each>

 

 

BBB-2

 

</xslt:template>

                                                              

</xslt:stylesheet>

 

 

 

Greeting

Michael

 

 

 

 

 

 

 

 


Von: Michael Kay [mailto:mike@saxonica.com]
Gesendet: Mittwoch, 29. September 2010 14:32
An: saxon-help@lists.sourceforge.net
Betreff: Re: [saxon] For-each + text ?

 

On 29/09/2010 12:35 PM, Burkert, Michael wrote:

<xslt:for-each select="set:distinct(//namespace::*)"><xslt:text>result</xslt:text>

</xslt:for-each>

Which version of Saxon are you using? I don't think Saxon has supported the exslt set:distinct() function for a long time, because it was superseded by features such as distinct-values() in XSLT 2.0.

I tried your code snippet with Saxon 6.5.5, and it gave me the correct result.

So I think you need to provide more information: what version of Saxon are you running, what is your source document, and what is your stylesheet?

Michael Kay
Saxonica

------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help