This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Error in example 18. <its:documentRule its:translateSelector="//*[@dita:translate='yes']" its:translate="yes"/> <its:documentRule its:translateSelector="//*[@dita:translate='no']" its:translate="no"/> Attribute translate is not in dita namespace and should not be prefixed in XPath expressions above.
(In reply to comment #0) > Error in example 18. > > <its:documentRule its:translateSelector="//*[@dita:translate='yes']" > its:translate="yes"/> > <its:documentRule its:translateSelector="//*[@dita:translate='no']" > its:translate="no"/> > > Attribute translate is not in dita namespace and should not be prefixed in > XPath expressions above. > Hi Jirka, The attribute *is* in the DITA namespace. The default namespace of the document is the DITA namespace. However, only inside the <documentRules> element we use a prefix, via a schematron like namespace binding mechanism.
But default namespace is not applied to attributes, only to elements. See http://www.w3.org/TR/REC-xml-names/#defaulting
(In reply to comment #2) > But default namespace is not applied to attributes, only to elements. See > http://www.w3.org/TR/REC-xml-names/#defaulting > As I said, we are using a separate namespace binding mechanism, like schematron. IMO, we need to have attribute values with prefixes too. How would you otherwise describe the difference between <its:documentRule its:translateSelector="//*[@dita:translate='yes']" its:translate="yes"/> and <its:documentRule its:translateSelector="//*[@xyz:translate='yes']" its:translate="yes"/> I am assuming that both the vocabularies "dita" and "xyz" have a translate attribute.
You are missing my point. Try to evaluate //*[@dita:translate='yes'] over sample DITA instance you have in spec. You will see, that nothing is returned. If you need to target only DITA elements with translate attribute, use //dita:*[@translate='yes']
(In reply to comment #4) > You are missing my point. Try to evaluate > > //*[@dita:translate='yes'] > > over sample DITA instance you have in spec. You will see, that nothing is > returned. If you need to target only DITA elements with translate attribute, > use > > //dita:*[@translate='yes'] > How would you write an XPath expression (using the ITS namespace binding mechanism) that gives you all DITA elements, with a translate attribute with the value "yes" from a namespace XYZ? Would that be //dita:*[@xyz:translate='yes']?
Yes
(In reply to comment #6) > Yes > Then: How would you write an XPath expression (using the ITS namespace binding mechanism) that gives you all elements (from any namespace), with a translate attribute with the value "yes" from a namespace XYZ?
//*[@xyz:translate = 'yes'] Please note that the following two documents are *not* same: <x:a xmlns:x="foo"> <x:b x:c="bar"/> </x:a> <a xmlns="foo"> <b c="bar"/> </a> In the first sample attribute "c" is in "foo" namespace (via "x" prefix). In the second example attribute "c" is in no namespace.
(In reply to comment #8) > //*[@xyz:translate = 'yes'] > > Please note that the following two documents are *not* same: > > <x:a xmlns:x="foo"> > <x:b x:c="bar"/> > </x:a> > > <a xmlns="foo"> > <b c="bar"/> > </a> > > In the first sample attribute "c" is in "foo" namespace (via "x" prefix). In > the second example attribute "c" is in no namespace. > O.K., so the error is not in the XPath expression but in the instance, which should say <ph its:translate="no" xml:lang="fr">Et voilĂ !</ph> The last rule wins whereas the XPath expression in the documentRule still will be //*[@dita:translate='no'] Note that we reserve in our description of namespace binding in documentRule(s) names without a prefix for the "no namespace" case.
No, sample document is OK, because DITA has its own translate attribute. The problem is in XPath expression, which should be either: //*[@translate='yes'] or //dita:*[@translate='yes'] depending whether you are expecting foreign elements in DITA instances.
Resolve (This is Example 15 in current draft Titled "Mapping of the ITS data categories translatability and terminology to [Dita 1.0] markup")
Closed, no further action necessary.