XSL
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
*目次 [#le8e42e0]
#contents
*目的 [#l85657bf]
ブラウザごとというか、ベンダーごとのXSLの仕様の違いをまと...
**動機 [#y1c01d0e]
シェアは現象傾向にある某ブラウザへの対応依頼があった。
*W3Cの仕様 [#wea09a72]
http://www.w3.org/TR/xslt
参考データとかが書いてある。
*さまざまなXSLの実装 [#q5675bfb]
**XSLのWiki [#ta9a8078]
http://en.wikipedia.org/wiki/XML_template_engine
wikiを見ると、ほんとうにいろいろな実装があるものだと思う。
***Sablotron [#v1c8a8a7]
SablotronがGETとかが扱えるようで良さげだったので、リンク...
http://www.gingerall.org/sablotron.html
**確認対象 [#tdbaed65]
とりあえず、シェアの多そうなところだけ見てみる。
|Microsoft||
|Mozila|TransforMiiX.|
|Safari||
**Microsoft [#le36e9f2]
***参考文献 [#ib838987]
http://msdn.microsoft.com/ja-jp/library/aa468550.aspx
**firefox [#i1c37333]
***TransforMiiX(firefoxがお手本にしているXSLT) [#w1f72cc9]
http://www.mozilla.org/projects/xslt/
***Tutorial [#x9636f59]
http://nwalsh.com/docs/tutorials/xsl/xsl/slides.html
今は無きSunの2000年度のドキュメント!
あたらしいのは、載っていないのかな?
***FAQ [#t244055e]
https://developer.mozilla.org/en/XSL_Transformations_in_M...
***単体でTransforMiiXを起動させる方法 [#i568f784]
https://developer.mozilla.org/en/Building_TransforMiiX_st...
***firefoxの困った実装点 [#v267b3cd]
Firefoxで
disable-output-escaping="yes"
上記の仕様がXSLの仕様として決まっているにも関わらず、対応...
*disable-output-escaping [#z35f292e]
disable-output-escapingの問題に特化したページ
http://www.dpawson.co.uk/xsl/sect2/N2215.html
***とりあえずの対応方法 [#l0bb440b]
<xsl:copy-of>
を使って、生成済みのエレメントを複製する方法が書いてあっ...
***firefox開発者の言い訳 [#r6c62587]
FAQに言い訳が書いてある。
https://developer.mozilla.org/en/XSL_Transformations_in_M...
***バグ番号98168 [#s1bd5edc]
既に、バグとして起票済みで、たくさんの人が困っているもよう
https://bugzilla.mozilla.org/show_bug.cgi?id=98168
直せばいいのに。。。
***考察 [#x86817da]
メリットとしては、ことごとく、特殊な文字は、エスケープし...
デメリット、<xsl:element>で要素を生成するしか手だてはない...
これを防ぐ方法として、output-disable-encoding="yes"が使え...
*属性値テンプレートという記述方法 [#x7796b00]
http://ykr414.com/xml/xml05.html
*ブラウザでの切り替え方法 [#h81d3069]
**system-property [#e1e6f376]
サンプルコード
Version number: <xsl:value-of select="system-property('x...
Vendor: <xsl:value-of select="system-property('xsl:vendo...
Vendor URL: <xsl:value-of select="system-property('xsl:v...
***使用例 [#jd5b8ecc]
<xsl:if test="system-property('xsl:vendor')='Transf...
<!-- Mozilla specific markup -->
</xsl:if>
<xsl:if test="system-property('xsl:vendor')='Micros...
<!-- IE specific markup -->
</xsl:if>
***MSXSLのバージョンでの切り替え [#vaa8e950]
参照元:firefoxのFAQ
<xsl:if xmlns:msxsl="urn:schemas-microsoft-com:xslt"
test="system-property('msxsl:version')=3">
<!-- MSXML3 specific markup -->
</xsl:if>
このサンプルでもしマイクロソフトのブラウザなどを使ってい...
<xsl:value-of select="system-property('xsl:vendor')" />
の値は
Microsoft
となる。
***参考文献 [#a90c1e26]
http://www.devguru.com/technologies/xslt/quickref/xslt_fu...
**元のデータ側でmedia属性を使って切り替える方法 [#y7f90535]
例
http://www.atmarkit.co.jp/fxml/rensai/cocoon03/cocoon03b....
**xFormsでの方法 [#l2469272]
http://orbeon-forms-ops-users.24843.n4.nabble.com/Using-x...
*参考 [#ba5f8771]
たのしいXML
http://www6.airnet.ne.jp/manyo/xml/index.html
*確認用のXML [#a7e87068]
**その1 [#x03d12ab]
<?xml version="1.0" >
<object>
<foo>
<bar>
hoge
</bar>
</foo>
</object>
*確認用のXSL [#a21f305d]
**最小 [#t12d4f7c]
<?xml version="1.0" encoding="Shift_JIS"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<div>
fuga
</div>
正しいHTMLではないが、<div>タグで囲むと一応表示してくれた。
IEとfirefoxで確認した。
**HTML風 [#re9babc0]
<?xml version="1.0" encoding="Shift_JIS"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>SAMPLE</title>
</head>
<body>
<div>fuga</div>
</body>
</html>
</xsl:template>
終了行:
*目次 [#le8e42e0]
#contents
*目的 [#l85657bf]
ブラウザごとというか、ベンダーごとのXSLの仕様の違いをまと...
**動機 [#y1c01d0e]
シェアは現象傾向にある某ブラウザへの対応依頼があった。
*W3Cの仕様 [#wea09a72]
http://www.w3.org/TR/xslt
参考データとかが書いてある。
*さまざまなXSLの実装 [#q5675bfb]
**XSLのWiki [#ta9a8078]
http://en.wikipedia.org/wiki/XML_template_engine
wikiを見ると、ほんとうにいろいろな実装があるものだと思う。
***Sablotron [#v1c8a8a7]
SablotronがGETとかが扱えるようで良さげだったので、リンク...
http://www.gingerall.org/sablotron.html
**確認対象 [#tdbaed65]
とりあえず、シェアの多そうなところだけ見てみる。
|Microsoft||
|Mozila|TransforMiiX.|
|Safari||
**Microsoft [#le36e9f2]
***参考文献 [#ib838987]
http://msdn.microsoft.com/ja-jp/library/aa468550.aspx
**firefox [#i1c37333]
***TransforMiiX(firefoxがお手本にしているXSLT) [#w1f72cc9]
http://www.mozilla.org/projects/xslt/
***Tutorial [#x9636f59]
http://nwalsh.com/docs/tutorials/xsl/xsl/slides.html
今は無きSunの2000年度のドキュメント!
あたらしいのは、載っていないのかな?
***FAQ [#t244055e]
https://developer.mozilla.org/en/XSL_Transformations_in_M...
***単体でTransforMiiXを起動させる方法 [#i568f784]
https://developer.mozilla.org/en/Building_TransforMiiX_st...
***firefoxの困った実装点 [#v267b3cd]
Firefoxで
disable-output-escaping="yes"
上記の仕様がXSLの仕様として決まっているにも関わらず、対応...
*disable-output-escaping [#z35f292e]
disable-output-escapingの問題に特化したページ
http://www.dpawson.co.uk/xsl/sect2/N2215.html
***とりあえずの対応方法 [#l0bb440b]
<xsl:copy-of>
を使って、生成済みのエレメントを複製する方法が書いてあっ...
***firefox開発者の言い訳 [#r6c62587]
FAQに言い訳が書いてある。
https://developer.mozilla.org/en/XSL_Transformations_in_M...
***バグ番号98168 [#s1bd5edc]
既に、バグとして起票済みで、たくさんの人が困っているもよう
https://bugzilla.mozilla.org/show_bug.cgi?id=98168
直せばいいのに。。。
***考察 [#x86817da]
メリットとしては、ことごとく、特殊な文字は、エスケープし...
デメリット、<xsl:element>で要素を生成するしか手だてはない...
これを防ぐ方法として、output-disable-encoding="yes"が使え...
*属性値テンプレートという記述方法 [#x7796b00]
http://ykr414.com/xml/xml05.html
*ブラウザでの切り替え方法 [#h81d3069]
**system-property [#e1e6f376]
サンプルコード
Version number: <xsl:value-of select="system-property('x...
Vendor: <xsl:value-of select="system-property('xsl:vendo...
Vendor URL: <xsl:value-of select="system-property('xsl:v...
***使用例 [#jd5b8ecc]
<xsl:if test="system-property('xsl:vendor')='Transf...
<!-- Mozilla specific markup -->
</xsl:if>
<xsl:if test="system-property('xsl:vendor')='Micros...
<!-- IE specific markup -->
</xsl:if>
***MSXSLのバージョンでの切り替え [#vaa8e950]
参照元:firefoxのFAQ
<xsl:if xmlns:msxsl="urn:schemas-microsoft-com:xslt"
test="system-property('msxsl:version')=3">
<!-- MSXML3 specific markup -->
</xsl:if>
このサンプルでもしマイクロソフトのブラウザなどを使ってい...
<xsl:value-of select="system-property('xsl:vendor')" />
の値は
Microsoft
となる。
***参考文献 [#a90c1e26]
http://www.devguru.com/technologies/xslt/quickref/xslt_fu...
**元のデータ側でmedia属性を使って切り替える方法 [#y7f90535]
例
http://www.atmarkit.co.jp/fxml/rensai/cocoon03/cocoon03b....
**xFormsでの方法 [#l2469272]
http://orbeon-forms-ops-users.24843.n4.nabble.com/Using-x...
*参考 [#ba5f8771]
たのしいXML
http://www6.airnet.ne.jp/manyo/xml/index.html
*確認用のXML [#a7e87068]
**その1 [#x03d12ab]
<?xml version="1.0" >
<object>
<foo>
<bar>
hoge
</bar>
</foo>
</object>
*確認用のXSL [#a21f305d]
**最小 [#t12d4f7c]
<?xml version="1.0" encoding="Shift_JIS"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<div>
fuga
</div>
正しいHTMLではないが、<div>タグで囲むと一応表示してくれた。
IEとfirefoxで確認した。
**HTML風 [#re9babc0]
<?xml version="1.0" encoding="Shift_JIS"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>SAMPLE</title>
</head>
<body>
<div>fuga</div>
</body>
</html>
</xsl:template>
ページ名: