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"
xmlnsage="http://www.wolterinkwebdesign.com/xml/page"
xmlns:menu="http://www.wolterinkwebdesign.com/xml/menu"
xmlns:role="http://www.wolterinkwebdesign.com/xml/roles">
<xslutput method="xhtml" indent="yes"/>
<xslaram name="absolute_url"/>
<xslaram name="upload_url"/>
<xslaram name="document_root"/>
<xslaram name="role"/>
<xslaram 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="/pageage">
....
...
[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>
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"
xmlnsage="http://www.wolterinkwebdesign.com/xml/page"
xmlns:menu="http://www.wolterinkwebdesign.com/xml/menu"
xmlns:role="http://www.wolterinkwebdesign.com/xml/roles">
<xslutput method="xhtml" indent="yes"/>
<xslaram name="absolute_url"/>
<xslaram name="upload_url"/>
<xslaram name="document_root"/>
<xslaram name="role"/>
<xslaram 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="/pageage">
....
...
[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>