Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   XML (http://www.programmingforums.org/forum28.html)
-   -   Calling On Dameon (http://www.programmingforums.org/showthread.php?t=7537)

Kilo Dec 12th, 2005 6:43 PM

Calling On Dameon
 
Hey bro(or anyone reading this), i have always been interested in XML. I have always made my websites in HTML/PHP. Well looking at your webpage completely inspired me to rewrite mine. Ofcourse naturally im having problems. Can you not view a XML page directly? Must you refer to a page that refers to the XML page?

This is my Error:

:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Invalid at the top level of the document. Error processing resource 'file:///C:/site/default.xsl'. Line 1, Position 47

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



(Sorry all i ever do is work and sleep anymore, i wish i had the time for studying and research like i used to)

Dameon Dec 12th, 2005 7:02 PM

Perhaps you should include the entire stylesheet. The line appears to have nothing wrong with it, as I pasted it into my own stylesheet with no ill effects.

Kilo Dec 12th, 2005 7:07 PM

lol the entire XSL is included?

Dameon Dec 12th, 2005 7:37 PM

With your post, I mean.

Kilo Dec 12th, 2005 7:51 PM

Oh, well i used your style sheet? The only thing i have edited so far was the path. couldn't get this thing to work at all so decided to ask you about it... but here it is lol.

:

  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!--  <xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes"/>
  -->
- <xsl:template match="/">
- <html>
- <head>
- <title>
  <xsl:value-of select="page/title" />
  </title>
  <style type="text/css">@import url(/layout.css);</style>
  </head>
- <body>
- <div id="header">
- <h1>
  <xsl:value-of select="page/heading" />
  </h1>
  </div>
- <div id="main">
  <xsl:apply-templates select="page/menu" />
- <div id="content">
  <xsl:copy-of select="page/content" />
  </div>
  </div>
  </body>
  </html>
  </xsl:template>
- <xsl:template match="menu">
- <div id="menu">
  <xsl:value-of select="./@title" />
- <ul>
- <xsl:for-each select="./menuitem">
- <xsl:choose>
- <xsl:when test="@active = 1">
- <li>
- <a id="current">
- <xsl:attribute name="href">
  <xsl:value-of select="@href" />
  </xsl:attribute>
  <xsl:value-of select="." />
  </a>
  </li>
  </xsl:when>
- <xsl:otherwise>
- <li>
- <a>
- <xsl:attribute name="href">
  <xsl:value-of select="@href" />
  </xsl:attribute>
  <xsl:value-of select="." />
  </a>
  </li>
  </xsl:otherwise>
  </xsl:choose>
  </xsl:for-each>
  </ul>
  </div>
  </xsl:template>
  </xsl:stylesheet>


EDIT: im not going to rip your site bro, but i believe your work could teach me some value.

Kilo Dec 12th, 2005 8:52 PM

ok i created a new file and only added this line:

:

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

this is my new error:

:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

System does not support the specified encoding. Error processing resource 'file:///C:/site/default.xsl'. Line 1, Position ...

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


Pizentios Dec 13th, 2005 9:15 AM

why not check out: http://www.w3schools.com/xml/default.asp

tones of stuff about learning xml fir the first time.

Kilo Dec 13th, 2005 12:44 PM

thanks Pizentios. But i have a big problem with researching and constantly expanding my knowledge. I seem to have lost all free time to do this when i enrolled in college and got a job as a computer programmer.

DaWei Dec 13th, 2005 1:47 PM

I would suggest that the rate of return (time-wise) from such research as Pizentios alludes to is much greater than piecemeal trips to the forum for detailed information, much of which may be scanty or wrong. Possibly you have yet to acquire the proper techniques.

Kilo Dec 14th, 2005 8:06 AM

Thanks you guys, i spent about and hour 1/2 reading that site yesterday. And i have a some working verision of my site in XML/XSL. And still for some reason dameon's code won't run for me, but all well.


All times are GMT -5. The time now is 6:14 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC