登入论坛

浏览完整版本 : SSD



Jenifer
09-04-26, 16:06
这学期学这门课的同学请注意:
在用到 key或者keyref 的时候,会需要用到 xpath这个概念,XPath uses path expressions to navigate in XML documents。 要注意的一点是,用 xpath select nodes or attributes 的方法是不一样的, 如果要 select an attribute, 要用 @ 这个符号。 http://www.w3schools.com/Xpath/xpath_syntax.asp, 这个网站是一个xpath tutorial, 看看上面就知道怎么用 xpath 了。

ubiquitous
09-04-26, 16:14
顶~~~第一个作业里要用到这个么?

Jenifer
09-04-27, 10:12
用到一点点,只要知道怎么 select nodes or attributes 就可以了。

ubiquitous
09-04-27, 12:02
用到一点点,只要知道怎么 select nodes or attributes 就可以了。

恩,好像是第三个问题的时候要用到,但是我改了几次还没有完全正确

ubiquitous
09-04-27, 15:31
firma-ns.xsd:18 element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The content is not valid. Expected is (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*)).
firma-ns.xsd:33 element keyref: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}keyref', attribute 'refer': References from this schema to components in no namespace are not allowed, since not indicated by an import statement.
firma-ns.xsd:41: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The content is not valid. Expected is (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*)).
WXS schema firma-ns.xsd failed to compile

请问上面的错误应该怎么修改呢?

Jenifer
09-04-27, 21:56
一共三个错误。 每个Fehlermeldung 都有告诉你在第几行出错了。
第一和第三个错误是指 parser 要你明确定义是哪一种 annotation?, ((simpleType | complexType)?, (unique | key | keyref)*。
第二个错误是,因为你定义的这个 schema里面的 key 都是有 namespace的,所以当你用 keyref 来 referenzieren 已经定义好的 key 时, 要用 namespace (也就是要用 namespace 的 präfix )再加上 key 的名字。

ubiquitous
09-04-27, 23:15
一共三个错误。 每个Fehlermeldung 都有告诉你在第几行出错了。
第一和第三个错误是指 parser 要你明确定义是哪一种 annotation?, ((simpleType | complexType)?, (unique | key | keyref)*。
第二个错误是,因为你定义的这个 schema里面的 key 都是有 namespace的,所以当你用 keyref 来 referenzieren 已经定义好的 key 时, 要用 namespace (也就是要用 namespace 的 präfix )再加上 key 的名字。

谢谢解释~~~我改了半天还是这三个错误,annotationfolien里面就一篇带过,而且我加了也没有什么效果,还是交作业的时候问问tutor吧,虽然没编译成功,但是希望还能给点辛苦分,哈哈~~~再次感谢:65: