[xml] problem with id and xpath in 2.5.7



Hi,

According to xml specs, ID like a:b should be perfectly valid as it
matches the Name production http://www.w3.org/TR/REC-xml#NT-Name

[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender

[5] Name ::= (Letter | '_' | ':') (NameChar)*

Running the XML file below through xmllint --valid --noout is ok as
well.

However, it seems I can't locate this particular ID by XPath:

$ xmllint --valid --shell

/ > xpath id('a:b')
Object is a Node Set :
Set contains 0 nodes:

/ > xpath id('a')
Object is a Node Set :
Set contains 1 nodes:
1  ELEMENT foo
    ATTRIBUTE id
      TEXT
        content=a
/ >


<?xml version="1.0"?>
<!DOCTYPE foo [
<!ELEMENT foo (bar)>
<!ATTLIST foo id ID #REQUIRED>
<!ELEMENT bar EMPTY>
<!ATTLIST bar id ID #REQUIRED>
]>
<foo id="a">
<bar id="a:b"/>
</foo>

The same works fine with 2.5.4. Is it a bug?

Thanks,

-- Petr



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]