XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 18th, 2004, 01:20 AM
proxy proxy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 186 proxy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 11 sec
Reputation Power: 7
not well-formed (invalid token)

im working on a php parser and have run into a problem. the error i get is Cannot process XSLT document [2]: XML parser error 4: not well-formed (invalid token)

ill post the parser code, and the xml/xsl code

PHP Code:
<?php
$xml 
'C:\Program Files\Apache Group\Apache2\htdocs\rss\a.xml';
$xsl 'C:\Program Files\Apache Group\Apache2\htdocs\rss\b.xsl';
$xh xslt_create();
$result xslt_process($xh$xml$xsl);
if (!
$result) {
    die(
sprintf("Cannot process XSLT document [%d]: %s"
                
xslt_errno($xh), xslt_error($xh)));
}

echo 
$result;

xslt_free($xh);
?>

below is the xml file
PHP Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<XSLTMessage>
Hello World!
</XSLTMessage>

and below is the xsl file
PHP Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="name(/XSLTMessage)" /></title>
</head>
<body>
<xsl:apply-templates select="/XSLTMessage" />
</body>
</html>
</xsl:template>
<xsl:template match ="XSLTMessage">
<p><b><xsl:value-of select="text()" /></b></p>
</xsl:template>
</xsl:stylesheet>


by the way, if i link the stylesheet by typing so within the xml document, it works-i dont know why the php parser is giving me this error...

Reply With Quote
  #2  
Old February 18th, 2004, 10:03 AM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 259 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 16 m 51 sec
Reputation Power: 6
Try replacing <XSLTMessage> with some other tag that does not start with "XSL"

Reply With Quote
  #3  
Old February 18th, 2004, 03:28 PM
proxy proxy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 186 proxy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 11 sec
Reputation Power: 7
that didnt work, im getting the same error

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > not well-formed (invalid token)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway