XML: XSL: Unbounds Prefix

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tjerk Wolterink

    XML: XSL: Unbounds Prefix

    Hello i have an xml file and an xsl file:

    xml:


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

    <xc:xcontent xmlns:xc="http://www.wolterinkwe bdesign.com/xml/xcontent" xmlns="http://www.w3.org/1999/xhtml">
    <xc:bestand>
    <xc:id>6</xc:id>
    <xc:beschrijvin g type="string">[CDATA[betaal lijst 2]]</xc:beschrijving >
    <xc:file type="file" mime-type-image="/xcm/mime_types/unknown.png">[CDATA[betaallijst_hok .doc]]</xc:file>
    </xc:bestand>
    <xc:bestand>
    <xc:id>5</xc:id>
    <xc:beschrijvin g type="string">[CDATA[henk]]</xc:beschrijving >
    <xc:file type="file" mime-type-image="/xcm/mime_types/image.png">[CDATA[3defin.jpg]]</xc:file>
    </xc:bestand>
    <xc:bestand>
    <xc:id>8</xc:id>
    <xc:beschrijvin g type="string">[CDATA[film voorcafe]]</xc:beschrijving >
    <xc:file type="file" mime-type-image="/xcm/mime_types/video.png">[CDATA[voorcafédrietev ol.avi]]</xc:file>
    </xc:bestand>
    <xc:bestand>
    <xc:id>26</xc:id>
    <xc:beschrijvin g type="string">[CDATA[wrywry]]</xc:beschrijving >
    <xc:file type="file" mime-type-image="/xcm/mime_types/image.png">[CDATA[bocholt_derk.jp g]]</xc:file>
    </xc:bestand>
    <xc:bestand>
    <xc:id>13</xc:id>
    <xc:beschrijvin g type="string">[CDATA[pipoi]]</xc:beschrijving >
    <xc:file type="file" mime-type-image="/xcm/mime_types/postscript.png" >[CDATA[103290 Brief LicentScharenbo rg.eps]]</xc:file>
    </xc:bestand>
    <xc:bestand>
    <xc:id>24</xc:id>
    <xc:beschrijvin g type="string">[CDATA[etuetu]]</xc:beschrijving >
    <xc:file type="file" mime-type-image="/xcm/mime_types/image.png">[CDATA[1moehaha.jpg]]</xc:file>
    </xc:bestand>
    </xc:xcontent>









    xsl:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:styleshe et version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:page="htt p://www.wolterinkwe bdesign.com/xml/page"
    xmlns:xc="http://www.wolterinkwe bdesign.com/xml/xcontent">

    <xsl:output method="xml" indent="yes"/>

    <xsl:param name="absolute_ url"/>
    <xsl:param name="upload_ur l"/>

    <xsl:template match="/xc:xcontent">
    <page:page type="module">
    <page:button-new module="files" multiple="besta nd"/>
    <ul>
    <xsl:for-each select="xc:best and">
    <li style="vertical-align:middle;">
    <xsl:if test="position( ) mod 2=1">
    <xsl:attribut e name="class">al ternate</xsl:attribute>
    </xsl:if>
    <a>
    <xsl:attribut e name="href">
    <xsl:value-of select="$upload _url"/>/<xsl:value-of select="xc:file/."/>
    </xsl:attribute>
    <img style="margin-right:4px;">
    <xsl:attribut e name="src">
    <xsl:value-of select="xc:file/@mime-type-image"/>
    </xsl:attribute>
    </img>
    <xsl:value-of select="xc:besc hrijving"/>
    </a>
    <page:button-edit-delete module="files" id="{./id}" multiple="besta nd"/>
    </li>
    </xsl:for-each>
    </ul>
    </page:page>
    </xsl:template>

    </xsl:stylesheet>





    Now i get the following error:

    XSLT Error:

    array(4) {
    [0]=>
    resource(99) of type (XSLT Processor)
    [1]=>
    int(3)
    [2]=>
    int(0)
    [3]=>
    array(6) {
    msgtype ="error"
    code =string(1) "2"
    module ="Sablotron"
    URI ="arg:/xsl"
    line ="2"
    msg ="XML parser error 27: unbound prefix"
    }
    }


    So the error is in line 2 of the xsl file. but what is wrong?


  • Joris Gillis

    #2
    Re: XML: XSL: Unbounds Prefix

    Hi,[color=blue]
    > XSLT Error:
    >
    > array(4) {
    > [0]=>
    > resource(99) of type (XSLT Processor)
    > [1]=>
    > int(3)
    > [2]=>
    > int(0)
    > [3]=>
    > array(6) {
    > msgtype ="error"
    > code =string(1) "2"
    > module ="Sablotron"
    > URI ="arg:/xsl"
    > line ="2"
    > msg ="XML parser error 27: unbound prefix"[/color]
    The debug message says it is a XML parser error, so the problem is not realted to XSLT.[color=blue]
    > }
    > }[/color]

    It seems you've forgotten to declare the 'xsl' namespace.


    regards,
    --
    Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
    Ceterum censeo XML omnibus esse utendum

    Comment

    • Tjerk Wolterink

      #3
      Re: XML: XSL: Unbounds Prefix

      >[color=blue]
      >
      > It seems you've forgotten to declare the 'xsl' namespace.
      >
      >
      > regards,[/color]

      haha, dam'n im blind!

      Comment

      Working...