ページ 1 / 1
チュートリアル「簡単な日記を作る」でつまづいてます
Posted: 2007年7月13日(金) 15:48
by acs
このたびCMSdesignerをみつけて試しています。
プログラムはおろかPHPの知識もないのでエラーがでるとさっぱり
わかりません。
チュートリアルの「簡単な日記帳を作る」でつまづいてしまっております。。。
http://www自分のwebサイト/nikki.php?eid=00001
を表示するところで以下のエラーがでます。
Warning: domxml_xslt_stylesheet_file() [function.domxml-xslt-stylesheet-file]: AttValue: " or ' expected in /home/always302/public_html/cmsdesigner/include/xmlutil.php.inc on line 217
Warning: domxml_xslt_stylesheet_file() [function.domxml-xslt-stylesheet-file]: attributes construct error in /home/always302/public_html/cmsdesigner/include/xmlutil.php.inc on line 217
Warning: domxml_xslt_stylesheet_file() [function.domxml-xslt-stylesheet-file]: Couldn't find end of Start Tag stylesheet line 3 in /home/always302/public_html/cmsdesigner/include/xmlutil.php.inc on line 217
Warning: domxml_xslt_stylesheet_file() [function.domxml-xslt-stylesheet-file]: Extra content at the end of the document in /home/always302/public_html/cmsdesigner/include/xmlutil.php.inc on line 217
Fatal error: Call to a member function on a non-object in /home/always302/public_html/cmsdesigner/include/xmlutil.php.inc on line 228
と記述がでてきて何もわかりません。
もし手助けいただけるならお願いします。。
本当に初心者ですみません
Posted: 2007年7月13日(金) 17:57
by tsu
一度作成したファイルを載せて頂けませんか?
・スキーマファイル (xxxx.chema.xml
・デザイン定義ファイル (xxxx.xxxx.design.xsl
・埋め込んでいる.php (xxxx.php
Posted: 2007年7月13日(金) 18:13
by tsu
と、チュートリアルがどうなってるか覚えてないですが、簡単に書いてみます。
diaryというディレクトリを前提に。
スキーマ (diary.schema.xml
コード: 全て選択
<?xml version="1.0" encoding="UTF-8"?>
<schema name="diary" caption="日記" >
<data name="title" type="text" output="html2" caption="タイトル" />
<data name="description" type="textarea" output="html2" caption="本文" />
</schema>
デザイン定義 (diary.entry.design.xsl
コード: 全て選択
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="EUC-JP" omit-xml-declaration="yes" />
<xsl:template match="/entry">
<div>
<h3>
<!-- スキーマで設定したtitleを表示 -->
<xsl:value-of select="title" />
</h3>
<div>
<!-- スキーマで設定したdescriptionを表示 -->
<xsl:value-of select="description" />
</div>
</div>
</xsl:template>
</xsl:stylesheet>
埋め込みページ (diary.php
コード: 全て選択
<?php require_once( "cmsdesigner/include/view.php.inc" ); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-language" content="ja" />
<meta http-equiv="content-type" content="text/html;charset=euc-jp" />
</head>
<body>
<!-- 埋め込みタグ エントリ1件表示-->
<cmsd:entry name="diary" design="entry" />
</body>
</html>
<?php cmsd_end_template(); ?>
サイトコンフィグファイル (site.config.xml
コード: 全て選択
<?xml version="1.0" encoding="UTF-8"?>
<site>
<entries>
<entry name="diary" schema="diary" caption="日記"/>
</entries>
</site>
こんな感じで作るとうまく動きます。
デザイン定義ファイルなどは必ず文字コードを "UTF-8" にしてください。
返信ありがとうございます
Posted: 2007年7月18日(水) 18:58
by acs
記述とおり試しましたが、まだ以下のようなエラーがでます。。
どうしてでしょう??
http://www.web-acs.jp/nikki.php?eid=00002
nikki.php
<?php require_once( "cmsdesigner/include/view.php.inc" ); // encoding="euc-jp" ?>
<html>
<head>
<meta http-equiv="content-Type" content="text/html;charset=euc-jp" />
<title>テストページです</title>
</head>
<body>
テストページ<br>
<table border="1">
<tr>
<td>
メニュー部分
</td>
<td>
<cmsd:entry name="public_diary" design="default" />
</td>
</tr>
</table>
</body>
</html>
<?php cmsd_end_template(); ?>
↑秀丸を使って上記のようにコードを記述しています。
エンコードEUC-JPは日本語(EUC)を選択しているのですが違うのでしょうか?
Posted: 2007年7月18日(水) 22:45
by tsu
んーdomxml_xslt_stylesheet_file()関数でこけてるんでしょうか。
お使いのサーバでcheck.phpは試しましたか?
Posted: 2007年7月18日(水) 22:47
by tsu
あ、埋め込みページはEUC-JPで問題ありません。
Re: 返信ありがとうございます
Posted: 2007年7月19日(木) 11:02
by webmaster
acsさん、ご質問ありがとうございます。また、tsuさん、適切な対応いつも
ありがとうございます。
エラーメッセージが分かりにくく、ご迷惑をおかけしております。
おそらく、diary.entry.design.xsl の内容に何か問題が起きているものと
思われます。
一度、diary.entry.design.xslファイルの内容をそのままここへ引用して
頂けないでしょうか。
すみません
Posted: 2007年7月19日(木) 13:15
by acs
dairy.defalt.design.xsl
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"version="1.0">
<xsl:output method="html"encoding="EUC-JP"omit-xml-declaration="yes" />
<xsl:template match="/entry">
<xsl:value-of select="title" />
<xsl:value-of select="body" />
</xsl:template>
</xsl:stylesheet>
tsuさんいつもありがとうございます。
webmaster様、ご迷惑をおかけしますが、よろしくお願いします。
Posted: 2007年7月19日(木) 13:32
by tsu
dairy.defalt.design.xsl
コード: 全て選択
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"version="1.0">
<xsl:output method="html"encoding="EUC-JP"omit-xml-declaration="yes" />
<xsl:template match="/entry">
<xsl:value-of select="title" />
<xsl:value-of select="body" />
</xsl:template>
</xsl:stylesheet>
正しくは
コード: 全て選択
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="EUC-JP" omit-xml-declaration="yes" />
<xsl:template match="/entry">
<xsl:value-of select="title" />
<xsl:value-of select="body" />
</xsl:template>
</xsl:stylesheet>
となります。
属性を繋げて書いてあるためのエラーだったようです。
上記で試してみて下さい。
ありがとうございます
Posted: 2007年7月19日(木) 13:52
by acs
エラーが回避されました☆
助かりました。ありがとうございます。
次のステップへとすすんでみます。
今後ともよろしくお願いします。