Very Strang XML problem

Discussion in 'XML' started by Tjerk Wolterink, Nov 12, 2004.

  1. Hello i'm using php with xml.

    I've an rather big xsl file, that has the following code in it:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:page="http://www.wolterinkwebdesign.com/xml/page"
    xmlns:menu="http://www.wolterinkwebdesign.com/xml/menu"
    xmlns:role="http://www.wolterinkwebdesign.com/xml/roles">

    <xsl:eek:utput method="xhtml" indent="yes"/>

    <xsl:param name="absolute_url"/>
    <xsl:param name="upload_url"/>
    <xsl:param name="document_root"/>
    <xsl:param name="role"/>
    <xsl:param name="xcd_dir"/>

    <xsl:variable name="menu" select="document(concat($document_root,
    '/menu.xml'))"/>
    <xsl:variable name="roles" select="document(concat($xcd_dir,
    '/roles.xml'))"/>

    <xsl:template match="/page:page">
    ....
    ...
    [cut]



    I then transform an xml file (that xml file is not really interesting)
    using this xsl. But when i have this line in the xsl:
    <xsl:variable name="roles" select="document(concat($xcd_dir,
    '/roles.xml'))"/>

    I get the following error[sablatron php]:

    XSLT Error:

    array(4) {
    [0]=>
    resource(18) of type (XSLT Processor)
    [1]=>
    int(3)
    [2]=>
    int(0)
    [3]=>
    array(6) {
    ["msgtype"]=>
    string(5) "error"
    ["code"]=>
    string(1) "2"
    ["module"]=>
    string(9) "Sablotron"
    ["URI"]=>
    string(26) "C:/webserver/xcd/roles.xml"
    ["line"]=>
    string(1) "1"
    ["msg"]=>
    string(51) "XML parser error 4: not well-formed (invalid token)"
    }
    }



    So i conclusion: roles.xml is not valid xml. But my browser says it is!

    And i cannot find the invalid token. Please Help!!!


    roles.xml:



    <?xml version="1.0" encoding="ISO-8859-1"?>
    <roles xmlns="http://www.wolterinkwebdesign.com/xml/roles">

    <!--
    ! The admin role.
    ! And admin should have all permisions to do its task
    !
    !-->
    <role id="admin" isadmin="true">
    <name>Administrator</name>
    <description>De Administrator kan alles verwijderen, toevoegen en
    bewerken op de site.</description>
    <grants>
    <for name="all">
    <action name="edit" grant="true" />
    <action name="new" grant="true" />
    <action name="read" grant="true" />
    </for>
    </grants>
    </role>

    <!--
    ! A generic visitor role.
    ! Anybody who is not given a role explicit is a visitor
    !-->
    <role id="visitor" isvisitor="true">
    <name>Bezoeker</name>
    <description>Bezoeker van de site</description>
    <grants>
    <for name="all">
    <action name="read" grant="true" />
    <action name="edit" grant="true" />
    </for>
    <for name="gastenboek">
    <action name="new" grant="true"/>
    <action name="edit" grant="true" />
    </for>
    <for name="medewerkers">
    <action name="new" grant="true"/>
    </for>
    <for name="files">
    <action name="new" grant="true"/>
    </for>
    <for name="news">
    <action name="new" grant="true"/>
    </for>
    </grants>
    </role>

    </roles>
     
    Tjerk Wolterink, Nov 12, 2004
    #1
    1. Advertising

  2. In article <4194ef29$0$30588$>,
    Tjerk Wolterink <> wrote:

    ><xsl:variable name="roles" select="document(concat($xcd_dir,
    >'/roles.xml'))"/>


    > string(26) "C:/webserver/xcd/roles.xml"


    It appears that you are trying to call the document function with an
    argument "C:/webserver/xcd/roles.xml", which is presumably a windows
    file name. The argument to the document function should be a URL,
    probably something like "file:///C:/webserver/xcd/roles.xml".

    -- Richard
     
    Richard Tobin, Nov 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David
    Replies:
    4
    Views:
    425
    David
    Sep 12, 2003
  2. Stijn Oude Brunink
    Replies:
    3
    Views:
    538
    Ron Natalie
    Nov 12, 2004
  3. Replies:
    3
    Views:
    366
    Karl Heinz Buchegger
    Mar 30, 2005
  4. Gustavo G. Rondina

    malloc's strang behavior

    Gustavo G. Rondina, Jul 21, 2004, in forum: C Programming
    Replies:
    11
    Views:
    546
    Keith Thompson
    Jul 23, 2004
  5. Nicole
    Replies:
    36
    Views:
    1,216
    Awful Dog Autry
    Mar 1, 2009
Loading...

Share This Page