开发者

significance of '#' in, e.g., <ruleref uri="#cardinalOnes" />

As an example of using the "#" sign in the following manner, what would a line in an xml document such as <ruleref uri="#cardinalOnes" /> mean? The only reference I could find to the possible significance to the "#" sign with this usage is an attribute ID called "implied" or "required". But I am not sure that this is what this means in this case. Is it? Just by deduction, from looking at the rest of the XML document, I can figure out that "#cardinalOnes" is referencing another rule within the same document actually called <rule id="cardinalOnes">. But I could not find an explanation of this us开发者_运维知识库age in the text 'XML in a Nutshell' or w3.org. Can anyone please verify that my deduction is correct? Is this usage explained anywhere? Thanks.


In this case, there's no significance to XML. XML doesn't know, or care what a "ruleref", "uri" or "#cardinalOnes" is. They're simply ELEMENT, ATTRIBUTE, and STRING tokens to the XML parser.

Now, that doesn't mean they have no value to whatever it is that is trying to read that XML file. Something must care about what "ruleref" is, and the whatever cares about that may well have defined semantics for what a # in the "uri" attribute does.

But in the large, for generic XML, it doesn't mean anything at all.


The #implied or #required tags are attribute tags themselves, not string values assigned to an attribute.

You can see some examples here:

http://www.w3schools.com/dtd/dtd_attributes.asp


After speaking with some colleagues, it turns out that <ruleref uri="#cardinalOnes" /> is referenced in http://www.w3.org/TR/speech-grammar/. The “#” is an official XML internal link in the Standard SRGS syntax which is the W3C standard for writing speech grammars.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜