Very Strang XML problem

T

Tjerk Wolterink

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>
 
R

Richard Tobin

Tjerk Wolterink said:
<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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top