OutputURIResolver Cause: net.sf.saxon.trans.X

Help
Ray
2012-02-20
2012-10-08
<< < 1 2 (Page 2 of 2)
  • Michael Kay

    Michael Kay - 2012-04-12

    You don't appear to have any logic in your stylesheet to ensure that the names
    of output documents are unique.

     
  • Anonymous - 2012-04-12

    Thank you Michael for taking the trouble to write back.
    For your info, here is the XSL template that looks after that:



    <xsl:template name="transform-title">

    <xsl:param name="xtrc"/>

    <xsl:param name="href"/>
    <xsl:choose>

    <xsl:when test="document($ditamap-file)//topicref/@href = 'ErrorMap.xml'">
    <xsl:variable name="topic-position" select="substring-after(string(@xtrc), 'topicref:')"/>
    <xsl:text>ERROR=</xsl:text><xsl:value-of select="document(concat('file:///', $export-path, '\\', $ditamap, '.xml'))//topicref/@navtitle"/><xsl:value-of select="count(document($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:when>
    <xsl:when test="string(document($ditamap-file)//topicref/@navtitle)">

    <xsl:variable name="translated-title" select="document($ditamap- file)//topicref/@navtitle"/>
    <xsl:variable name="topic-href" select="document($ditamap- file)//topicref/@href"/>
    <xsl:variable name="English-title" select="document(concat('file:///', $WORKDIR, '\\', substring-before($topic-href,'.xml'), '.met'))//ishfield"/>
    <xsl:variable name="normalized-navtitle" select="normalize-space($English- title)"/>
    <xsl:variable name="remove-space" select="translate($normalized-navtitle,' ','-')"/>
    <xsl:variable name="remove-characters" select="translate($remove-space, "&amp;apos ;™–® \/:*?� 3C;&gt;|’", "")"/>
    <xsl:variable name="remove-quotes" select="translate($remove-characters, '"', '')"/>

    <xsl:variable name="title">
    <xsl:choose>
    <xsl:when test="$translated-title = document($ditamap- file)//topicref/preceding::topicref/@navtitle">
    <xsl:choose>
    <xsl:when test="document($ditamap- file)//topicref/preceding::topicref/ancestor::topicref and not(document ($ditamap-file)//topicref/preceding::topicref)">
    <xsl:value-of select="$remove-characters"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$remove-characters"/><xsl:value-of select="count(document($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$remove-characters"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    <xsl:value-of select="$title"/>
    </xsl:when>
    <xsl:when test="string(document($ditamap-file)//topicref/@navtitle)">
    <xsl:variable name="translated-title" select="document($ditamap- file)//topicref/@navtitle"/>
    <xsl:variable name="English-title" select="document(concat('file:///', $WORKDIR, '\\', substring-before($href,'.xml'), '.met'))//ishfield"/>
    <xsl:variable name="normalized-navtitle" select="normalize-space($English- title)"/>
    <xsl:variable name="remove-space" select="translate($normalized-navtitle,' ','-')"/>
    <xsl:variable name="remove-characters" select="translate($remove-space, "&amp;apos ;™–® \/:*?� 3C;&gt;|’", "")"/>
    <xsl:variable name="remove-quotes" select="translate($remove-characters, '"', '')"/>

    <xsl:variable name="title">
    <xsl:choose>
    <xsl:when test="$translated-title = document($ditamap- file)//topicref/preceding::topicref/@navtitle">
    <xsl:choose>
    <xsl:when test="document($ditamap- file)//topicref/preceding::topicref/ancestor::topicref and not(document ($ditamap-file)//topicref/preceding::topicref)">
    <xsl:value-of select="$remove-characters"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$remove-characters"/><xsl:value-of select="count(document($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$remove-characters"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    <xsl:value-of select="$title"/>
    </xsl:when>

    <xsl:otherwise>
    <xsl:choose>
    <xsl:when test="document($ditamap-file)//topicref/preceding::topicref">
    <xsl:value-of select="'no-title'"/><xsl:value-of select="count(document ($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:when>
    <xsl:when test="document($ditamap-file)//topicref/preceding::topicref">
    <xsl:value-of select="'no-title'"/><xsl:value-of select="count(document ($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="'no-title'"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    Please could you advise if the following snippet of XSL code needs to be
    adjusted a bit?

    <xsl:otherwise>
    <xsl:choose>
    <xsl:when test="document($ditamap-file)//topicref/preceding::topicref">
    <xsl:value-of select="'no-title'"/><xsl:value-of select="count(document ($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:when>
    <xsl:when test="document($ditamap-file)//topicref/preceding::topicref">
    <xsl:value-of select="'no-title'"/><xsl:value-of select="count(document ($ditamap-file)//topicref/preceding::topicref)"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="'no-title'"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:otherwise>
    </xsl:choose>

    thank you

     
  • Anonymous - 2012-04-13

    Hi Michael
    I am very pleased that tell you that I have just succeed in solving
    the OutputURIResolver Cause:net.sf.saxon.trans.XPathException:
    Resolved URL is malformed problem. Specifically, I applied generate-id() to
    the transformed title template to make 'no-title' unique. I should not have
    succeeded at all, if your folk did not direct me gratually toward the root
    cause of that problem.

    Thank you so much!

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.