Bug #5364
closedCan't get keys to work over SVG elements
0%
Description
Hi. In my original stylesheet I have defined such keys:
<xsl:key name="lines-by-start" match="svg:line" use="@ac:id1"/>
<xsl:key name="lines-by-end" match="svg:line" use="@ac:id2"/>
However I get an error when I try to use them:
code: "XTDE0640"
message: "Definition of key Q{}lines-by-start is circular"
name: "XError"
I've attempted to create a test case with the same keys: https://namedgraph.github.io/saxon-js2-test/
Stylesheet: https://namedgraph.github.io/saxon-js2-test/client.xsl (see the CIRCULAR KEY
template)
Note that there's an <svg>
element in the HTML.
However in the test stylesheet I get a different error:
code: "FORG0001"
message: "Invalid local name: 'ac:id1' (prefix='', uri='null')"
name: "XError"
Maybe I've messed up the namespaces in SVG, but I don't see where.
Updated by Martynas Jusevicius over 2 years ago
I get Invalid local name: 'ac:id1' (prefix='', uri='null')
even if I don't use the keys.
So I wonder if the root of the problem are the ac:id1
/ac:id2
attributes in SVG? Are custom namespaces not supported?
Updated by Martynas Jusevicius over 2 years ago
The Invalid local name
error is the same as in #5019.
Updated by Norm Tovey-Walsh over 2 years ago
What browser are you using, and on what platform? I fear the underlying cause here may be that the browser doesn't build a DOM that has namespaces declared properly. HTML5 munges all the SVG and MathML elements so they don't have (or at least don't need to have) namespaces. It's possible that the antipathy towards namespaces exhibited by the browsers extends to ignoring attempts to use them in HTML5 documents. You might have better luck if you arrange for the server to assert that these are XHTML documents, but I don't know what other consequences that might have.
Updated by Michael Kay over 2 years ago
I suspect the XTDE0640 means that we've gone into index construction when there's already a half-constructed index from a previous call, and the reason for that is a failure during the previous construction attempt. So the underlying error is being masked.
Updated by Martynas Jusevicius over 2 years ago
Observed on Firefox 97.0.1 (64-bit) on Windows 10.
So far I've addressed this by replacing attributes in a custom namespace with data-
attributes. The keys then work as expected.
Updated by Norm Tovey-Walsh over 2 years ago
I think the invalid local name error happens if you serve the page up as HTML. If I serve the page up as XHTML, that error goes away. But I can't reproduce the circular key error either.
Updated by Norm Tovey-Walsh over 2 years ago
- Status changed from New to AwaitingInfo
If you switch to XHTML, can you reproduce the bug in your test case?
Updated by Norm Tovey-Walsh about 2 years ago
- Sprint/Milestone set to SaxonJS 2.5
If we don't get any more information, I'm afraid we'll have to close this as "cannot reproduce".
Updated by Norm Tovey-Walsh about 2 years ago
- Status changed from AwaitingInfo to Closed
Could not reproduce. If you can provide a test case, please reopen the bug or open a new one.
Please register to edit this issue
Also available in: Atom PDF Tracking page