xml中的xsl定义 [英] xsl defining in xml
问题描述
movies.xml中的前几行如下:
My first few lines in movies.xml are as follows :
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="movies_style.xsl"?>
<movies
xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com file:///B:/USC/Academic/DBMS/HWS/no3/movie_sch.xsd">
movies_style.xsl中的前几行如下:
and first few lines in movies_style.xsl are as follows :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
问题是,如果从movies.xml文件中删除链接的模式文件,并且仅将标记保留为<movies>
,则正确的样式表将显示为输出,否则浏览器中将不显示任何内容,并且控制台中将错误显示为:
Problem is if remove schema file linking from movies.xml file and keep tag only as <movies>
then proper styled table is shown as output else nothing is displayed in browser and error is displayed in console as:
不安全尝试从URL文件:///B:/USC/Academic/DBMS/HWS/中加载URL文件:///B:/USC/Academic/DBMS/HWS/no3/movies_style.xsl no3/movies.xml.域,协议和端口必须匹配."
"Unsafe attempt to load URL file:///B:/USC/Academic/DBMS/HWS/no3/movies_style.xsl from frame with URL file:///B:/USC/Academic/DBMS/HWS/no3/movies.xml. Domains, protocols and ports must match."
看起来像一些名称空间错误.谁能指出到底是什么?
Looks like some namespace mistake. Can anyone point out exactly what ?
推荐答案
已将targetnamespace命名为w3schools.org.那不应该在那里.那就是问题所在.
had given targetnamespace as w3schools.org. that shouldn't be there. that was the problem.
这篇关于xml中的xsl定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!