RE: Pointing to stuff that's not there

Hi Richard,

> There is no notes field in the second msg element.
> Do we say somewhere in the spec what is supposed to happen 
> in this case (since there *is* an element that matches 
> the selector attribute)?

I don't think there is anything in the specification that discusses this case.

If there is no node at the place where locNotePointer points to, I would assume it is the same as having no note for the selected
node.

Currently I would return the following test-result file:

<nodeList xmlns:its="http://www.w3.org/2005/11/its">
  <nodeList datacat="localizationnote">
    <node path="/myMessages" outputType="default-value">
      <output />
    </node>
    <node path="/myMessages/msg[1]" outputType="default-value">
      <output />
    </node>
    <node path="/myMessages/msg[1]/@id" outputType="default-value">
      <output />
    </node>
    <node path="/myMessages/msg[1]/data[1]" outputType="new-value-global">
      <output its:locNoteType="description">
        <its:locNote_Text>Indicates that the resource file {0} could not be loaded.</its:locNote_Text>
      </output>
    </node>
    <node path="/myMessages/msg[2]" outputType="default-value">
      <output />
    </node>
    <node path="/myMessages/msg[2]/@id" outputType="default-value">
      <output />
    </node>
    <node path="/myMessages/msg[2]/data[1]" outputType="default-value">
      <output />
    </node>
  </nodeList>
</nodeList>

I guess the question is also whether this case should result in an error or not. I would say not an error, otherwise it may be
impossible to use the global rules on some files. For example, ResX files are very similar to the format you used as an example, and
the <comment> element is optional.

-yves

 

-----Original Message-----
From: public-i18n-its-request@w3.org [mailto:public-i18n-its-request@w3.org] On Behalf Of Richard Ishida
Sent: Friday, October 27, 2006 12:30 PM
To: public-i18n-its@w3.org
Subject: Pointing to stuff that's not there


Suppose we have global rules such as 

<its:rules its:version="1.0">
		<its:translateRule selector="//msg/notes" translate="no"/>
		<its:locNoteRule locNoteType="description" selector="//msg/data" 
			locNotePointer="../notes"/>
		</its:rules>


And that the content looks like this:

<msg id="FileNotFound">
		<notes>Indicates that the resource file {0} could not be loaded.</notes>
		<data>Cannot find the file {0}.</data>
		</msg>
	<msg id="DivByZero">
		<data>Invalid parameter.</data>
		</msg>

There is no notes field in the second msg element.  Do we say somewhere in the spec what is supposed to happen in this case (since
there *is* an element that matches the selector attribute)?

RI


============
Richard Ishida
Internationalization Lead
W3C (World Wide Web Consortium)

http://www.w3.org/People/Ishida/
http://www.w3.org/International/
http://people.w3.org/rishida/blog/
http://www.flickr.com/photos/ishida/

Received on Friday, 27 October 2006 19:34:32 UTC