Menu

xsl:result-document and external C function

Help
DimSon88
2012-04-16
2012-10-08
  • DimSon88

    DimSon88 - 2012-04-16

    Hello.

    1) I'm little confused with using Saxon 9 and attemp to get several XML
    documents using function xsl:result document:
    <xsl:result-document href="Main_revision.xml">
    <xsl:apply-templates mode="copy-all" select="."/>
    </xsl:result-document>
    With another XSL processor it is all right. With Saxon 9 there are emplty
    document without any efforts about transformation.
    2) There are problems with external function from C.
    <xsl:value-of select="usr:generateGUID()"/>,
    and
    <ms:script language="C#" implements-prefix="usr">
    <![CDATA]>
    </ms:script>
    I have got error:
    Error at xsl:value-of on line 50 column 72 of Identification_tegs.xsl:
    XPST0017: XPath syntax error at char 18 on line 50 in {usr:generateGUID()}:
    Cannot find a matching 0-argument function named {urn:the-xml-
    files:xslt}generateGUID()
    Failed to compile stylesheet. 1 error detected.
    With another XSL processor it is all right.

    Could you tell me it's some kind of bug or anything else?

    Thank you.

     
  • Michael Kay

    Michael Kay - 2012-04-16

    (1) With regard to the empty output documents, you haven't supplied enough
    information to determine the cause. There are a number of features in the
    specification that are implementation-defined, so there are legitimate reasons
    why different processors will sometimes produce different results.

    (2) The ms:script extension is a Microsoft-specific language extension to
    XSLT, and is not implemented by Saxon. For information on how to call C# code
    from Saxon, please see here:

    http://www.saxonica.com/documentation/extensibility/intro.xml

     
  • DimSon88

    DimSon88 - 2012-04-16

    Thanks a lot.
    1) Problem was in Altova XML Spy comand line. I used windows comand line and
    it began to work correctly.
    2) Use Java instead of C.
    xmlns:uuid="java.util.UUID"
    <xsl:value-of select="uuid:randomUUID()"/>